rectangle-guillotine solver¶
The rectangle-guillotine solver solves problems where items are two-dimensional rectangles that must be cut from rectangular bins using guillotine cuts — cuts that go all the way from one side of the current plate to the other.
These problems occur for example in glass cutting, wooden panel cutting, and paper cutting industries.
Features:
Objectives:
Knapsack
Bin packing
Bin packing with leftovers
Open dimension X
Open dimension Y
Variable-sized bin packing
Item types
Item rotation (90°)
Stacks (items that must stay grouped)
Bin types
Trims (border offsets on each side)
Rectangular defects
Cutting constraints
Number of cutting stages
Cut type (Roadef2018, NonExact, Exact, Homogenous)
First stage orientation (horizontal or vertical)
Minimum and maximum distances between cuts
Maximum number of consecutive 1-cuts
Maximum number of consecutive 2-cuts
Cut thickness
Guillotine vs non-guillotine patterns¶
A cutting pattern is a guillotine pattern if it can be produced by a sequence of straight cuts, each going all the way from one edge of the current plate to the opposite edge. The number of cutting stages of a pattern is the number of sets of parallel cuts necessary to extract all the items from the pattern. Here is an example of a 4-staged pattern:
A pattern that cannot be produced this way, however the items are arranged, is a non-guillotine pattern.
The rectangle-guillotine solver only produces guillotine patterns. Problems where non-guillotine patterns are required (or simply allowed) should instead be modeled with the rectangle solver, which places items freely.
The following example solves the same instance — four items of clearly different shapes (8×3, 4×5, 5×4 and 7×6) arranged in a “pinwheel” around a tiny unused central rectangle — with both solvers (bin-packing objective). The rectangle solver, which is free to produce non-guillotine patterns, packs all 4 items into a single 12×9 bin using the pinwheel arrangement, leaving almost no waste. The rectangle-guillotine solver cannot reproduce this pattern with straight cuts, however the items are arranged, so it needs a second bin.
WIDTH,HEIGHT,ORIENTED,COPIES
8,3,1,1
4,5,1,1
5,4,1,1
7,6,1,1
WIDTH,HEIGHT,COPIES
12,9,2
NAME,VALUE
objective,bin-packing
|
|
|---|---|
packingsolver_rectangle \
--items items.csv \
--bins bins.csv \
--parameters parameters.csv \
--certificate solution.csv
|
packingsolver_rectangleguillotine \
--items items.csv \
--bins bins.csv \
--parameters parameters.csv \
--certificate solution.csv
|
Basic usage¶
The rectangle-guillotine solver takes as input:
an item CSV file; option:
--items items.csva bin CSV file; option:
--bins bins.csvoptionally a defect CSV file; option:
--defects defects.csvoptionally a parameter CSV file; option:
--parameters parameters.csv
It outputs:
a solution CSV file; option:
--certificate solution.csv
The item file contains:
The width of the item type (mandatory)
column
WIDTHInteger value
The height of the item type (mandatory)
column
HEIGHTInteger value
The number of copies of the item type
column
COPIESdefault value:
1
The profit of an item of this type (for a knapsack objective)
column
PROFITdefault value: item area (
WIDTH * HEIGHT)
The bin file contains:
The width of the bin type (mandatory)
column
WIDTHInteger value
The height of the bin type (mandatory)
column
HEIGHTInteger value
The number of copies of the bin type
column
COPIESdefault value:
1
The minimum number of copies that must be used
column
COPIES_MINdefault value:
0
The cost of a bin of this type (for a variable-sized bin packing objective)
column
COSTdefault value: bin area
The parameter file has two columns: NAME and VALUE. The possible entries are:
The objective; name:
objective; possible values:knapsackbin-packingbin-packing-with-leftoversopen-dimension-xopen-dimension-yvariable-sized-bin-packing
Inputs:
WIDTH,HEIGHT,ORIENTED,COPIES
250,200,0,2
150,300,0,2
200,150,0,3
WIDTH,HEIGHT,COPIES
1000,700,5
NAME,VALUE
objective,bin-packing-with-leftovers
Solve:
packingsolver_rectangleguillotine \
--items items.csv \
--bins bins.csv \
--parameters parameters.csv \
--certificate solution.csv
=================================
PackingSolver
=================================
Problem type
------------
RectangleGuillotine
Instance
--------
Objective: BinPackingWithLeftovers
Number of item types: 3
Number of items: 7
Number of bin types: 1
Number of bins: 5
Number of stacks: 3
Number of defects: 0
Number of stages: 3
Cut type: NonExact
First stage orientation: Vertical
Minimum distance between 1-cuts: 0
Maximum distance between 1-cuts: -1
Minimum distance between 2-cuts: 0
Maximum distance between 2-cuts: -1
Minimum waste length: 0
Maximum number of consecutive 1-cuts: -1
Maximum number of consecutive 2-cuts: -1
Cut through defects: 0
Cut thickness: 0
Total item area: 280000
Total item profit: 280000
Largest item profit: 50000
Largest item copies: 3
Total bin area: 3500000
Largest bin cost: 700000
Time # bins Waste Waste (%) Comment
---- ------ ----- --------- -------
0.000 1 210000 42.86 TS g 1 d Vertical q 1
0.000 1 175000 38.46 TS g 1 d Vertical q 1
0.001 1 70000 20.00 TS g 1 d Vertical q 1
0.002 1 35000 11.11 TS g 1 d Vertical q 19
0.010 1 35000 11.11 TS g 0 d Vertical q 211
Final statistics
----------------
Time (s): 5.00008
Solution
--------
Number of items: 7 / 7 (100%)
Item area: 280000 / 280000 (100%)
Item profit: 280000 / 280000 (100%)
Number of bins: 1 / 5 (20%)
Number of different bins: 1
Bin area: 700000 / 3500000 (20%)
Bin cost: 700000
Cutting cost: 0
Waste: 35000 (11.1111%)
Full waste: 420000 (60%)
Width: 450
Height: 700
Second leftover value: 15000
Number of stages: 3
Feasible: 1
Number of stages: 1
Min. waste length: 1
Min. dist. 1-cuts: 1
Max. dist. 1-cuts: 1
Min. dist. 2-cuts: 1
Max. dist. 2-cuts: 1
Max. no. 1-cuts: 1
Max. no. 2-cuts: 1
Stacks: 1
Defects: 1
Cut through defects: 1
Item copies: 1
Visualize:
python3 scripts/visualize_rectangleguillotine.py solution.csv
Maximum number of cutting stages¶
The maximum number of stages may be constrained.
The number of cutting stages; name:
number_of_stages; default value:3
The following example packs 24 items (12 item types) into 80×40 bins with cut_type set to exact, first_stage_orientation set to vertical and the bin-packing-with-leftovers objective. Since items must fill their sub-plate exactly at the last stage, the number of stages directly limits how tightly they can be nested. With only 2 stages, that requirement leaves so much waste that a third bin is needed (3 bins, 40.15% waste). Adding a third stage is already enough to fit everything into 2 bins, with far less waste (10.44%):
WIDTH,HEIGHT,ORIENTED,COPIES
23,23,1,3
19,19,1,3
17,17,1,3
13,13,1,3
13,4,1,1
13,10,1,1
12,20,1,1
9,11,1,1
11,11,1,1
13,11,1,1
7,7,1,3
5,5,1,3
WIDTH,HEIGHT,COPIES
80,40,7
2 stages |
3 stages |
|---|---|
parameters.csv¶
NAME,VALUE
objective,bin-packing-with-leftovers
number_of_stages,2
cut_type,exact
first_stage_orientation,vertical
|
parameters.csv¶
NAME,VALUE
objective,bin-packing-with-leftovers
number_of_stages,3
cut_type,exact
first_stage_orientation,vertical
|
packingsolver_rectangleguillotine \
--items items.csv \
--bins bins.csv \
--parameters parameters.csv \
--certificate solution.csv
|
packingsolver_rectangleguillotine \
--items items.csv \
--bins bins.csv \
--parameters parameters.csv \
--certificate solution.csv
|
Allowing an unlimited number of stages keeps the same 2 bins but reduces waste further still (6.46%), by nesting items through a deeper hierarchy of cuts (up to a 6th-stage cut, visible in the image below):
NAME,VALUE
objective,bin-packing-with-leftovers
number_of_stages,unlimited
cut_type,exact
first_stage_orientation,vertical
packingsolver_rectangleguillotine \
--items items.csv \
--bins bins.csv \
--parameters parameters.csv \
--certificate solution.csv
Cut types¶
roadef2018: pattern from the 2018 ROADEF challenge; stage-2 cuts produce only items of identical height; trimming cuts are allowednon-exact: more flexible; stage-3 cuts are not required; some waste is allowed in sub-platesexact: items must fill their sub-plate exactly with no waste at stage 3homogenous: all items in a strip have the same height
The cut type is set via the cut_type key in the parameters CSV file, using one of the values above.
The following example packs 24 items (12 item types) into 80×40 bins with 3 cutting stages, first_stage_orientation set to vertical and the bin-packing-with-leftovers objective, which minimizes the number of bins first and, among solutions using that many bins, maximizes the leftover value of the last bin. Every bin in every solution below uses several genuine stage-1 cuts, splitting it into multiple vertical strips. All 4 cut types pack every item into the same 2 bins, but the leftover value they reach decreases as the cut type gets more restrictive:
roadef2018: leftover value 72 — the most permissive cut type, it takes full advantage of its free trimming cuts past the 3-stage budgetnon-exact: leftover value 65 — still allows sub-plates to be filled with some waste, but withoutroadef2018’s free trimming cuts, so it packs slightly less tightlyexact: leftover value 57 — items must fill their sub-plate exactly, which rules out some of the arrangements the 2 cut types above usehomogenous: leftover value 48 — the most restrictive cut type here, since items sharing a sub-plate must also be of the same type
WIDTH,HEIGHT,ORIENTED,COPIES
23,23,1,3
19,19,1,3
17,17,1,3
13,13,1,3
13,4,1,1
13,10,1,1
12,20,1,1
9,11,1,1
11,11,1,1
13,11,1,1
7,7,1,3
5,5,1,3
WIDTH,HEIGHT,COPIES
80,40,7
|
|
|---|---|
parameters.csv¶
NAME,VALUE
objective,bin-packing-with-leftovers
cut_type,roadef2018
number_of_stages,3
first_stage_orientation,vertical
|
parameters.csv¶
NAME,VALUE
objective,bin-packing-with-leftovers
cut_type,non-exact
number_of_stages,3
first_stage_orientation,vertical
|
packingsolver_rectangleguillotine \
--items items.csv \
--bins bins.csv \
--parameters parameters.csv \
--certificate solution.csv
|
packingsolver_rectangleguillotine \
--items items.csv \
--bins bins.csv \
--parameters parameters.csv \
--certificate solution.csv
|
|
|
|---|---|
parameters.csv¶
NAME,VALUE
objective,bin-packing-with-leftovers
cut_type,exact
number_of_stages,3
first_stage_orientation,vertical
|
parameters.csv¶
NAME,VALUE
objective,bin-packing-with-leftovers
cut_type,homogenous
number_of_stages,3
first_stage_orientation,vertical
|
packingsolver_rectangleguillotine \
--items items.csv \
--bins bins.csv \
--parameters parameters.csv \
--certificate solution.csv
|
packingsolver_rectangleguillotine \
--items items.csv \
--bins bins.csv \
--parameters parameters.csv \
--certificate solution.csv
|
First stage orientation¶
The first stage orientation controls whether stage-1 cuts (see Guillotine vs non-guillotine patterns above) are vertical or horizontal.
The first stage orientation; name:
first_stage_orientation; possible values:verticalorhorizontal
The following example packs 4 items (4×3, 4×7, 6×5 and 6×4) into 10×10 bins with only 2 cutting stages (bin-packing objective). The two 4-wide items share a column, stacking to exactly fill a 4×10 vertical strip; the two 6-wide items share a second 6×10 vertical strip, stacking to a height of 9 with some waste. With first_stage_orientation set to vertical, stage-1 cuts run along these two columns and all 4 items fit into a single bin. With horizontal, stage-1 cuts run the other way instead: since no two items share the same height, each stage-1 row can only hold one item at that depth, and a second bin is needed.
|
|
|---|---|
items.csv¶
WIDTH,HEIGHT,ORIENTED,COPIES
4,3,1,1
4,7,1,1
6,5,1,1
6,4,1,1
|
items.csv¶
WIDTH,HEIGHT,ORIENTED,COPIES
4,3,1,1
4,7,1,1
6,5,1,1
6,4,1,1
|
bins.csv¶
WIDTH,HEIGHT,COPIES
10,10,3
|
bins.csv¶
WIDTH,HEIGHT,COPIES
10,10,3
|
parameters.csv¶
NAME,VALUE
objective,bin-packing
number_of_stages,2
first_stage_orientation,horizontal
|
parameters.csv¶
NAME,VALUE
objective,bin-packing
number_of_stages,2
first_stage_orientation,vertical
|
packingsolver_rectangleguillotine \
--items items.csv \
--bins bins.csv \
--parameters parameters.csv \
--certificate solution.csv
|
packingsolver_rectangleguillotine \
--items items.csv \
--bins bins.csv \
--parameters parameters.csv \
--certificate solution.csv
|
Item rotations¶
Each item may individually be allowed to be rotated by 90° or have a fixed orientation.
By default, item rotation is allowed.
Whether the item is fixed in its original orientation (cannot be rotated 90°)
column
ORIENTED0: rotation allowed (default)1: item is oriented; rotation not allowed
The following example packs 2 copies of a 6×10 item into 10×12 bins (bin-packing objective). Without rotation, two items side by side need 12 of width (more than the bin’s 10) and stacked need 20 of height (more than the bin’s 12), so they cannot share a bin: 2 bins are needed. With rotation allowed, both items are turned on their side (10×6) and stacked exactly into a single 10×12 bin.
Without rotation |
With rotation |
|---|---|
items.csv¶
WIDTH,HEIGHT,ORIENTED,COPIES
6,10,1,2
|
items.csv¶
WIDTH,HEIGHT,ORIENTED,COPIES
6,10,0,2
|
bins.csv¶
WIDTH,HEIGHT,COPIES
10,12,2
|
bins.csv¶
WIDTH,HEIGHT,COPIES
10,12,2
|
parameters.csv¶
NAME,VALUE
objective,bin-packing
|
parameters.csv¶
NAME,VALUE
objective,bin-packing
|
packingsolver_rectangleguillotine \
--items items.csv \
--bins bins.csv \
--parameters parameters.csv \
--certificate solution.csv
|
packingsolver_rectangleguillotine \
--items items.csv \
--bins bins.csv \
--parameters parameters.csv \
--certificate solution.csv
|
Cut thickness¶
The width of the saw blade; name:
cut_thickness; default value:0
The following example packs 3 items (10×4, 10×3 and 10×3) into 10×10 bins (bin-packing objective), stacked to exactly fill the bin height. With no cut thickness, all 3 items fit in a single bin. Each cut also consumes material equal to the saw blade width: with a cut thickness of 1, the two cuts separating the 3 items eat into the available height, so the third item no longer fits and a second bin is needed.
|
|
|---|---|
items.csv¶
WIDTH,HEIGHT,ORIENTED,COPIES
10,4,1,1
10,3,1,1
10,3,1,1
|
items.csv¶
WIDTH,HEIGHT,ORIENTED,COPIES
10,4,1,1
10,3,1,1
10,3,1,1
|
bins.csv¶
WIDTH,HEIGHT,COPIES
10,10,3
|
bins.csv¶
WIDTH,HEIGHT,COPIES
10,10,3
|
parameters.csv¶
NAME,VALUE
objective,bin-packing
cut_thickness,0
|
parameters.csv¶
NAME,VALUE
objective,bin-packing
cut_thickness,1
|
packingsolver_rectangleguillotine \
--items items.csv \
--bins bins.csv \
--parameters parameters.csv \
--certificate solution.csv
|
packingsolver_rectangleguillotine \
--items items.csv \
--bins bins.csv \
--parameters parameters.csv \
--certificate solution.csv
|
Trims¶
Trims model a reserved border around the bin (e.g., for clamping or edge defects). They prevent items from being placed within the specified distance of each edge.
A hard trim is physically cut away: the trim strip is counted as waste.
A soft trim is reserved but not cut: waste is only counted from the first actual cut inward.
Border trims: distances from each edge before any item can be placed
columns
BOTTOM_TRIM,TOP_TRIM,LEFT_TRIM,RIGHT_TRIMin the bin CSV fileInteger values, default:
0
Trim types: whether trimming strips are cut (hard) or just reserved (soft)
columns
BOTTOM_TRIM_TYPE,TOP_TRIM_TYPE,LEFT_TRIM_TYPE,RIGHT_TRIM_TYPEin the bin CSV fileHard: the trim is physically cut; the strip is wasteSoft: the trim is reserved but not cut; default for top and right trims
The following example packs 3 items (4×8, 3×8 and 3×8) into 10×10 bins (bin-packing objective), side by side to exactly fill the bin width. Without any trim, all 3 items fit in a single bin. Reserving a 1-unit trim on all four edges (left, right, bottom and top) leaves only 8 of usable width, which is no longer enough for the three items to sit side by side, so a second bin is needed.
Without trim |
|
|---|---|
items.csv¶
WIDTH,HEIGHT,ORIENTED,COPIES
4,8,1,1
3,8,1,1
3,8,1,1
|
items.csv¶
WIDTH,HEIGHT,ORIENTED,COPIES
4,8,1,1
3,8,1,1
3,8,1,1
|
bins.csv¶
WIDTH,HEIGHT,COPIES
10,10,3
|
bins.csv¶
WIDTH,HEIGHT,LEFT_TRIM,RIGHT_TRIM,BOTTOM_TRIM,TOP_TRIM,COPIES
10,10,1,1,1,1,3
|
parameters.csv¶
NAME,VALUE
objective,bin-packing
|
parameters.csv¶
NAME,VALUE
objective,bin-packing
|
packingsolver_rectangleguillotine \
--items items.csv \
--bins bins.csv \
--parameters parameters.csv \
--certificate solution.csv
|
packingsolver_rectangleguillotine \
--items items.csv \
--bins bins.csv \
--parameters parameters.csv \
--certificate solution.csv
|
Defects¶
Defects are rectangular regions inside a bin where items cannot be placed.
Defects are specified in the defects CSV file; option: --defects defects.csv. The defect file contains the same columns as for the rectangle solver:
The bin type that contains the defect (mandatory)
column
BINIt refers to the bin type by its position (0-indexed) in the bins file
The X coordinate of the bottom-left corner of the defect (mandatory)
column
XInteger value
The Y coordinate of the bottom-left corner of the defect (mandatory)
column
YInteger value
The width of the defect (mandatory)
column
WIDTHInteger value
The height of the defect (mandatory)
column
HEIGHTInteger value
The following example packs 2 copies of a 10×6 item into 10×12 bins (bin-packing objective), stacked to fill each bin exactly with no waste. Without any defect, one bin is enough. Adding a small 2×2 defect in the middle of the join between the two items leaves no room to shift either item out of the way, since there is no slack left in the bin: one of the two items no longer fits, so a second bin is needed.
Without defects |
With defects |
|---|---|
items.csv¶
WIDTH,HEIGHT,ORIENTED,COPIES
10,6,1,2
|
items.csv¶
WIDTH,HEIGHT,ORIENTED,COPIES
10,6,1,2
|
bins.csv¶
WIDTH,HEIGHT,COPIES
10,12,3
|
bins.csv¶
WIDTH,HEIGHT,COPIES
10,12,1
10,12,2
|
defects.csv¶
BIN,X,Y,WIDTH,HEIGHT
0,4,4,2,2
|
|
parameters.csv¶
NAME,VALUE
objective,bin-packing
|
parameters.csv¶
NAME,VALUE
objective,bin-packing
|
packingsolver_rectangleguillotine \
--items items.csv \
--bins bins.csv \
--parameters parameters.csv \
--certificate solution.csv
|
packingsolver_rectangleguillotine \
--items items.csv \
--bins bins.csv \
--defects defects.csv \
--parameters parameters.csv \
--certificate solution.csv
|
Cut through defects¶
By default, a guillotine cut may not pass through a defect; it must be routed around it instead.
Whether cuts are allowed to pass through defects
name:
cut_through_defects0: cuts must avoid defects (default)1: cuts may pass through defects
The following example packs a 5×5 and a 5×6 item into 10×10 bins with only 2 cutting stages (bin-packing objective), so the two items — whose widths sum exactly to the bin width — must be separated by a single first-stage cut. A small 2×2 defect floats in the unused strip above the shorter item, without touching either item or the edges of the bin, but still straddling that cut. Allowing cuts through defects lets the solver cut straight through it, and both items fit into a single bin. Without allowing cuts through defects, that cut can no longer be made, so the two items can no longer share a bin, and a second bin is needed.
WIDTH,HEIGHT,ORIENTED,COPIES
5,5,1,1
5,6,1,1
WIDTH,HEIGHT,COPIES
10,10,1
10,10,2
BIN,X,Y,WIDTH,HEIGHT
0,4,7,2,2
With cuts through defects |
Without cuts through defects |
|---|---|
parameters.csv¶
NAME,VALUE
objective,bin-packing
number_of_stages,2
cut_through_defects,1
|
parameters.csv¶
NAME,VALUE
objective,bin-packing
number_of_stages,2
|
packingsolver_rectangleguillotine \
--items items.csv \
--bins bins.csv \
--defects defects.csv \
--parameters parameters.csv \
--certificate solution.csv
|
packingsolver_rectangleguillotine \
--items items.csv \
--bins bins.csv \
--defects defects.csv \
--parameters parameters.csv \
--certificate solution.csv
|
Cutting sequences (stacks)¶
Items with the same stack id must be produced contiguously, in the order they appear in the item file: all copies of an item type must be cut before moving on to the next item type of the same stack. This models a physical stack of items (e.g. glued or stapled together) that must be separated in a fixed sequence. By default, each item type forms its own single-item stack, so no ordering constraint applies.
The stack identifier; items with the same stack id must remain contiguous in the solution
column
STACK_IDdefault value: no stack grouping
The following example packs 4 items of width 5 into 10×10 bins (bin-packing objective): two items of height 6 and 4 that together fill one 5×10 column, and two items of height 3 and 7 that together fill another 5×10 column. Without stacking constraints, the solver is free to group the items by column and packs everything into a single bin. Splitting the items into two stacks of two — stack 0 with the height-6 and height-7 items, stack 1 with the height-3 and height-4 items — pairs one item from each column in every stack, forcing each stack’s two items to be produced back-to-back; since neither column can be completed without interrupting the other stack, a second bin is needed.
Without stacks |
With stacks |
|---|---|
items.csv¶
WIDTH,HEIGHT,ORIENTED,COPIES
5,6,1,1
5,7,1,1
5,3,1,1
5,4,1,1
|
items.csv¶
WIDTH,HEIGHT,ORIENTED,STACK_ID,COPIES
5,6,1,0,1
5,7,1,0,1
5,3,1,1,1
5,4,1,1,1
|
bins.csv¶
WIDTH,HEIGHT,COPIES
10,10,4
|
bins.csv¶
WIDTH,HEIGHT,COPIES
10,10,4
|
parameters.csv¶
NAME,VALUE
objective,bin-packing
|
parameters.csv¶
NAME,VALUE
objective,bin-packing
|
packingsolver_rectangleguillotine \
--items items.csv \
--bins bins.csv \
--parameters parameters.csv \
--certificate solution.csv
|
packingsolver_rectangleguillotine \
--items items.csv \
--bins bins.csv \
--parameters parameters.csv \
--certificate solution.csv
|
Minimum and maximum distances between cuts¶
The minimum distance between first-level (stage-1) cuts; name:
minimum_distance_1_cuts; default value:0The maximum distance between first-level cuts; name:
maximum_distance_1_cuts;-1for no limitThe minimum distance between second-level cuts; name:
minimum_distance_2_cuts; default value:0The maximum distance between second-level cuts; name:
maximum_distance_2_cuts;-1for no limit (default); not allowed whennumber_of_stages == 2The minimum length for any waste piece; name:
minimum_waste_length; default value:0
Maximum number of consecutive 1-cuts¶
The maximum number of 1-cuts in a bin; name:
maximum_number_1_cuts;-1for no limit (default); must not be0
The following example packs 3 copies of a 3×10 item into 10×10 bins with only 2 cutting stages (bin-packing objective). Without a limit, the 3 items are placed side by side using 2 stage-1 cuts, all in a single bin. Setting maximum_number_1_cuts to 1 allows only 2 strips, so only 2 of the 3 items fit, and a second bin is needed for the third.
Without limit |
|
|---|---|
items.csv¶
WIDTH,HEIGHT,ORIENTED,COPIES
3,10,1,3
|
items.csv¶
WIDTH,HEIGHT,ORIENTED,COPIES
3,10,1,3
|
bins.csv¶
WIDTH,HEIGHT,COPIES
10,10,3
|
bins.csv¶
WIDTH,HEIGHT,COPIES
10,10,3
|
parameters.csv¶
NAME,VALUE
objective,bin-packing
number_of_stages,2
|
parameters.csv¶
NAME,VALUE
objective,bin-packing
number_of_stages,2
maximum_number_1_cuts,1
|
packingsolver_rectangleguillotine \
--items items.csv \
--bins bins.csv \
--parameters parameters.csv \
--certificate solution.csv
|
packingsolver_rectangleguillotine \
--items items.csv \
--bins bins.csv \
--parameters parameters.csv \
--certificate solution.csv
|
Maximum number of consecutive 2-cuts¶
The maximum number of 2-cuts in a first-level sub-plate; name:
maximum_number_2_cuts;-1for no limit
The following example packs 4 items (10×3, 10×3, 10×4 and 10×10) into 20×10 bins with only 2 cutting stages (bin-packing objective). A first stage-1 cut splits the bin into two 10-wide strips: one holds the 10×10 item alone, the other stacks the three shorter items using 2 stage-2 cuts. Without a limit, all 4 items fit into a single bin. Setting maximum_number_2_cuts to 1 allows only 2 stage-2 cuts’ worth of shelves per strip, so only 2 of the 3 stacked items fit, and a second bin is needed for the third.
Without limit |
|
|---|---|
items.csv¶
WIDTH,HEIGHT,ORIENTED,COPIES
10,3,1,1
10,3,1,1
10,4,1,1
10,10,1,1
|
items.csv¶
WIDTH,HEIGHT,ORIENTED,COPIES
10,3,1,1
10,3,1,1
10,4,1,1
10,10,1,1
|
bins.csv¶
WIDTH,HEIGHT,COPIES
20,10,3
|
bins.csv¶
WIDTH,HEIGHT,COPIES
20,10,3
|
parameters.csv¶
NAME,VALUE
objective,bin-packing
first_stage_orientation,vertical
|
parameters.csv¶
NAME,VALUE
objective,bin-packing
first_stage_orientation,vertical
maximum_number_2_cuts,1
|
packingsolver_rectangleguillotine \
--items items.csv \
--bins bins.csv \
--parameters parameters.csv \
--certificate solution.csv
|
packingsolver_rectangleguillotine \
--items items.csv \
--bins bins.csv \
--parameters parameters.csv \
--certificate solution.csv
|


























