New Improvements in Optimal Rectangle Packing

Eric Huang, Richard E. KorfIJCAI 2009

Abstract

This paper presents a highly efficient algorithm for the Optimal Rectangle Packing problem, achieving a 19x speedup over previous state-of-the-art solvers. By decomposing the problem into independent x and y-coordinate assignments and transforming sparse packing into a "perfect packing" problem, the authors extended the known solutions for the consecutive-square benchmark from $N=27$ to $N=32$.

Introduction

Rectangle packing is a classic NP-hard optimization problem with significant applications in VLSI design, pallet loading, and manufacturing. The goal is to find the smallest possible bounding box that can contain a specific set of non-overlapping rectangles. A standard rigorous test for these algorithms is the consecutive-square packing benchmark, which involves packing squares of sizes $1 \times 1, 2 \times 2, \dots, N \times N$ into a minimum-area box. As $N$ increases, the search space explodes, challenging even the most advanced combinatorial solvers.

Methodology

The proposed solver utilizes a multi-stage backtracking approach that decouples the search for x and y coordinates, allowing for specialized pruning and inference at each stage.

X-Coordinate Assignment and Pruning

The solver first determines valid x-positions for all rectangles. It employs a dynamic variable ordering heuristic based on area, placing larger, more constraining rectangles first. To discard infeasible solutions quickly, the algorithm uses 1D wasted-space pruning and inference rules based on "compulsory parts."

Illustration of coordinate assignment and compulsory parts used for pruning.

As shown in Figure 5, the solver identifies regions a rectangle must occupy given its current domain to detect overlaps early in the search process. The authors discovered that this x-coordinate assignment is the primary computational bottleneck; once a valid x-layout is found, the remaining search is significantly faster.

Perfect Packing Transformation

Once x-coordinates are fixed, the problem is transformed into a "perfect packing" instance. The authors fill all remaining empty space with dummy $1 \times 1$ rectangles. While this increases the object count, it allows the solver to use perfect packing logic, where every rectangle edge must touch another edge or the boundary. This eliminates the need to search for "gaps" and enables much stronger pruning rules.

Y-Coordinate Search: The Empty Corners Model

For the final y-coordinate search, the solver adopts a space-centric view. Instead of asking where to place a rectangle, it identifies empty corners and determines which rectangle fits. This Empty Corners Model significantly reduces the branching factor by treating corners as variables and rectangles as values.

Key Results

The algorithm demonstrates remarkable performance gains. On the $N=27$ benchmark, it reduced the solution time from over 11 hours to just 35 minutes, representing a 19x speedup over the previous state-of-the-art.

The optimal packing for the $N=32$ consecutive-square benchmark.

More importantly, the solver established new records for the benchmark. As shown in Figure 1, the optimal packing for $N=32$ (32 squares in an $85 \times 135$ box) was found in approximately 33 hours, solving a problem that was previously computationally out of reach.

Conclusion

By prioritizing x-coordinate assignment and leveraging the constraints of perfect packing, this research significantly advances the state-of-the-art in rectangle packing. The dual formulation—viewing the problem through both pieces and available space—offers a powerful template for other complex layout and scheduling challenges. Future work will focus on extending these techniques to continuous dimensions and further optimizing search symmetry handling.

Summary updated

BibTeX
@inproceedings{huang2009new,
  author = {Eric Huang and Richard E. Korf},
  title = {{New Improvements in Optimal Rectangle Packing}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2009},
}
Figure