An Approach for Improving Local Solutions in the Unequal Circles Packing Problem Sergiy Yakovlev National Aerospace University ''Kharkiv Aviation Institute'', st. Chkalov, 17, Kharkiv, 61070, Ukraine Abstract The problem of packing unequal circles of fixed radius into a circle of minimum radius is considered. An approach to improving local solutions obtained by any of the known methods is proposed. The approach is based on the idea of expanding the space of variables. The dimension of the problem expands if we assume that the radii of the circles are considered as independent variables. In this case, an additional rigid system of constraints is constructed in such a way that the convergence of variable radii to the initial fixed values is ensured in the process of the algorithm. To construct such a system of constraints, the combinatorial structure of the problem is used.The numerical results of solving test problems of packing various numbers of circles are presented and the analysis of the results obtained is carried out. Keywords 1 Packing problem, optimization, circle, permutation 1. Introduction The problems of packing circles and spheres in containers of various shapes are given constant attention from scientists. Problem statements differ in the space dimension, the shape of containers, the specifics of accounting for metrical parameters (sizes) of objects and containers, etc. [1 – 7]. In recent times, the number of publications in this area has increased [8 – 12]. This, on the one hand, is due to the fact that the problems have numerous practical applications. On the other hand, these problems have become a testing benchmark for new methods of global optimization, since they are characterized as multi-extremum and of high dimension. According to the typology proposed by Wäscher et al [13] the problems can be considered as the Knapsack Problems (KP) or Open Dimension Problems (ODP): 2DCKP, 3DSKP, 2DCODP, 3DSODP. The subject of this article is the problem of packing unequal circles into a circle of minimum radius. However, the approach proposed below can be easily extended to pack both circles and spheres into an arbitrary container and even into multiple containers. The main idea of the proposed approach is to identify the combinatorial structure of the problem and artificially expand the space of variables (lifting) to create new possible directions for improving the objective function. Note that increasing the dimension of the problem due to the variable radii of the spheres (circles) is used in Jump Algorithm [14], where successively the auxiliary problems of minimizing the unused domain of the container are solved. This allows the transition from one local extremum to another, with the best value of the objective function. The problems of optimal packing of unequal circles and spheres have wide practical application. Such problems arise in various industries, materials science, powder metallurgy, nanotechnology, radiosurgery, laser coagulation, monitoring systems design, studying various structures in biology, layout problems in logistics systems and space technology, coding, classification, information security, etc. [15 – 21]. II International Scientific Symposium «Intelligent Solutions» IntSol-2021, September 28–30, 2021, Kyiv-Uzhhorod, Ukraine EMAIL: svsyak7@gmail.com ORCID: 0000-0003-1707-843X © 2021 Copyright for this paper by its authors. Use permitted under Creative Commons License Attribution 4.0 International (CC BY 4.0). CEUR Workshop Proceedings (CEUR-WS.org) 150 2. Problem Statement Let be given a set of circles S1 , S 2 ,..., S n , the radii of which are equal rˆ1 , rˆ2 ,..., rˆn respectively. Without loss of generality, suppose rˆ1  rˆ2  ...  rˆn . The problem is to place the circles S1 , S 2 ,..., S n in a circle S 0 of minimum radius r0 with a center at the point p 0 = 0,0 . We denote the coordinates of the centers by p i = ui , vi  , i  J n = 1,2,..., n. Then the mathematical model of the problem will take the form r0  min , (1) subject to ui2  vi2  (r0  rˆi ) 2 , i  J n , (2) (ui  u j )2  (vi  v j )2  ( rˆi  rˆj )2 , (3) i  J n , j  J n , i < j. Thus, we have a nonlinear optimization problem with variables r0 , ui , vi , i  J n , which we call Problem 1. Problem 1 is multiextremal due to the nonconvexity of constraints (2). The use of numerical methods for nonlinear optimization allows finding only its local solutions, depending on the choice of initial values r0 , ui , vi , i  J n . Traditionally, methods of directed search of local solutions are further used. At the same time, multi-start schemes are effective, in which starting points are generated randomly or according to some special rule. This paper proposes a new approach that improves local solutions obtained by known methods. The approach is based on the idea of the method of artificial extension of the dimension of space, first proposed in [22] using the concept of the configuration space of geometric objects [23]. In this case, generalized variables of the configuration space are the metrical and placement parameters of geometric objects. First of all, let us use the combinatorial structure of the problem as a Euclidean combinatorial optimization problem [24]. We will consider the radii r1 ,r2 ,...,rn of the circles as independent variables and form the system n n r = rˆ , i=1 i i=1 i (4) W ri  rˆi W  J n , iW i =1 (5) n n ri    = rˆi    , 2 2 (6) i =1 i =1 where elements of subsets W  J n of capacity W in increasing order, and 1 n τ= rˆi . n i=1 (7) System (4-6) is such that the set of its solutions coincides with the permutation set of real numbers rˆ1 , rˆ2 ,..., rˆn . This property is a partial case and follows from the general concept of continuous representations and functional extensions of Euclidean combinatorial sets. Representation (4-6) is called polyhedral-spherical [25], because, as is easy to see, it describes a set that is the intersection of the permutation polyhedron (5) and the hypersphere (6) with center at point (7). Optimization problems on polyhedral-spherical sets have interesting properties, which are investigated in the theory of convex extensions on vertex-located sets [25]. Let us consider the function optimization problem (1) with restrictions ui2  vi2  (r0  ri ) 2 , i  J n , (8) 151 (ui  u j )2  (vi  v j )2  ( ri  rj )2 , (9) i  J n , j  J n , i < j, where variables ri , i  J n satisfy conditions (4-7). The problem of nonlinear optimization (1), (4-9) with variables r0 , ui , vi , ri , i  J n is called Problem 2. Theorem 1. Both Problem 1 and Problem 2 are equivalent in the sense of the coincidence of their global solutions. The proof of the theorem is based on the uniqueness of the polyhedral-spherical representation of the Euclidean set of permutations [24, 25] generated by the set of radii of the circles. It is known that the equality of global solutions in multiextremal problems does not imply the coincidence of their local solutions. It is this fact that makes it possible to obtain different local solutions for the same initial points when implementing numerical optimization methods. Note that Problem 1 has a dimension 2n+1, and the dimension of Problem 2 is equal to 3n+1. Thus, we have implemented an approach of artificial expansion of the space of variables, based on the general scheme proposed in [22]. Applied to the problem of packing circles and spheres, this approach will be called the variable radius method. 3. Variable Radius Method and its Application to the Unequal Circles Packing Problem The method of variable radii allows one to realize the idea of improving solutions of Problem 1. Indeed, we choose the local solution obtained as the starting point and consider the radii of the circles as independent variables r1 , r2 ,..., rn satisfying constraint system (4-9). As a result, it is possible by variables to overcome the neighborhood of attraction of a local extremum and direct to a new, possibly better, local solution. The initial values of the variable radii can be chosen as equal to the initial values, or generated randomly in (r1 , rn ) . The main difficulties in implementing the proposed approach are associated with an increase in the dimension of Problem 2. It is easy to see that the number of linear constraints in system (5) is equal to 2 n  2 , which already at n >20 leads to difficulties in applying modern numerical methods of nonlinear optimization. On the one hand, using the properties of linear and quadratic functions on combinatorial polyhedra allows one to partially overcome the arising difficulties. However, this does not greatly expand the capabilities of methods in large-scale problems. On the other hand, it is possible to select only l < n circles with variable radii. Let M  = m1 , m2,..., ml   J n be the numbers of circles, whose radii rˆm  rˆm  ...  rˆm are fixed, and the 1 2 l set M  = J n \ M  be of ordered numbers of circles with variables radii ri , i  M  . Form a system of restrictions ui2  vi2  (r0  rˆi ) 2 , i  M  (10) ui2  vi2  (r0  ri ) 2 , i  M  (11) (ui  u j )2  (vi  v j )2  ( rˆi  rˆj )2 , (12) i  M , j  M , i < j. (ui  u j )2  (vi  v j )2  ( ri  rj )2 , (13) i  M , j  M , i < j, 152 (ui  u j )2  (vi  v j )2  ( rˆi  rj )2 , (14) i  M , j  M .  r =  rˆ iM  i iM  i (15) W r  rˆ W  M  iW i i =1 mi (16)  r  ˆ =  rˆ  ˆ , 2 2 i i (17) iM  iM  where 1 l ˆ = rˆm . l i =1 i (18) The problem of nonlinear optimization (1), (10-18) in the space of variables r0 , ui , vi , i  J n , and rj , j  M  we call Problem 3. Theorem 2. The sets of global solutions of both Problem 1 and Problem 3 are the same for any M  = m1 , m2 ,..., ml   J n . The proof is based on the uniqueness of the polyhedral-spherical representation of the set of permutations generated by the radii of the circles with numbers from M  = J n \ M  . Let us expand the above reasoning. Consider a set Q = r1 , r2 ,..., rn  and part it onto q  1 pairwise disjoint subsets as follows. Let be q M = J , k =0 k n (19) where   q M = m1 , m2 ,..., ml , m1 < m2 < ... < ml , k  J = 0J q , lk = n , l0  0 . k 0 q k k k =0 Let us consider the set q Q = Q k (20) k =0 where Q0 =     rˆm1 , rˆm2 ,..., rˆml  , Q = rm1 , rm2 ,..., rml , k  J q . k  0   k  Form a system of restrictions ui2  vi2  (r0  rˆi ) 2 , i  M 0 , (21) u  v  (r0  ri ) , i  J n \ M , 2 i 2 i 2 0 (22) (ui  u j ) 2  ( vi  v j ) 2  ( rˆi  rˆj ) 2 , (23) i  M 0 , j  M 0 , i < j, (ui  u j ) 2  (vi  v j ) 2  (ri  rj ) 2 , (24) i  J n \ M 0 , j  J n \ M 0 , i < j, (ui  u j ) 2  ( vi  v j ) 2  ( rˆi  rj ) 2 , (25) i  M 0 , j  J n \ M 0. 153 For each set Q k , k  J q , we write  r =  rˆ i i (26) iM k iM k W r  rˆ , W  M iW i i =1 mi k (27)  r    =  rˆ    , 2 2 i k i k (28) iM k iM k where l 1 k k = rˆm . lk i =1 i (29) The problem of nonlinear optimization (1), (21-29) in the space of variables r0 , ui , vi , i  J n , and rj , j  J n \ M 0 we call Problem 4. Let us generalize the statements of Theorem 1 and Theorem 2. Theorem 3. The sets of global solutions of both Problem 1 and Problem 4 are the same for any   M 0 = m1 , m2 ,..., ml  J n . The choice of the method of partitioning Q = r1 , r2 ,..., rn  onto a sets 0 Qk =   rm1 , rm2 ,..., rml  , k  J q with the subsequent formation of constraints (12-14), forms a family 0  k  of modifications of the method of variable radius. 4. Numerical Results and Their Discussion The ability to control the variable radii of the circles in the process of solving the problem allows us to propose various strategies for the formation of initial points and the sequential search of local decisions in order to improve them. Suppose that at the initial stage (0-th iteration) a local solution was obtained r0(0) , ui(0) , vi(0) , ri(0) = rˆi , i  J n . Strategies for improving this solution are associated both with the method of forming the parameters for placing the circles and with the rule for choosing the radii, which we will consider as variables. Classical approaches are associated with the choice of a new starting point from an extended neighborhood of the placement parameters ui(0) , vi(0) with fixed radii ri(0) = rˆi and the search for a new local solution r0(1) , ui(1) , vi(1) , ri(1) = rˆi , i  J n (1-st iteration). At the k-th iteration, the initial values for the placement parameters are chosen, corresponding to the best current value of the local solution for fixed values of the radii of the circles. In this paper, it is proposed at each iteration to fix the placement parameters of the circles, setting them equal to the corresponding best current local solution. In this case, the formation of new local solutions is carried out by considering the radii of the circles as variables. We conducted the following computational experiments. For local optimization, the IPOPT software package was used (https://projects.coin-or.org/Ipopt), which implements an internal point method for continuous nonlinear programming problems. Computer with following characteristics was used to perform the computation: i3/8G/SSD 256G. At first, test problems with the number of circles less than 15 were considered. A series of 30 problems was formed in which the radii of the circles were randomly generated uniformly in the interval (1, 15). For each test, the coordinates of the circle centers from a square (-100,100) x (-100,100) were generated randomly. The values obtained were chosen as initial for the implementation of the local optimization method in Problem 1. Then, with the same initial data, Problem 2 was solved, in which the radii of the circles are variables. The initial values for the variable radii ri , i  J n in Problem 2 were randomly generated from the interval (1, 15). Thus, we compared the solutions of both Problem 1 and Problem 2 using the same local optimization method for the same starting point. In 80% of test problems, local solutions of Problem 2 turned out to be better than in Problem 1. The average time to complete Problem 2 was only 1.5 times higher. Note that initially we intended to 154 improve local solutions. Therefore, in the future, solutions to Problem 1 were chosen as the starting point for the implementation of Problem 2. In all cases, improvements to local solutions were obtained. However, when we tried to improve solutions to Problem 2, we succeeded in 86% of cases. An attempt to improve the new best solution at the next iteration was successful only in 43% of cases. As a rule, there were no improvements after the 7-th iteration. This is natural, since the better the initial local solution, the more difficult it is to improve. In the problem of packing circles for n  15 , the numerical experiment was carried out using three strategies, depending on the rules for forming a set of circles with fixed and variable radii. The first strategy corresponds to the case when we fixed the radii of the circles (Problem 1). For the second strategy, the radii of l = 7 circles were assumed to be variables (Problem 3). At the same time, a series of 10 test tasks was formed in which the radii of circles were uniformly randomly generated in the interval (1,100). For each test, textit problem 1 was solved, in which the initial values of the coordinates of the centers of the circles were also randomly generated from the set  500,500   500,500 . Then the solutions obtained were improved using Strategies 1,2. Improvements were received for all tests reviewed. The average runtime for Strategy 2 was 1.6 times higher, but the average solution quality was 4.3% better on average. The third strategy was used for large-scale problems and involved decomposing a set Q into subsets. The choice of the set Q decomposition method has a significant impact on the result. Experimentally, the best results corresponded to the groupings obtained as a result of partition of a set Q = rˆ1 , rˆ2 ,..., rˆn , in non-decreasing order of rˆ1  rˆ2  ...  rˆn (Strategy 3). The proposed approach was tested on the placing of 60 circles, the radii of which were chosen randomly and ordered. In this way Q = rˆ1 , rˆ2 ,..., rˆ60 =6, 6, 8, 9, 10, 10, 13, 13, 15, 17, 18, 20, 23, 25, 25, 26, 26, 30, 31, 32, 32, 33, 34, 34, 35, 37, 38, 39, 41, 42, 42, 45, 48, 49, 49, 51, 55, 55, 56, 58, 58, 59, 61, 62, 63, 65, 66, 66, 69, 69, 70, 73, 73, 75, 76, 79, 80, 82, 82, 83. First, a local solution of Problem 1 was obtained with fixed radii from Q . The starting point for the numerical optimization method was randomly generated uniformly from the square  500,500  500,500 . Radius r0(0) = 450.88 was obtained in 362 sec. Then, the set Q was partitioned in accordance with Strategy 3 and Problem 4 was solved. At each subsequent iteration, the coordinates of the centers of the circles corresponding to the best local solution were chosen as the starting point for the numerical local optimization method. In this case, the set Q = rˆ1 , rˆ2 ,..., rˆn  was partitioned into 10, 12, 15, 20, 30 groups of 6, 5, 4, 3, 2 elements, respectively. At subsequent iterations were obtained r0(1) = 434.72, r0(2) = 433.15, r0(3) = 431.22, r0(4) = 430.90, r0(5) = 430.90. Finally, a solution was reached r0(6) = 426.74 and the coordinates ui , vi , i  J n of the circle centers are shown in Table 1. The runtime was 968 sec. 5. Conclusions This article proposed a new approach for improving local solutions to the problem of packing unequal circles in a circular container of minimum radius. The basic idea is to expand the variable space of the optimization problem, assuming that the radii of the circles are considered as variables. At the same time, an additional constraint system for variable radii is being constructed using the permutation structure of the problem. It is guaranteed that, as a result of the decision at the last stage, the radii will take their initial values. This approach differs from the known ones in that it allows overcoming the attraction zones of local extrema of the problem not only by changing the coordinates of the centers of the circles, but also by partially varying their radii. This provides additional directions for improving the objective function, which ultimately improves the result. The method of variable radii can be extended to containers of various shapes and even to several containers. In this case, of course, the restrictions on the placement of circles inside the container change. Moreover, the proposed approach can be used in solving problems of packing unequal spheres into an arbitrary container. In these cases, systems of restrictions on one or more metric parameters are formed by analogy with round objects. The combinatorial structure of the problem will be generated by the same system of constraints as for the radii of circles.Thus, the field of application of the variable radius method for improving the obtained solutions can be significantly expanded. 155 Table 1 Local solution at the final iteration ri ui vi ri ui vi 6 -280,16 230,82 42 15,42 -228,05 6 -303,31 -287,32 45 -311,72 -220,35 8 -271,70 247,70 48 -147,12 -348,99 9 15,60 50,27 49 -227,14 -179,32 10 339,56 -235,67 49 -118,14 358,54 10 -175,93 17,74 51 75,76 19,43 13 -411,64 41,57 55 -81,88 255,59 13 -288,63 296,43 55 -371,50 -13,32 15 -333,40 47,14 56 -322,57 182,74 17 289,49 35,70 58 -232,51 -286,19 18 23,63 -287,49 58 -347,36 -123,71 20 400,88 61,96 59 -19,46 -120,32 23 -189,86 240,44 61 -257,03 5,46 25 -304,08 261,71 62 233,50 280,19 25 187,64 354,83 63 332,47 -147,55 26 -150,06 211,86 65 108,66 256,86 26 -2,01 -28,98 66 176,63 126,77 30 -259,36 -100,62 66 -204,92 121,28 31 316,29 237,83 69 -30,36 -356,44 32 -162,54 288,18 69 357,29 -17,90 32 -197,66 341,68 70 251,46 -253,03 33 -239,29 214,12 73 -77,78 49,46 34 54,97 -63,47 73 38,11 138,26 34 235,13 -135,13 75 5,67 351,69 35 7,05 241,70 76 -150,45 -80,62 37 -303,58 91,70 79 -105,57 -228,98 38 -238,90 285,12 80 322,63 127,01 39 -378,96 82,02 82 117,16 -324,22 41 121,82 365,29 82 119,23 -160,23 42 -104,60 161,29 83 205,29 -19,45 6. References [1] M. Hifi, R. M'Hallah 2009 A literature review on circle and sphere packing problems: models and methodologies Advances in Operation Research vol. 2009 pp. 1-22 https://doi.org/10.1155/2009/150624 [2] I. Castillo, F.J. Kampas, J.D. Pinter 2008 Solving circle packing problems by global optimization: numerical results and industrial applications Eur.J. Oper. Res. vol. 191(3) pp. 786-802 https://doi.org/10.1016 / j.ejor.2007.01.054 [3] C.O. López, J.E. Beasley 2013 Packing unequal circles using formulation space search Comput. Oper. Res. vol. 40(5) pp. 1276-1288 https://doi.org/10.1016/j.cor.2012.11.022 [4] J. Liu, Y. Yao, Yu. Zheng, H. Geng, G. Zhou 2009 An effective hybrid algorithm for the circles and spheres packing problems Combinatorial Optimization and Applications, Lecture Notes in Computer Science vol. 5573 pp. 135-144 https://doi.org/10.1007/978-3-642-02026-1_12 [5] K. He, M. Huang, C. Yang 2015 An action-space-based global optimization algorithm for packing circles into a square container Computers & Operations Research vol. 58 pp. 67-74 https://doi.org/10.1016/j.cor.2014.12.010 [6] Y. Shang 2014 A novel method for equal and unequal circle packing problem Applied 156 Mechanics and Materials vol. 513 pp. 3942- 3945 https://doi.org/10.4028/www.scientific.net/ AMM.513-517.3942 [7] Z. Amirgaliyeva, N. Mladenovic, R. Todosijevic, D. Urosevic 2017 Solving the maximum minsum dispersion by alternating formulations of two different problems European Journal of Operational Research vol. 260(2) pp. 444-459, https://doi.org/10.1016/j.ejor.2016.12.039 [8] L.J.P. Araújo, E. Özcan, J.A.D. Atkin, and M. Baumers (2018) Analysis of irregular three- dimensional packing problems in additive manufacturing: A new taxonomy and dataset Int. J. Prod. Res. 57 pp. 5920–5934 https://doi.org/ 10.1080/00207543.2018.534016 [9] I. Gibson, D. Rosen, and B. Stucker, 2015 Additive Manufacturing Technologies 3D Printing, Rapid Prototyping, and Direct Digital Manufacturing. Springer-Verlag, New-York 498 p. [10] Y. Stoyan, G. Yaskov 2021 Optimized packing unequal spheres into a multiconnected domain: mixed-integer non-linear programming approach International Journal of Computer Mathematics: Computer Systems Theory vol. 6(1) pр. 94–111 https://doi.org/10.1080/23799927.2020.1861105 [11] Y. Stoyan, et al. 2020 Optimized packing multidimensional hyperspheres: a unified approach, Mathematical Biosciences and Engineering vol. 17(6) pp. 6601–6630 https://doi.org/10.3934 / mbe.2020344 [12] I. Yanchevskyi, R. Lachmayer, I. Mozgova, et al. 2020 Circular packing for support-free structures EAI Endorsed Transactions on Energy Web vol. 7(30) pр. 1–10 http://dx.doi.org/10.4108/eai.13-7-2018.164561 [13] G. Wäscher, H. Haussner, H. Schumann 2007 An improved typology of cutting and packing problems European Journal of Operational Research vol. 183 pp. 1109-1130 https://doi.org/10.1016/j.ejor.2005.12.047 [14] Yu. Stoyan, G. Yaskov 2014 Packing unequal circles into a strip of minimal length with a jump algorithm Optimization Letters vol. 8(3) pp. 949-970 https://doi.org/10.1007/s11590-013-0646-1 [15] Y. Wang, M. Nagarajan, C. Uhler, G.V. Shivashankar 2017 Orientation and repositioning of chromosomes correlate with cell geometry-dependent gene expression Mol Biol Cell vol. 28(14) pp. 712-721 https://doi.org/10.1091/mbc.E16-12-0825 [16]A.S. Shirokanev, D.V. Kirsh, N.Yu. Ilyasova, A.V. Kupriyanov 2018 Investigation of algorithms for coagulate arrangement in fundus images Computer Optics, vol. 42(4) pp. 712-721 https://doi.org/10.18287/2412-6179-2018-42-4-712-721 [17] E.I. Corwin, M. Clusel, O.N. Siemens 2010 Model for random packing of polydisperse frictionless Soft Matter vol. 6 pp. 2945-2959 https://doi.org/10.1039/C000984A [18] Ke Changhong (Ed.) 2012 Recent Advances in Nanotechnology CRC Press 306 p. [19] O. Blyuss, et al. 2015 Optimal placement of irradiation sources in the planning of radiotherapy Mathematical Models and Methods of Solving. Computational and Mathematical Methods in Medicine, vol.2015 pp. 1-8 https://doi.org/10.1155/2015/142987 [20] J.H. Conway, N.J.A. Sloane, Sphere Packing, Lattices and Groups, third ed., Springer-Verlag, New York, 1999, 706 p. https://doi.org/10.1007/978-1-4757-6568-7 [21] Z. Duriagina, I. Lemishka, I. Litvinchev, et al. 2020 Optimized Filling of a Given Cuboid with Spherical Powders for Additive Manufacturing Journal of the Operations Research Society of China https://doi.org/10.1007/s40305-020-00314-9 [22] S.V. Yakovlev 2017 The method of artificial space dilation in problems of optimal packing of geometric objects Cybernetics and Systems Analysis vol. 53(5) pp. 725-732 https://doi.org/10.1007/s10559-017-9974-y [23] S.V. Yakovlev 2019 Formalizing spatial configuration optimization problems with the use of a special function class Cybernetics and Systems Analysis vol. 55(4) pp. 581-589 https://doi.org/10.1007/s10559-019-00167-y [24]Yu.G. Stoyan, S.V. Yakovlev 2020 Theory and methods of Euclidian combinatorial optimization: current status and prospects Cybernetics and Systems Analysis vol. 56(3) pp. 366–379 https://doi.org/10.1007/s10559-020-00253-6 [25] S.V. Yakovlev, O.S. Pichugina, and O.V. Yarovaya 2019 Polyhedral spherical configuration in discrete optimization Journal of Automation and Information Sciences vol. 51(1) pp. 26-40 http://dx.doi.org/10.1615/JAutomatInfScien.v51.i1.30 157