Skip to content

irregular: find the supporting parts of the blocks above their bounding boxes in the tree search with maximal spaces - #832

Merged
fontanf merged 1 commit into
masterfrom
irregular-tsms-supporting-parts
Nov 9, 2026
Merged

fontanf merged 1 commit into
masterfrom
irregular-tsms-supporting-parts

Conversation

@fontanf

@fontanf fontanf commented Nov 8, 2026

Copy link
Copy Markdown
Owner

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:

Instance Bin used, before → after
1000 item types 48.4% → 83.4%
2000 item types 34.2% → 85.8%

For reference, #829 reports 80% and 74% with its option K = 25 in 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-deterministic mode, on the literature instances without spacing).

New test: knapsack_item_item_minimum_spacing with 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.

…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
fontanf force-pushed the irregular-tsms-supporting-parts branch from 0a7e49e to 93239bb Compare November 9, 2026 06:03
@fontanf
fontanf merged commit 615fdb2 into master Nov 9, 2026
4 of 7 checks passed
@fontanf
fontanf deleted the irregular-tsms-supporting-parts branch November 9, 2026 06:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant