Skip to content

irregular: select the tree search maximal spaces when many items fit in the sections of the bin - #833

Merged
fontanf merged 3 commits into
masterfrom
irregular-tsms-selection
Nov 9, 2026
Merged

fontanf merged 3 commits into
masterfrom
irregular-tsms-selection

Conversation

@fontanf

@fontanf fontanf commented Nov 8, 2026 •

Copy link
Copy Markdown
Owner

Depends on #832 (and #831): their commits are included until they are merged.

Change

With a single bin and the knapsack or feasibility objective, run the tree search maximal spaces instead of the tree search when many items fit in both an x section and a y section of the bin. As in the rectangle and box selections, a section's count is the bin's height (resp. width) divided by the mean height (resp. width) of the items' bounding boxes. The threshold is the new parameter many_items_in_section_threshold (4 by default, also in Python).

The criterion only replaces the tree search where it would have been selected. The instances for which the tree search periodic packing runs alone (dominated by item types with many copies, and many items in the bin) are not concerned, e.g. users/2026-04-23_sub* and users/2026-04-08_sub*.

The selection of the other problem types is unchanged.

Results

Default selection, this branch vs #832, 79 instances (literature, user2025, opencutlist, users), 15 s:

Before After
users/2026-11-08_many_item_types_1000 (#829) 0.83M 1.67M
users/2026-11-08_many_item_types_2000 (#829) 0.81M 3.86M
  • 66 instances are identical. The other differences mostly disappear on repeated runs.
  • opencutlist/deer_2 (bin packing with leftovers, 1 bin) is slightly worse: leftover value 1.9975–1.9985M in 2 of 3 runs, against 2.0074M in 3 runs before (−0.4%). The criterion also applies to the knapsack subproblems of the algorithms for several bins.

The instances of #829 are added in data/irregular/users/, with the solutions found by the default selection in 60 s (83.4% and 85.8% of the bin used, instead of 80% and 74% for the solutions of #829), checked for overlaps.

All the irregular tests pass.

Doc: algorithm_selection.rst (irregular line), and the automatic selection sections of the irregular tree search and tree search maximal spaces pages.

…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.
…in the sections of the bin

With a single bin and the 'Knapsack' or 'Feasibility' objective, run the
tree search maximal spaces instead of the tree search when many items fit in
both an x section and a y section of the bin: the height (resp. width) of
the bin divided by the mean height (resp. width) of the bounding boxes of the
items is larger than 'many_items_in_section_threshold' (4 by default), as in
the selection of the rectangle and box problem types. The number of
insertions of a node of the tree search may then be large, and its search
may stay shallow. The instances for which the tree search periodic packing
is run alone are not concerned.
@fontanf
fontanf force-pushed the irregular-tsms-selection branch from c57af64 to 1e092bb Compare November 9, 2026 06:03
@fontanf
fontanf merged commit da9cc8f into master Nov 9, 2026
8 of 14 checks passed
@fontanf
fontanf deleted the irregular-tsms-selection branch November 9, 2026 06:04
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