Repository navigation
irregular: find the supporting parts of the blocks above their bounding boxes in the tree search with maximal spaces - #832
Merged
Conversation
…ng boxes in the tree search with maximal spaces The supporting parts of a block are computed on the inflated shapes of its items, and the empty spaces above it start at the top of the rectangles covering these inflated shapes. With an item-item spacing, they are above the bounding box of the non-inflated shapes, which was used to select the blocks whose supporting parts may touch the bottom of an empty space: the empty spaces above the blocks had no supporting part, and were removed. Use the bounding box of the supporting parts of the blocks instead.
fontanf
force-pushed
the
irregular-tsms-supporting-parts
branch
from
November 9, 2026 06:03
0a7e49e to
93239bb
Compare
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 #831 (its two commits are included until it is merged).
Bug
With an item-item spacing, the tree search with maximal spaces couldn't put a block on top of another one.
The supporting parts of a block are computed on the inflated shapes of its items, and the empty spaces above it start at the top of the rectangles covering these inflated shapes, so about one spacing above the bounding box of the non-inflated shapes. This bounding box was used to select the blocks whose supporting parts may touch the bottom of an empty space. So the empty spaces above the blocks had no supporting part, and they were removed, even when they were large: on the 1000 item types instance of #829, about 600 000 of the 2 000 000 of area of the bin were removed this way in the first greedy completion, including a strip of the whole width of the bin over its top half.
The fix uses the bounding box of the supporting parts of the blocks instead.
Results
Instances of #829 (item-item spacing 2), 60 s,
--use-tree-search-maximal-spaces 1:For reference, #829 reports 80% and 74% with its option
K = 25in the tree search. The solutions are feasible (no overlapping items, no item outside the bin).On
users/2026-04-23_sub(spacing 0.1, 2215 items), all the items are packed after 18 s, against 57% after 120 s before.Other instances (literature, user2025, opencutlist, users; 15 s): the bin packing with leftovers instances are the same, except one better; the differences on the strip packing ones are only due to the time limit (identical results in
not-anytime-deterministicmode, on the literature instances without spacing).New test:
knapsack_item_item_minimum_spacingwith its certificate in the solution tests of the tree search with maximal spaces (2 items packed out of 4 before, 4 now).Not included
A parameter limiting the number of insertions of a node to K, like #829 in the tree search, was tried with K = 5, 10, 25, 50, 100: it made no difference beyond noise, before or after this fix. The time goes to the slides which fail, which such a limit can't count without breaking the removal of the empty spaces, and with this fix, to the greedy completions, each of which places hundreds of items.