Repository navigation
Reduction: full-bin items and perfect pairs for box and rectangleguillotine - #730
Merged
Merged
Conversation
…lotine
Port the dedicated-bin reservations of rectangle and onedimensional
('reduce_full_bin_items', 'reduce_perfect_pairs', enabled by default,
exposed in the Python bindings) to box and rectangleguillotine, for
'BinPacking' with a single bin type. They are compared against the bin
shrunk to the largest total length of the items along each axis, with the
current (possibly lifted) item dimensions. An item filling the shrunk bin
can't share its bin with any other item; two items spanning it along one
axis and filling it together along the other one get a dedicated bin
together (the other items of their bins are beside them, in slabs that fit
together in a single bin). Never more dedicated bins than the bin type
has copies; if they take every copy while items remain, the instance is
proven infeasible. The dedicated items are left out of the reduced
instance, the bin type has its copies reduced, 'optimize' adds the
dedicated bins back onto the bin packing bound, and 'unreduce_solution'
adds them back with the true dimensions of the items.
- box: a pair requires a single allowed rotation for both items; not with
a maximum weight and weighted items, nor with resources. Runs in a loop
with lifting, which can make an item fill the shrunk bin.
- rectangleguillotine: lengths are increased by the cut thickness; same
cut constraints as lifting ('items_can_shrink'), no maximum distance
between cuts, no trims, no resources, items alone in their stacks. The
dedicated bins are built as cut trees with a trimming cut where needed;
a pair is skipped if its cut tree would need more stages than allowed.
The tests of other operations on instances the reservations would reduce
entirely now disable them.
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.
Ports rectangle's and onedimensional's dedicated-bin reservations (
reduce_full_bin_items,reduce_perfect_pairs) to box and rectangleguillotine, forBinPackingwith a single bin type. Both flags are enabled by default and exposed in the Python bindings.How it works
optimizeadds the dedicated bins back onto the bin packing bound, andunreduce_solutionadds them back with the true dimensions of the items.box
rectangleguillotine
items_can_shrink: no minimum distance between cuts, minimum waste or maximum number of cuts), no maximum distance between cuts, no trims, no resources, and items alone in their stacks.Tests
BinPackingsolves with and without reduction (instances with items filling the bin and complementary pairs; random cut types, stages, orientations and cut thicknesses for rectangleguillotine): 200 instances each for box and rectangleguillotine, with matching numbers of bins and feasible solutions.