Repository navigation
irregular: compute the periodic packings before solving sub-instances - #883
Merged
Merged
Conversation
…ime limit The precomputations of the blocks (box, rectangle, rectangleguillotine), of the periodic packings and of the simplified shapes (irregular) took a 'const bool& end'. They never checked the time limit, and since the end booleans of the algorithm formatters are atomic, passing one bound the reference to a temporary copy, so they didn't stop when the algorithm ended either. Under load, the periodic packings of alma_01 ran 30-40 s past a 60 s time limit. They now take an 'optimizationtools::Timer', with the end boolean of the algorithm formatter added to it. The periodic packings also check it inside the computation of each item type and of the wrapping periodic packings. An interrupted computation of the periodic packings now discards everything computed in the call: previously, the wrapping periodic packings between the item types computed before the interruption were never computed.
Since the cached structures are computed lazily, the periodic packings were never computed on the instance solved by the sequential single knapsack, the sequential value correction, the dichotomic search and the column generation. Their sub-instances only get the periodic packings of the original instance if they are already computed, so the subproblems computed them again. On alma_02, the first solution was found after 29 s. These algorithms now request the periodic packings before solving sub-instances. On alma_02, the first solution is found after 6 s, including the computation of the periodic packings.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Depends on #882 (uses the timer version of
Instance::get_periodic_packings); its commit is included in this branch.Problem
Since the cached structures are computed lazily (aab3523), nothing requests the periodic packings on the instance solved by the sequential single knapsack, the sequential value correction, the dichotomic search and the column generation. A sub-instance only gets the periodic packings of its original instance if they are already computed, so the subproblems computed them again.
Previously, they were computed by the instance builder, before the timer starts.
Change
These four algorithms now request the periodic packings on the instance before solving its sub-instances, as is already done for the simplified shapes.
Results
alma2025/alma_02,-t 60:Irregular unit tests pass.