π§© Constraint Solving POTD:Strip Packing β Fitting Rectangles Without Overlap #25806
Closed
Replies: 1 comment
-
|
This discussion has been marked as outdated by Constraint Solving β Problem of the Day. A newer discussion is available at Discussion #26027. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Category: Packing & Cutting Β· April 11, 2026
Problem Statement
Given a strip of fixed width
Wand unlimited height, and a set ofnrectangular items each with widthw_iand heighth_i, pack all items into the strip without overlap while minimising the total height used.Items may not be rotated (in the basic version), and every item must lie fully within the strip boundaries.
Small Concrete Instance
Strip width
W = 10. Five items:A feasible packing uses height 9; can you find a packing with height β€ 8?
Decision variables:
x_i(horizontal position, left edge),y_i(vertical position, bottom edge).Objective: minimise
H = max_i(y_i + h_i).Constraint: no two items may overlap.
Why It Matters
Modeling Approaches
Approach 1 β Constraint Programming with
diffnCP is a natural fit: the non-overlap requirement maps directly onto a global geometric constraint.
Variables:
Trade-offs: LP relaxations yield useful dual bounds, and branch-and-bound is mature. However, the big-M coefficients weaken LP relaxations;
O(n2)binary variables scale poorly for large instances.Example Model β MiniZinc (CP approach)
Key Techniques
1 β Energy-Based Lower Bounds
The area lower bound
H_lb = β(Ξ£ w_i Β· h_i) / Wβis fast and tight in practice. Stronger slice bounds sum item heights within horizontal slices; these can be computed once and used to pruneHaggressively before search begins.2 β Sweep-Line Propagation inside
diffnThe
diffnglobal constraint uses a sweep-line algorithm (Beldiceanu & Contejean, 1994) that detects infeasibility and prunes domains inO(n log n)per propagation call. It reasons about energy: if the total area of items whose x-ranges overlap a column segment exceedsW Γ segment_height, the packing is infeasible.3 β Symmetry Breaking
Two standard symmetries inflate the search space:
(x_i, y_i)is optimal, so is(W - x_i - w_i, y_i). Break by fixingx[largest_item] β€ W/2.iandjhave the same dimensions, enforce a lexicographic ordering(x_i, y_i) β€_lex (x_j, y_j).y.A first-fit decreasing height (FFDH) heuristic provides a good upper bound and a warm start for both MIP and CP solvers.
Challenge Corner
References
Lodi, A., Martello, S., & Monaci, M. (2002). Two-dimensional packing problems: A survey. European Journal of Operational Research, 141(2), 241β252. β Comprehensive survey covering strip packing, bin packing, and cutting stock variants.
Beldiceanu, N., & Contejean, E. (1994). Introducing global constraints in CHIP. Mathematical and Computer Modelling, 20(12), 97β123. β Original paper introducing
diffnand sweep-line propagation.Clautiaux, F., Jouglet, A., Carlier, J., & Moukrim, A. (2008). A new constraint programming approach for the orthogonal packing problem. Computers & Operations Research. β CP-specific techniques including energetic reasoning and forbidden patterns.
MiniZinc Handbook β
diffnglobal constraint. [minizinc.org/doc]((www.minizinc.org/redacted) β Practical reference for usingdiffnwith optional items and thediffn_kgeneralisation to k dimensions.Beta Was this translation helpful? Give feedback.
All reactions