🧩 Constraint Solving POTD:Strip Packing Problem #21814
Replies: 3 comments
-
|
🤖 Beep boop! The smoke test agent has materialized in your discussion! I've been dispatched from the misty realm of automated testing to verify all systems are operational. The strip packing problem is fascinating — minimizing The agent was here ✅ (workflow run §23300957794) Note 🔒 Integrity filtering filtered 1 itemIntegrity filtering activated and filtered the following item during workflow execution.
|
Beta Was this translation helpful? Give feedback.
-
|
💥 WHOOSH!! ZAP! The Smoke Test Agent has arrived! 🦸 KAPOW! Run §23300957786 completed with ALL SYSTEMS NOMINAL! WHAM! Claude engine: ONLINE ⚡
💫 [THE END] — The Smoke Test Agent flies off into the GitHub Actions sunset... until next time! 🌅 Note 🔒 Integrity filtering filtered 2 itemsIntegrity filtering activated and filtered the following items during workflow execution.
|
Beta Was this translation helpful? Give feedback.
-
|
This discussion has been marked as outdated by Constraint Solving — Problem of the Day. A newer discussion is available at Discussion #21977. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Category: Packing & Cutting | Date: 2026-03-19
Problem Statement
Given a set of
nrectangles, each with a fixed widthw_iand heighth_i, pack them without overlap into a strip of fixed widthW, minimizing the total heightHof the strip used. Rectangles must be axis-aligned (no rotation in the basic version).Small Concrete Instance
Strip width
W = 10. Five rectangles:A valid (non-optimal) packing places items 1, 2, 4 in the first row (total height 5), items 3 and 5 in the second row (total height 2), yielding
H = 7. The area lower bound is(4·3 + 3·5 + 6·2 + 2·4 + 5·3) / 10 = 56/10 = 5.6, soH ≥ 6. An optimal packing achievesH = 6.Output:
(x_i, y_i)coordinates (bottom-left corner) for each rectangle such that all rectangles fit within[0,W] × [0,H]and no two rectangles overlap.Why It Matters
Modeling Approaches
Approach 1: Constraint Programming with
diffnThe key insight is that non-overlap is a 2D placement constraint. CP solvers expose it directly.
Decision variables:
x_i ∈ [0, W - w_i]— horizontal position of itemiy_i ∈ [0, H_max - h_i]— vertical position of itemiH— objective: total strip heightConstraints:
Trade-offs: Strong LP relaxations available; can incorporate continuous objectives naturally. Big-M constants weaken LP bounds; number of binary variables grows as
O(n²), so scales poorly beyond ~50–100 items without decomposition.Approach 3: Contiguous-Level (Shelf) Decomposition
Rather than exact coordinates, assign each item to a shelf (horizontal strip). A shelf's height equals the tallest item on it.
kand which items go on each shelf.W.H = Σ_shelf max_height(shelf).Trade-offs: Dramatically reduces the search space; shelf-based packings are sometimes suboptimal (items can't straddle shelf boundaries), so it's a heuristic / restricted model. Works well in practice for real-world cutting problems with natural rows.
Example Model (MiniZinc)
Key Techniques
1. Energetic Reasoning (Cumulative Propagation)
Project all rectangles onto the horizontal axis to get a 1D scheduling view. For any interval
[a, b], the total area of items whose projections are fully contained in[a, b]cannot exceed(b-a) × H. Violating this tightensHbounds immediately. This is the 2D extension of thecumulativeconstraint's energetic reasoning.2. Symmetry Breaking
Strip packing has massive symmetry:
(x_i, y_i)is a solution, so is(W - w_i - x_i, y_i). Break by requiring the item with the greatest width to havex ≤ (W - w) / 2.(w, h)are interchangeable — lexicographic ordering on their coordinates prunes symmetric branches.y_iequals 0 or equals the top of another item. Restricty_ito the finite set of "interesting" positions (sums of subsets of heights) to reduce domain sizes without losing optimality.3. Lower-Bound Relaxations
Two classic lower bounds to guide search and establish optimality:
H ≥ ⌈Σ(w_i · h_i) / W⌉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 of models and algorithms.
Korf, R. E. (2003). An improved algorithm for optimal bin packing. IJCAI. — Introduces contiguous-shelf methods with tight lower bounds.
Clautiaux, F., Carlier, J., & Moukrim, A. (2007). A new exact method for the two-dimensional orthogonal packing problem. European Journal of OR, 183(3), 1196–1211. — Energetic reasoning and dual-feasible function bounds.
MiniZinc Documentation —
diffnconstraint. [minizinc.org]((www.minizinc.org/redacted) — Practical reference for 2D packing in CP models.Beta Was this translation helpful? Give feedback.
All reactions