Repository navigation
irregular: tree search with maximal spaces on the actual geometry - #754
Merged
Merged
Conversation
Move the directions, the trapezoid sets, the supports and the construction of the bin types out of the branching scheme of the tree search, and the slide of a trapezoid set along a supporting part into a TrapezoidSetSlider class, so that other branching schemes can use them.
Add a tree search between the tree search and the tree search with periodic packings: like the latter, a node stores the maximal empty spaces of the bin, an insertion packs a block (a single item or a periodic block) in the empty space closest to the bottom-left corner, and a node is evaluated by a greedy completion; like the former, the blocks are described by their trapezoids, rest on the supporting parts of the bin or of the blocks already packed and slide until they don't overlap them. It is only run when requested (--use-tree-search-maximal-spaces 1).
Cover each item by at most 8 rectangles, and cut the empty spaces by all the rectangles of a block at once, discarding the parts too small for the remaining blocks.
Also expose its parameters in the Python bindings, and score the insertions by the profit of the blocks only.
… tests The literature instances are not available in the CI and are too large for unit tests. Use instances from data/irregular/tests instead and add a small knapsack instance with L-shapes and triangles.
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.
Add a tree search with maximal spaces for
irregular, between the tree search and the tree search with periodic packings:It only handles instances with a single bin (knapsack and feasibility directly, the other objectives through sequential feasibility), and it is never selected automatically:
--use-tree-search-maximal-spaces 1/use_tree_search_maximal_spaces.Refactoring
trapezoid_set.hpp), and the slide of a trapezoid set along a supporting part into aTrapezoidSetSliderclass (trapezoid_slider.hpp), replacing five copies of the same loop. The results of the tree search are unchanged (identical solution files on the literature instances, queue sizes 16 and 128).empty_spaces.hpp, with a new function cutting them by several rectangles at once.Results
Literature strip packing instances (13 instances, not-anytime sequential):
CG:SHOP 2024 knapsack instances with 100 to 1379 items (anytime, 30 s): the new algorithm beats the tree search with periodic packings on all 14 instances, and the tree search on the 3 instances with more than 1000 items (e.g. jigsaw 1338: 147183 vs 34965 for the tree search and 106152 for the periodic packings). The tree search remains better between 100 and 700 items, where the greedy completions of the new algorithm are expensive.
Tests
tree_search_maximal_spaces_test: checks that the solutions found on the 35 small instances ofdata/irregular/tests(including a newknapsack_l_shapes_triangles.json) have no overlaps and no item outside the bin.The algorithm is documented in
doc/internals/irregular/tree_search_maximal_spaces.rst.