Balanced Circular Packing Problems with Distance Constraints

: The packing of different circles in a circular container under balancing and distance conditions is considered. Two problems are studied: the ﬁrst minimizes the container’s radius, while the second maximizes the minimal distance between circles, as well as between circles and the boundary of the container. Mathematical models and solution strategies are provided and illustrated with computational results. methodology, T.R., O.P., I.L. and J.A.M.-S.; software, O.P. and O.L.; validation, I.L. and J.A.M.-S.; formal analysis, T.R.; investigation, P.S. and P.V.; resources, T.R.; data curation, O.P. and O.L.; writing—original draft preparation, T.R.; writing— review and editing, J.A.M.-S. and I.L.; visualization, O.P.; supervision, T.R.; project administration, T.R. and


Introduction
The circular packing problem (CPP) consists of placing several circles in a larger object called a container. The circles must be arranged without mutual overlapping (the non-overlapping condition) and completely inside the container (the containment condition). CPPs (including CPPs in non-Euclidean geometry) form a broad category at the boundary between computational geometry and combinatorics [1][2][3]. The optimized CPP aims to find "the best" layout, e.g., maximizing the space utilization of the container or minimizing the size of the container. Optimized CPPs have multiple applications in logistics and production planning, biology and medicine, chemistry and additive manufacturing [4][5][6].
Additional constraints motivated by applications can be introduced. For example, in a satellite module layout design, equilibrium/balance constraints are imposed to assure the proximity of the gravity center of the container to the corresponding center of the circles [19][20][21][22][23]. In many applications, CPPs are formulated for circles defined in non-Euclidean norms [17,24,25]. Nesting, i.e., the stacking of circular disks one over another, can also be considered [26][27][28][29][30].
Solution approaches to CPPs can be roughly divided into four large classes [4,6,31]. The techniques of the first group are based on nonlinear programming formulations of the CPP, and these approaches apply different exact or approximation methods for this class of optimization problems [5,11,12,15,20,21]. The second class of approaches is based on tessellating or approximating the container with a finite grid [24,26,[32][33][34]. Then, the CPP is approximately reduced to a large-scale discrete programming problem in order to assign the centers of the circles to grid nodes. Using metaheuristic techniques for CPPs forms the third class of approaches [35,36]. The last group is represented by hybrid approaches combining the algorithmic ideas of the previous groups [7,8,10,13,14,19,28,31]. A collection of benchmark problem instances and corresponding best-known solutions is presented on E. Specht's website [37], specifically for the problem of packing circles into various containers.
The objective in most optimized packing problems is to find the densest possible packing arrangement, e.g., maximizing the occupation of the container or finding the minimal container for an open-dimension problem. However, in many up-to-date applications, the dense packing concept must be revised.
In sparse packing [38], the distance between the objects, as well as between the objects and the container, must be sufficiently large. In container-loading applications, these conditions arise to facilitate access to the objects during loading/unloading. Generating lightweight void structures by 3D printing requires sufficient distance between the voids to assure the mechanical strength of the part [39]. Sparse packing arises in thermal deburring, which is a state-of-the-art technology for cleaning 3D-printed parts of non-sintered powder particles [38]. The burrs are removed from 3D objects by exploding gas mixtures in a closed chamber. To achieve a reasonable processing quality and a "uniform" distribution of power and thermal effects, the parts must be placed at sufficient distances from one another.
In this work, the packing of different circles in a circular container under balancing and distance conditions is considered. Dense and sparse formulations are studied. The first problem aims to minimize the container's radius. In the second, the minimal distance between circles, and between the circles and the container's boundary, is maximized.

Dense Packing Circular Problem with Distance and Balancing Conditions
In this section, a circular packing problem is studied under balancing and distance conditions. The objective is to obtain the smallest possible circular container (dense packing).
Let S i , i = 1, 2, . . . , n be a family of circles with radii r i and weights w i . Let S be an external circle (container) centered at the origin and having radius r. By the definition, the center of gravity of the circle S is also located at the origin. Denote by (x i , y i ) the unknown center coordinates of S i , and let x = (x 1 , x 2 , . . . , x n ) and y = (y 1 , y 2 , . . . , y n ).
Let ρ ij > 0 be the minimum permitted distance between S i and S j , 1 ≤ i < j ≤ n. In addition, let ρ i > 0 be the minimum permitted distance between S i and the boundary of the object S * = R 2 \intS, i = 1, . . . , n. More specifically, let where dist(A, B) = min a∈A,b∈B dist(a, b) and dist(a, b) refer to the (Euclidean) distance between two points a and b.
A dense circular balanced packing (DCBP) problem can be stated as follows. Pack the circles S i , i = 1, 2, . . . , n in a minimum-radius circular container S subject to the distance constraints in (1), such that the gravitation center of the family of circles S i , i = 1, 2, . . . , n is located at the origin (i.e., coincides with the gravity center of S).
A trivial lower bound on the minimal radius of S is The DCBP is stated as a nonlinear optimization problem in R 2n+1 : r ≥ r low (6) where λ i = w i / ∑ n j=1 w j . The constraints in (3) guarantee that the distance between the pair of circles S i and S j is at least ρ ij , 1 ≤ i < j ≤ n, while the constraints in (4) assure that the distance between S i and the boundary of S is at least ρ i i = 1, 2, . . . , n. The linear constraints in (5) state that the gravity center of the family S i , i = 1, 2, . . . , n coincides with the origin, while the "dummy" constraint in (6) provides the lower bound for the objective value.

Sequential Algorithm for DCBPs
Using penalty functions, the problem in (1)-(5) can be transformed into the unconstrained minimization of a non-smooth function min r,x,y {f(r, x, y) = r + Φ P (r, x, y)} (7) where the penalty function Φ P (r, x, y) has the form Φ P (r, x, y) = P 1 F 1 (r, x, y) + P 2 F 2 (x, y) + P 3 max{0, −r + r low } Here P = {P 1 , P 2 , P 3 }, where the penalization coefficients P k , k = 1, 2, 3 are positive, and the functions F 1 (r, x, y) and F 2 (x, y) are as follows: The local minimization in (2)-(6) is equivalent to the local minimization in the unconstrained non-smooth problem in (7)-(10). If Φ P (r, x, y) = 0 in the local minimum of the function f(r, x, y) for certain values of the coefficients P = {P 1 , P 2 , P 3 }, then this point is also a local minimum for the problem in (2)- (6). The choice of the penalty coefficients P 1 , P 2 and P 3 allows the adjustment of the violation of the constraints in (3)-(6). The coefficient P 1 corresponds to the "total violation" of the quadratic constraints in (3)-(4), P 2 "controls" the linear constraints in (5), while P 3 adjusts the constraint in (6).
The sequential algorithm to obtain the best local solution to the problem in (2)-(6) uses the multistart method with randomly selected starting points and is based on a variant of Shor's r-algorithm (see, e.g., [40][41][42][43] and Appendix A) to locally minimize f(r, x, y). The feasible starting points for the problem in (2)-(6) are not necessary. This algorithm can also be used for the particular case of (2)- (6), where constraints on the center of gravity of the system of circles are eliminated. It is sufficient to set P 2 = 0; that it is equivalent to excluding the constraints in (4) from the problem in (2)- (6).
To present the sequential algorithm, denote by ntest the number of starting points uniformly distributed inside the circular container of radius r up (the best upper bound for the container's radius). At the beginning of the process, If the value of the local minimum decreases, then r up is sequentially updated for all starting points. To obtain the local minimum of f(r, x, y), the r-algorithm with an adaptive step-size and fixed space dilation [41] is used. The best local minimum of the function f(r, x, y), corresponding to the penalty Φ P (r, x, y) close to zero, is considered a solution to the problem in (2)- (6). This way, the best value r up of the radius is obtained, together with the coordinates (x up , y up ) of the circles.

Sequential Implementation of a Parallel Algorithm for DCBP
In a parallel algorithm, multiple searches for local solutions are implemented using the modification of the r-algorithm. This differs from a sequential approach that starts only one search. The parallel algorithm is implemented using the (k + 1)-processor "master-slave" technique. One processor is selected as the "main" (Master), while the others are "subordinate" (Slave).
In the Master processor, k starting points are randomly generated in a circle with a radius Then, these points are sent to the Slave processors. Each Slave processor starts the local minimization of the function f(r, x, y) from its starting point. When the r-algorithm terminates on any Slave processor, the results are transferred to the Master processor. As soon as the local minimum of the problem in (2)-(6) is obtained, the radius of the container must be compared with the best value r up . If the radius is smaller than r up , the value of r up is updated correspondingly, and the values (x up , y up ) of the coordinates of the centers of the circles are saved. Then, the Master processor selects a new starting point, which is passed to the Slave processor on which the r-algorithm just finished to begin the new search for the local minimum. The process stops either when all starting points have been investigated or the computational time limit has been exceeded. The parallel algorithm is implemented using the C++ programming language and the MPI parallel programming environment. The standard rand function is used to generate pseudo-random numbers. For local minimization, the module ralgb5 is used, corresponding to the Octave code [44] of the modification of the r-algorithm presented in [41]. The program is coded to work for a cluster in an MPI environment and on a Linux operating system. It can be executed on a single processor or on several processors in parallel.
Here, the cluster SKIT-4 of the V.M. Glushkov Institute of Cybernetics [45] is used. The speedup of the parallel algorithm for the DCBP problem is studied for an instance with 50 circles: 20 circles of radius 10, 15 circles of radius 20, 10 circles of radius 30 and 5 circles of radius 40. It is assumed that w i = r i , i = 1, 2, . . . , n. The multistart strategy is implemented with 5000 starting points, and the number of processors ranges from 1 to 32. The results are presented in Table 1. Here, k denotes the number of processors, t k is the problem solution time in seconds, C k is the parallel algorithm speedup and E k is the parallel algorithm efficiency. The parallel speedup is calculated by the formula C k = t 0 /t k , k = 1, 4, 8, 12, 16, 24, 32, where t 0 is the solution time for the serial algorithm with one processor, and t k is the solution time for the parallel algorithm with k processors. The effect of parallelization is estimated as E k = C k /k. It follows from Table 1 Figure 1 presents the solution time compared to the number of processors used, Figure 2 shows the speedup diagram and Figure 3 provides the efficiency diagram of the parallel algorithm for the problem instance. We may conclude that, once there are 16 processors in use, further increasing the number of processors does not result in a significant impact on the solution time. This is due to the rising cost of information exchange between parallel processors.    Figure 3 provides the efficiency diagram of the parallel algorithm for the problem instance. We may conclude that, once there are 16 processors in use, further increasing the number of processors does not result in a significant impact on the solution time. This is due to the rising cost of information exchange between parallel processors.   For a problem instance with 100 circles (40 circles with radius 10, 30 with radius 20, 20 with radius 30 and 10 with radius 40) the sequential algorithm results in = .
. For the same instance, the parallel algorithm with eight processors and 100,000 starting points gives an improved value = .
in 64,649 s (approximately 17 h 58 min). Sequential and parallel solutions are presented in Figures 4 and 5, respectively, while Tables 2 and 3 provide corresponding center coordinates. As can be seen from Figures 4 and 5, the layout for the circles differs significantly.

Solving DCBP Using IPOPT
Several instances of the DCBP problem were solved by the NLP solver IPOPT [46] available at https://projects.coin-or.org/Ipopt (accessed on 4 April 2022). A computer with an AMD Athlon 64 X2 5200+ was used for numerical experiments with the decomposition algorithm [31].
Three problem instances were considered, having the following circle distributions  Figure 6 shows arrangements of circles corresponding to the local minima of DCBP for cases (a), (b) and (c).

Solving DCBP Using IPOPT
Several instances of the DCBP problem were solved by the NLP solver IPOPT [46] available at https://projects.coin-or.org/Ipopt (accessed on 4 April 2022). A computer with an AMD Athlon 64 X2 5200+ was used for numerical experiments with the decomposition algorithm [31].
Three problem instances were considered, having the following circle distributions . It was assumed that w i = r i for i = 1, 2, . . . n. Figure 6 shows arrangements of circles corresponding to the local minima of DCBP for cases (a), (b) and (c).

Sparse Balanced Packing Problem with Balancing Conditions
In this section, a sparse circular packing problem is considered under balancing conditions. The objective is to place the circles in a fixed circular container maximizing the smallest distance between the circles, as well as the distance between the circles and the boundary of the container.
Denote the Euclidean distance between two circles by d ij for i > j = 1, 2, . . . , n and the distance between a circle and the boundary of the circular container by d i , i = 1, 2, . . . , n. Let d = min{d ij , i > j = 1, 2, . . . , n, d i , i = 1, 2, . . . , n} be the minimum among all these distances.
A sparse circular balanced packing (SCBP) problem is as follows. Pack the circles S i , i = 1, 2, . . . , n, into a fixed circular container S, maximizing d, subject to a limited deviation between the origin and the gravitation center of all circles S i , i = 1, 2, . . . , n. The maximal allowed deviation is denoted by ε.
The SCBP problem is stated as follows: The constraints in (12) and (13) assure that the corresponding distances are at least d. The constraint in (14) guarantees that the component-wise difference between the center of gravity and the origin (the center of the container) is at most ε.
The following technique is applied for the problem in (11)-(14): Stage 1. Generate several feasible starting points by homothetic transformations of the circles [21]. Stage 2. Obtain a local minimum for (11)- (14), starting from the points obtained at Stage 1 and using the optimization procedure proposed in [47]. The procedure substitutes solving the problem in (11)- (14) with O(n 2 ) nonlinear constraints by analyses of several optimization subproblems with O(n) constraints. Stage 3. Consider the best local solution from Stage 2 as a solution to the original problem in (11)- (14).
For computational experiments, a computer with an AMD Athlon 64 X2 5200+ was used. .4018, such that R a and R c coincide with corresponding radii obtained in Section 2 for the dense packing problem. The radius of container S was found as a solution to the dense packing problem considered in the previous section. Figure 7 shows arrangements of circles corresponding to the local minima of SCBP for cases (a), (b) and (c). sponding radii obtained in Section 2 for the dense packing problem. The radius of container S was found as a solution to the dense packing problem considered in the previous section. Figure 7 shows arrangements of circles corresponding to the local minima of SCBP for cases (a), (b) and (c).

Conclusions
Two circular packing problems are considered in this work: dense and sparse. In the first problem, the objective is to find the smallest possible circular container under distance and balancing conditions for the circular objects. In the second problem, the circular container is fixed, and the objective is to locate the circles as distant from one another as possible, as well as from the boundary of the container.
A mathematical model and sequential/parallel algorithms are presented for the dense packing problem. Parallel algorithms use computing technology with distributed memory (clusters). Solution algorithms apply the multistart strategy together with non-smooth minimization methods to search for the local minimum. The results of computational experiments for parallel algorithms on cluster SKIT-4 from the V.M. Glushkov Institute of Cybernetics of the National Academy of Sciences of Ukraine are presented. It is demonstrated that using the parallel approach can significantly reduce the solution time. The parallel solution allows finding good local minima for problem instances with several hundred circles in a reasonable time. The parallel solution also results in an improved value for the container's radius compared with the sequential technique.
The mathematical formulation for the sparse circular packing problem was presented. The corresponding nonlinear optimization problem was solved by the open-source local solver IPOPT [46], combined with the decomposition algorithm in [47] to cope with large dimensions. Numerical results are presented for the arrangement of circular containers obtained by dense packing. The corresponding solutions provide a visually more uniform distribution of the circles compared with dense packing. Obtaining a sparse layout is important in many practical applications, e.g., in thermal deburring [39], where it is used to ensure the uniformity of power and thermal effects in a deburring chamber (container).
Both formulations considered in this work result in large-scale optimization problems. To use the specific structure of the constraints, special-purpose decomposition/aggregation techniques [48,49] can be used to either relax the binding constraints or form an approximate aggregated problem of lower dimension.
An interesting direction for future research is using parallel algorithms for irregular packing problems with distance and balancing conditions. Some results in this direction are on the way [50]. Parallel techniques used in this work demonstrate their efficiency for traditional optimization approaches. We may expect that combining evolution algorithms [33] with parallel frameworks for packing problems may provide more computational savings.