Repository navigation
Separate the shape and the value of the leftovers, and add the variable-sized bin packing with leftovers objective - #887
Merged
Merged
Conversation
…le-sized bin packing with leftovers objective
Shape of the leftovers:
- add the cut modes (the L-shape cut into two rectangles or boxes, along
the faces of the used space, in the order which gives the largest value)
and the staircase modes (the bin minus the union of the boxes between the
corner of the bin and each item) to the rectangle, box, boxstacks and
irregular problem types
Value of the leftovers ('leftover_value_type'):
- 'squared-area' (default): the square of the area (or volume) of the
leftover, or the sum of the squares of its pieces; a single large
leftover is worth more than several smaller ones of the same total area
- 'depth': the integral, over the leftover, of the distance to its edge;
compact leftovers are worth more than long and thin ones
- the total leftover value of a solution counts the bins which are not
used for their whole value
New objective 'variable-sized-bin-packing-with-leftovers', for the
rectangleguillotine, rectangle, box, boxstacks and irregular problem types:
- minimize the net cost of the bins: their cost minus a refund for each of
their leftovers; a leftover is refunded at the price of its bin per unit
of space, for the space equivalent to its value (its value times a
factor which makes the largest bin type worth its own space); the cost
and the leftovers are traded off in a single quantity, whether costs are
set for the bin types or not
- the solutions are found by the algorithms of the variable-sized bin
packing objective; only their comparison differs
- for rectangleguillotine, the leftovers of a bin are the plate after its
last 1-cut and the sub-plate after the last 2-cut of its last
first-level sub-plate
Also add a documentation page dedicated to the leftovers, and expose the
new options in the command line, the Python package and the website.
Add an example of the variable-sized bin packing with leftovers objective, and regenerate the solutions, outputs and images of the examples.
fontanf
force-pushed
the
leftover-value
branch
from
November 23, 2026 22:13
b5a2144 to
ce1fe15
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.
Shape of the leftovers
New leftover modes for the rectangle, box, boxstacks and irregular problem types:
area-cut,xy-cut,xyz-cut,bottom-left-cut, ...): the L-shape cut into two rectangles (or boxes) along the faces of the used space, in the order which gives the largest value;staircase,bottom-left-staircase, ...): the bin minus the union of the boxes between the corner of the bin and each item.Value of the leftovers
New parameter
leftover_value_type:squared-area(default): the square of the area (or volume) of the leftover, or the sum of the squares of its pieces. It ranks a single leftover like its area, but a single large leftover is worth more than several smaller ones of the same total area;depth: the integral, over the leftover, of the distance to its edge. Compact leftovers are worth more than long and thin ones.The total leftover value of a solution now counts the bins which are not used for their whole value.
New objective
variable-sized-bin-packing-with-leftoversAvailable for the rectangleguillotine, rectangle, box, boxstacks and irregular problem types.
squared-area, a leftover of areaain a bin of costcand areaAis refundedc / A × a² / A_max.NetCostfield of the output.Other changes
data/irregular/users/2024-08-08is regenerated (near-tie at the noise level).Tests