Abstract
This paper introduces a generic numerical algorithm for packing 2D objects of arbitrary shape, including curved and non-convex geometries like ellipses and horseshoes. By replacing manual overlap formulas with a pre-calculated "paving" of the overlapping region, the authors enable a stochastic optimizer to pack complex geometries without requiring custom mathematical derivations for every new shape combination. This approach overcomes the "ad-hoc bottleneck" that has historically limited packing algorithms to simple primitives.
Introduction
Packing problems—determining the most efficient arrangement of items within a container without overlap—are fundamental to logistics, manufacturing, and design. While solutions for simple shapes like boxes or circles are well-established, real-world objects often possess complex, curved, or non-convex geometries. Historically, the state-of-the-art approach relied on "overlapping functions" to measure intersections. However, these functions typically required hand-written formulas for every possible pair of shapes, creating a significant barrier to scalability. This research proposes a two-stage framework to automate this process by treating shape overlap as a geometric distance problem rather than a symbolic one.
Methodology
The proposed method shifts the focus from symbolic calculation to a numerical, "black-box" approach that can handle any shape defined by nonlinear inequalities.
Shape Representation and the Overlapping Region
Objects are defined using nonlinear inequalities (e.g., $x^2 + y^2 \leq r^2$ for a circle). This flexibility allows for the creation of complex shapes, such as "horseshoes," through logical combinations of these inequalities. The core of the algorithm is the definition of the overlapping region ($S_{ij}$): the set of all relative positions and rotations where two objects $i$ and $j$ would intersect.
Offline Paving and Online Optimization
Before the packing process begins, the algorithm performs an offline paving of $S_{ij}$. Using interval analysis, it partitions the configuration space into boxes labeled as "Inside" (overlap), "Outside" (no overlap), or "Boundary." This creates a numerical map of illegal configurations.
A key technical contribution is an improved "inflator" algorithm that decouples translation and rotation, significantly accelerating the process for 3D parameter spaces (2D position + 1D orientation). During the online packing phase, a black-box optimizer (CMA-ES) minimizes a global violation cost. It utilizes the pre-calculated paving to quickly determine the "penetration depth"—the distance an object must move to resolve an overlap—providing a smooth gradient for the optimizer to follow.
Benchmarks and Results
The authors evaluated the method using five synthetic benchmark cases of increasing complexity, ranging from standard circle packing to mixed sets of ellipses and non-convex horseshoes with full rotation.
The algorithm successfully packed these complex shapes, tasks that would typically require extensive manual derivation. Circle packing was solved in seconds, while the most complex cases involving rotation and non-convexity took several minutes. A notable innovation involved treating the container itself as an object by defining its shape as its own complement, allowing the "stay inside" constraint to be handled identically to the "no overlap" constraint.
Discussion and Limitations
While the online packing phase is efficient, the offline computation time remains a primary limitation. Paving the overlapping region for complex shapes in three dimensions can take several hours. Additionally, the precision of the paving ($\epsilon$) introduces a trade-off: larger $\epsilon$ values speed up the offline step but result in "enlarged" objects, preventing the system from reaching a theoretically perfect optimal packing. Future work may involve hybrid approaches where numerical algorithms approximate overlapping functions for even greater efficiency, alongside more adaptive paving strategies to improve precision.
Summary updated