Optimized Packing Clusters of Objects in a Rectangular Container

,


Introduction
A two-dimensional packing problem of objects in a container is NP-hard [1]. This problem is typical in logistics (transporting rolls of wallpaper, pipes, boxes, paint buckets, etc.,) and also has important applications in computer science, industrial engineering, manufacturing and production processes, healthcare, project portfolio selection, nanophysics, and agriculture (see, e.g., [2] and the references therein).
In many cases the objects are not independent and have to be grouped in a number of certain clusters of nonoverlapping objects. This is typical, for example, for a container loading problem [22], where the objects in a large maritime container may form various clusters according to a type of objects (similar shapes, parts of the same machine). Similarly, clusters can be formed according to a supplier or a client (final destination) to facilitate loading/unloading the container.
While the composition of the cluster (number of objects and their shapes) is typically predefined, the overall shape of the cluster is frequently not specified. Bearing in mind a cluster as a number of objects placed in a flexible sack we define the shape of a cluster as a convex hull of the objects in the cluster. Note that the objects are nonoverlapping and the shape of the cluster (convex hull) depends on the layout of the objects in the cluster.
Throughout this paper it is assumed homogeneous clusters composed of the same shapes (different sizes are allowed). The number of clusters as well as the number of objects and their shapes and sizes is given. The shape of the cluster is represented by the convex hull of the objects in the cluster. A feasible clusters layout has to meet the following conditions: (a) objects in the cluster are mutually nonoverlapping and (b) clusters are mutually nonoverlapping and nonoverlapping with the complement of the rectangular container.
Concerning optimized packing of clusters, different objectives can be used. For example, we may look for the "densest" layout fixing one dimension of the rectangular container and minimizing the other subject to feasibility of the clusters layout. On the contrary, we may fix both dimensions of the container and look for a "sparsest" layout maximizing a certain "distance" between the clusters. This objective is motivated by the need of more space between clusters to facilitate access for their loading/unloading. In this paper the latter approach is used.
To the best of our knowledge the problem of optimized packing for clusters of objects was never considered before. The main contributions of the paper are (1) new formulation of the layout problem for clusters of objects; (2) new mathematical modeling tools for representing nonoverlapping and containment of clusters; (3) novel NLP model for optimized packing of clusters; and (4) new algorithm to get initial feasible solution to accelerate a local optimization procedure.
The paper is organized as follows. In Section 2 a layout problem for clusters of objects is formulated. Section 3 provides nonoverlapping and containment conditions for clusters obtained by phi-function technique. Mathematical model for the optimized layout problem is stated in Section 4. Solution algorithm and numerical experiments are presented in Sections 5 and 6, respectively. Conclusions in Section 7 complete this paper.

Problem Formulation
Let Ω = {( , ) ∈ 2 : 0 ≤ ≤ , 0 ≤ ≤ } be a rectangular domain (a container) and , ∈ {1, 2, . . . , } = , be an ordered collection of convex objects. Each object is defined by its metrical characteristics. In particular, an ellipse is defined by its semiaxes and , a circle is defined by its radius , and a convex polygon is defined by its vertices = ( , ), = 1, . . . , . The position of the object is characterized by the vector of variable placement parameters = (V , ), where V = ( , ) is a translation vector and is a rotation angle. The center of the object coincides with the origin of its local coordinate system. Rotated by an angle and translated by a vector V an object is defined as ( ) = { ∈ 2 : = V + ( )⋅ 0 , ∀ 0 ∈ 0 }, where 0 denotes nontranslated and nonrotated object and ( ) = ( cos sin − sin cos ) is a standard rotation matrix.
Cluster Layout Problem CLP. Arrange the collection of clusters Λ ( ), ∈ , sufficiently distant one from another into a rectangular container Ω, such that The first constraint assures nonoverlapping of objects within the same cluster and the second guarantees nonoverlapping of clusters, while the third relation presents containment conditions for clusters into Ω.

Tools of Mathematical Modeling
In this study, we use phi-function technique as a constructive tool for mathematical modeling of placement constraints within the field of Packing&Cutting (see, e.g., [3,[23][24][25]). For the reader's convenience we provide definitions of a phi-function (normalized phi-function) and a quasi-phifunction (normalized quasi-phi-function) in the appendix. In this section we introduce new tools to describe placement constraints (2) and (3) analytically.
. . Nonoverlapping of Objects within a Cluster. To describe relation (1) we use phi-functions and quasi-phi-functions for a pair of different shapes of convex objects.
From the main property of a quasi-phi-function [3] it follows that if Φ ( , , ) ≥ 0 for some , then int ( ) ∩ int ( ) = ⌀, where is a vector of extra variables.
In particular, we provide nonoverlapping tools for a pair of ellipses, circles, and convex polygons.
A quasi-phi-function for ( ) and ( ) can be defined as where (V , ) = cos − sin , ∈ 1 is an auxiliary variable (an angle between a straight line passing through the origin of the global coordinate system and axis ).

Phi-Function for Two
where = ( , ) ∈ 2 is a vector of auxiliary variables, is a phi-function for ( ) and ( ) and is a phi-function for ( ) and * ( ) = 2 \ int ( ).
. . Nonoverlapping of Clusters. Let us describe analytically the placement constraint (2). To this aim we introduce a quasi-phi-function for two objects Λ ( ) and Λ ( ). Now we consider an extension of the phi-function technique to convex hulls of clusters of objects. Note that convex hull of objects in a cluster has variable shape and variable metrical characteristics that depend on variable placement parameters of objects in the cluster. Let = {( , ) : ( , ) = cos ⋅ + sin ⋅ + ≥ 0} be a half plane with variable placement parameters ( , ).

Proposition 2. A continuous and everywhere defined function
Proof. Based on the properties of a quasi-phi-function [3] defined for two convex objects we can conclude that Next we define a phi-function of Λ ( ) and a half plane in (10) in the form where Φ ( , , ) is a phi-function of an object ( ) and half plane , ∈ Ξ . It follows from the properties of the convex hull of Λ ( ) = ⋃ ∈Ξ ( ) and characteristics of a separating line between two convex objects that and therefore int ( ) ∩ int = ⌀, for all ∈ Ξ , and there exists at least one object ( ), such that ( ) ∩ ̸ = ⌀, ∈ Ξ . It implies that min{Φ ( , , ), ∈ Ξ } = 0.
Thus, the function Φ Λ ( , , ) defined in (11) is a phi-function for Λ and a half plane .

Mathematical Problems in Engineering
Similarly a phi-function of Λ ( ) and a half plane * = 2 \ int takes the form where Φ * ( , , ) is a phi-function of object ( ), ∈ Ξ , and the half plane * .
It should be noted that a quasi-phi-function is a normalized quasi-phi-function for Λ ( ) and Λ ( ) (see the appendix for more details). It means that if > 0 is the distance between Λ ( ) and Λ ( ), defined in the standard way as a minimum Euclidean pointwise distance, Remark . We do not construct convex hulls of clusters to describe nonoverlapping (2) in our problem.

Phi-Function for an Ellipse and Half Plane .
A phi-function for an ellipse ( ) given by its semiaxes ( , ) and half plane can be defined in the form: Phi-Function for a Circle and Half Plane . The phi-function for a circle (V ) given by its radius and half plane is defined in [24] and has the form Phi-Function for a Convex Polygon and Half Plane . The phi-function for a convex polygon ( ) given by its vertices = ( , ), = 1, . . . , , and half plane is defined in [24] and has the form: . . Containment of Clusters into a Container. Let us derive a phi-function representing analytically the containment Let Φ Ω * ( ) be a phi-function of objects ( ) and Ω * , ∈ Ξ .

Proposition 4. A continuous and everywhere defined function
is a phi-function of Λ ( ) and the object Ω * .

Phi-Function for an Ellipse Containment.
A phi-function for an ellipse ( ) given by its semiaxes ( , ) and the object Ω * can be defined in the form The inequality Φ Ω * ( ) ≥ 0 guarantees that ( ) ⊂ Ω. We define the phi-function based on the idea of nonoverlapping of an ellipse and half plane introduced in [5].
Phi-Function for a Circle Containment. A phi-function for a circle ( ) given by its radius and the object Ω * has the form The inequality Φ Ω * ( ) ≥ 0 guarantees that (V ) ⊂ Ω.
Remark . In the case of two circles ( ) and ( ) we use a phi-function Φ ( , ) instead of a quasi-phi-function Φ ( , , ). The feasible region given by (22) is defined by a system of inequalities with differentiable functions. Our models (21)-(22) are a nonconvex and continuous nonlinear programming problem. This is an exact formulation in the sense that it gives all optimal solutions to the layout problem.

Solution Algorithm
Our solution strategy is based on the multistart algorithm and consists of three major stages: (1) generate a set of feasible starting points for the problems (21) To generate feasible starting points of the problems (21)-(22) we develop a special algorithm CSPA (Cluster Starting Points Algorithm) that involves the following Steps.
Step . With each cluster Λ ( ) we associate a circular region with variable center point V = ( , ) and variable radius , where is a scaling parameter and = √∑ ∈Ξ , is the area of object , ∈ Ξ , ∈ .
Step . Then we grow up all circular regions , ∈ , within a rectangular container Ω as much as possible, solving the following NLP subproblem: where V = (V 1 , V 2 , . . . , V ) is a vector of variable placement parameters of circular areas , ∈ ; 6 Mathematical Problems in Engineering Φ (V , V , ) is a phi-function of circular areas and with center points V = ( , ) and V = ( , ) and appropriate radii and , > ∈ , Φ Ω * (V , ) is a phi-function of a circular area and the object Ω * = 2 \ int Ω, ∈ , We search for a local maximum of problems (23)-(24) starting from a feasible point are randomly generated points. Denote a local maximum point of problems (23)-(24) by (V * , * ).
Step . Next we derive starting values of variables 0 , 0 (obtained by trivial geometrical calculations); for each quasiphi-function Φ Λ Λ ( , , , ), > ∈ in the problems (21)- (22). These variables are considered as parameters of separating lines between each pair of circular areas * and * of radii * and * with center points V * and V * , > ∈ .

Computational Results
Here we present a number of examples to demonstrate the efficiency of our methodology. We have run all experiments on an AMD FX(tm)-6100, 3.30 GHz computer, Programming Language C++, Windows 7. For the local optimisation we use the IPOPT code https://projects.coin-or.org/Ipopt), developed in [27]. Default options were used for running this software.
Corresponding optimized layout is presented in Figure 1.
Corresponding optimized layout is presented in Figure 2.
Corresponding optimized layout is presented in Figure 3.
Example . An ordered collection of = 36 objects is given.   Corresponding optimized layout is presented in Figure 5.

Conclusions
We consider a new packing (layout) problem for a number of clusters of convex objects. This research is motivated by a container-loading problem; however, we think that similar problems arise naturally in many other packing/cutting/clustering issues. The layout is considered for a rectangular container of a given size subject to nonoverlapping of (continuously translated and rotated) objects within a cluster. The objects are specified by their sizes and have the same shape for the appropriate cluster. Each cluster is represented by the convex hull of objects that form this cluster. It is assumed that two clusters do not overlap each other if so are their convex hulls and a cluster belongs to a rectangular container if the corresponding convex hull does. New tools of mathematical modeling of nonoverlapping and containment for clusters are provided. An extension of the phi-function technique to the cluster convex hulls is presented taking into account variability of their shapes and metrical characteristics. New quasi-phi-functions and phifunctions are introduced. These functions avoid constructing convex hull for each cluster. A novel mathematical model for optimized layout of clusters is considered and stated as a nonlinear continuous problem. A novel algorithm for searching for initial feasible solutions to accelerate a local optimization procedure is developed. Computational results are provided to demonstrate the efficiency of our approach. The computational results are presented for new instances of the layout problem for clusters involving ellipses, circles, and convex polygons.
Definition [see [ ]]. A continuous and everywhere defined function Φ ( , , ) is called a quasi-phi-function for two objects ( ) and ( ) if max Φ ( , , ) is a phifunction for the objects.
Here is a vector of auxiliary continuous variables that belongs to Euclidean space.
Based on features of a quasi-phi-function the nonoverlapping constraint can be described in the form: if Φ ( , , ) ≥ 0 for some , then int ( )∩int ( ) = ⌀.

Data Availability
The data [input data for each example: the number of clusters, sizes, and numbers of objects that form each cluster; output data for each example: the value of objective function, computational time, and placement parameters of objects] used to support the findings of this study are included within the article.