Technical Report
Variational Circle Packing Based on Power Diagram
Lin Lu, Yi-King Choi, Feng Sun, and Wenping Wang
Abstract
Circle packing aims at arranging multiple circles in the smallest container with
a fixed shape, without overlapping between any two circles. Existing methods
either solve it by minimizing the size of the container continuously or find an approximate smallest container by combinatorial optimization. Various approaches
are proposed to handle different shapes of containers. In this paper, we generalize
the concept of centroidal Voronoi tessellation (CVT) and present a unified framework suitable for distinct containers. The framework adopts power diagram and
enjoys several nice properties. A local minimum is almost always obtained. Furthermore, we integrate an efficient global optimization strategy, called monotonic
basin hopping, to reach better local minima. Experiments show that both the local
framework and the global minimization are effective.
1
Introduction
Circle packing is a classical mathematical problem arranging multiple circles in a containing region without overlapping between any two circles. Besides the theoretical
importance, it finds a wide spectrum of applications in industrial manufacturing and
logistics, such as cable/wire bundling, pallet loading, textile/glass/wood/paper cutting,
container stuffing and facility dispersion [14].
First we give an intuitive presentation of the problem: given a 2D shape and n circles
with different radii, we find the smallest container with the given shape to hold all n
circles inside it without overlapping. See Figure 1 for an illustration. In the typical
cable bundling application, we want to maximize the material (outer sheath) utilization by using the smallest container and hence to minimize the waste space between
circles (sections of cables). The circle packing problem is NP-hard [18]. Stoyan and
Yas’kov [43] show that the function has larger than n! local minima for a rectangular
container, therefore is non-convex. Analysis on containers with general shapes is still
missing. All these attributes render it a hard problem to solve.
Global optimization strategy is often used to solve non-convex problems, in which
local optimization is an inner step. For circle packing, local optimization itself is dif-
1
Figure 1: Left: 6 circles to be packed. Middle: 4 typical containers. Right: The packing
results. Note that they may not be the smallest containers.
ficult. Popular methods include nonlinear programming (NLP) and combinatorial optimization. Classical methods such as deterministic approaches, stochastic search and
heuristic are usually used as global optimization techniques on circle packing.
From the geometric point of view, we propose a new variational approach to solving
the circle packing problem. We generalize the definition of centroidal Voronoi tessellation (CVT) [17] by replacing the Voronoi diagram [10] with the power diagram [9] and
the Lloyd’s method [34] for CVT computation by moving the site to the incenter of the
cell rather than the centroid. We show that our adapted variational approach minimizes
the size of the container monotonically and almost always converges to a local minimum. Compared with existing variational approaches utilizing classical optimization
techniques, our approach benefits from power diagram and has three advantages:
• The computation is simple and fast.
• The constraints are met naturally, that is, all circles remain inside the container
and any two circles do not overlap with each other.
• The shape of the container is flexible. Even the computation on a highly complex
shape is scalable.
The remainder of the paper is organized as follows. We review related literature in
Section 2 and give the formulation to be used in this paper in Section 3. Our local
optimization algorithm is described in Section 4 and analyzed in Section 5. Global
optimization is presented in 6. Numerical experiments are shown in Section 7. After
some discussion in Section 8, we conclude the paper in Section 9.
2
Related work
The circle packing problem is relatively new among the regular packing problems [35,
38] and has recently received much attention. We refer the reader to a comprehensive
survey by Hifi and M’Hallah [26].
Based on whether the circles are identical or not, this problem is classified into two
2
groups:
2.1
Packing identical circles
Numerous methods have been proposed on packing identical circles. In 1611, Kepler discussed the problem that how many equally sized spheres can be packed into
a given container and claimed that “the cubic or hexagonal close packing will be the
tightest possible, so that in no other arrangement more spheres could be packed into
the same container.” [32]. However, Lubachevsky and Graham [37] showed that in
2D, an “ideal” hexagonal pattern is in fact not the most condensed distribution for
circular circle packing problem. Schürmann [41] extended the conclusion to 3D and
higher dimensions that Kepler’s assertion does not hold for many containers. Szabó et
al. [45] devoted a book on the problem of packing equal circles in a square. Graham and Lubachevsky [21] considered the equilateral triangular container. Chen et
al. [15] proposed a pack-and-shake scheme for the general bounded domain. Cortes
and Bullo [16] made a comprehensive study on packing identical circles in a convex
polygon using dynamical system and nonsmooth analysis. They proved that being an
“incenter Voronoi configuration” is a necessary condition of a critical point of the circle packing problem and also considered three kinds of dynamical systems which will
achieve either critical points of the problem or incenter Voronoi configurations. The
best known solutions for packing equal circles in a container whose shape is a square,
a circle, a 10 × 1 rectangle, a 5 × 1 rectangle, an isosceles right triangle or a semicircle
are reported on the website [1] maintained by E. Specht.
2.2
Packing nonidentical circles
Regarding the nonidentical circle packing problem, which is a more general case,
there are two methodological categories based on the solution strategies, exact method
and heuristic method. For the exact method, a mathematical model for the specific
circle packing problem is firstly built, and then NLP solvers such as MINOS [13],
SNOPT [12, 11, 22], MathOptimizer [40] are used to achieve numerical local minima directly. The other method relies on heuristics, and most work in the literature
stays in this category. Various heuristic rules have been proposed and tested to solve
this problem, like maximal hole degree rule [29, 30], corner-occupying action [36],
quasi-physical approaches [46] etc. Their goal is to identify the potential “best local
position(s)” for each circle to be packed in the container. One disadvantage of such
methods is the limited accuracy, i.e. they can only achieve approximate results.
Both of these methods fall into the local minimization stage. Normally, one does global
search for the “optimal” solution afterwards. For the global optimization, there are
mainly two classes of approaches being exploited. (1) Deterministic approaches, e.g.
branch and bound [42]. (2) Probabilistic approaches, e.g. simulated annealing [27],
genetic algorithms [24], population-based approaches [36], tabu search [46] and hybrid
3
approaches [19, 8], etc. When the number of packing items becomes large (as n > 30),
the global optimization process becomes extremely time consuming.
Lacking a general framework, most current studies handle the containing regions with
different shapes (e.g. rectangular container and circular container) individually. As
far as we know, there is no work on packing unequal circles in a general polygonal
container.
Circle packing problem in a rectangular container George et al. [20] designed
an approach based on several constructive rules (e.g., quasi-random and genetic algorithm) to simulate the packing operation. Stoyan and Yaskov [42, 43] presented a
mathematical model for packing unequal-size circles into a minimal length strip with
fixed width. They search for an estimate of the global optimum by an approximate
exhaustive search of local minima using the reduced gradient method and the active
inequality strategy. Hifi et al. [27] adopted a simulated annealing approach based on
an energy function. Huang et al. [29] proposed two greedy algorithms based on the
maximum hole degree rule and a look ahead search strategy.
Circle packing problem in a circular container Arbitrary sized circle packing
problem has been addressed by Wang et al. [46] and Huang et al. [28]. They developed
approximate algorithms based on physical analogy (squeezing and collisions between
circles) and human behavior knowledge (jumping from the dense trap to get some
“relief”). Mladenovic et al. [39] proposed a general reformulation descent heuristic,
which switches from solving the problem expressed in Cartesian coordinates to polar
coordinates or vice versa, to solve the problem iteratively, till converging to a local
optimum. The switching allows non-linear programming solvers to use the first order
information to escape stationary points. Hifi and M’Hallah [23] proposed an algorithm
based upon a dynamic adaptive local search procedure. The algorithm iterates through
two complementary steps which are dynamically coupled in search for the smallest
circle. Huang et al. [30] proposed a heuristic method based on maximal hole degree
rule to solve this problem, which is the extension of the approach in [29]. Sugihara et
al. [44] constructed a sufficiently large circle that contains all circles, and then reduce the radius of the containing circle using a shrink and shake iterative strategy by
translating circles. They sped up their strategy by using the circle Voronoi diagram to
determine the translation distance of any protruding circle while keeping all circles inside the containing circle. This is a heuristic approximation algorithm, which pursues
the results discretely. Addis et al. [12] used SNOPT, a solver using sequential quadratic
programming (SQP) algorithm as the local optimizer and population basin hopping as
the global optimization method. However, SNOPT relies on smooth functions, and the
packing objective function does not fit well. There was once a contest on packing unequal circles in a circle. The competitors were asked to place n circles of radii equal to
1, 2, . . . , n respectively (n is up to 50) in a minimal circle. The solutions are available
online [2].
4
3
Problem formulation
Given a region Ω ∈ R2 with a predetermined shape and n circles {Ci }ni=1 with known
radius {ri }ni=1 , we focus on the circle packing problem of determining the smallest Ω
(in terms of area) that encompasses all n circles, without any overlapping among them.
We assume that ri > 0 for all i, as a circle with zero radius is considered a point and
does not contribute in the packing.
An arrangement of a set of circles Ci with radii ri , i = 1, . . . , n, in R2 can be represented
by X = (x1 , . . . , xn ), where xi is the coordinates of the centre of Ci . We also call X a
configuration. A configuration is said to be valid if all circles are inside the container
Ω with no overlap.
The circle packing problem can be stated as the following optimization problem:
|Ω|
Minimize
Subject to Ci ⊆ Ω,
i ∈ {1, . . . , n}
Ci ∩C j = 0,
/
i, j ∈ {1, . . . , n}, i 6= j,
(1)
|Ω| is the area of Ω.
where
A circle here is considered as a closed circular disk, and therefore the second constraint
can also be written as kxi − x j k − ri − r j ≥ 0. The objective function is then F : R2n →
R, with F(X) = |Ω|.
Suppose that we introduce a scaling factor of k ∈ R, k > 0, to all n circles, so that each
circle Ci now becomes kCi . Then, by fixing the size of the container Ω, say |Ω| = 1,
the above problem is equivalent to:
Maximize
k
Subject to
kCi ⊆ Ω,
i ∈ {1, . . . , n}
kCi ∩ kC j = 0,
/
where
i, j ∈ {1, . . . , n}, i 6= j,
(2)
|Ω| = 1.
In this case, the objective function F̃ : R2n → R is given by F̃(X) = k. The above
two formulations are equivalent since the sizes of the container and the circles are
relative. By solving the optimization problem in Equation (2), the minimum area of Ω
in Equation (1) is given by 1/k.
4
Local strategy
In this section we present our geometric and variational method for solving the circle
packing problem. We use the power diagram in the framework, which serves to make
the partition for the circles in the container, while satisfying the problem constraints.
5
4.1
Power diagram
The power diagram is a kind of weighted Voronoi diagram introduced by Aurenhammer [9]. Let P = {p1 , . . . , pn } be a set of distinct points in Rm and each point pi be
associated with a weight wi ≥ 0, i = 1, . . . , n. The power distance dw (p, pi ) from a
point p to pi is defined as
dw (p, pi ) = kp − pi k2 − wi .
The power distance induces a partition of Rm by P. Let V (pi ) be a region associated
with pi in P so that
V (pi ) = {p ∈ Rm | dw (p, pi ) ≤ dw (p, p j ), ∀p j ∈ P}.
The set of all V (pi ) is then the power diagram of P. It is easy to see that if all points
carry the same weight, the power diagram is essentially the same as the Voronoi diagram.
Given a bounded region Ω ⊂ Rm , let Ωi be the intersection of V (pi ) and Ω, that is,
Ωi = V (pi ) ∩ Ω.
Then the set of all Ωi constitutes the bounded power diagram of P in Ω. We shall also
call Ωi the cell of pi .
We now focus on the power diagram in R2 . In 2D, we may treat a point pi of weight
√
wi as a circle centred at pi with radius wi . Then we have the following properties in
the power diagram:
• The bisector of two given circles, that is, the locus of points with equal power
distance from the centres of the two circles, is always a straight line perpendicular to the line joining the centres.
• If two circles are tangent to each other (either externally or internally), the bisector passes through their common tangent point.
• If two circles overlap, the bisector passes through the two intersection points of
the circles.
• If two circles do not overlap, the bisecting line does not intersect either circle.
• If one circle is contained within another, the bisector lies outside both circles;
also, the cell associated with the larger circle lies in the half space containing
the two centres, and hence the smaller circle lies entirely outside of its cell. In
particular, for two concentric circles, the cell associated with the smaller circle
is an empty cell that contains no point at all.
The above properties follow directly from the definition of the power distance. Figure 2
shows two examples of the power diagram in 2D.
We can see that a circle packing of a set of given circles in a container is well associated
with a bounded power diagram, with each circle Ci centred at xi with radius ri be treated
6
(a)
(b)
Figure 2: Examples of the bounded power diagram in 2D. The weight of each point
is the square of the radius of its associated circle. (a) Power diagram of non-identical
circles. Note that the smallest circle is contained within the largest circle, and is lying
entirely outside of its cell which is at the upper left corner of the bounded region.
(b) Power diagram of identical circles, which is essentially the same as the Voronoi
diagram.
as a point xi of weight wi = ri2 . Since the circles in a circle packing are non-overlapping,
every circle is completely contained within its cell.
In analogy to computing a centroidal Voronoi diagram [17] using the Lloyd’s method [34]
to minimize a certain cost function, our idea is to iteratively update a bounded power
diagram in order to maximize the scaling factor k in Equation (2) that can be applied
to all circles while maintaining non-overlapping among the circles. Hence, the essence
of our framework is:
• to keep increasing the scaling factor k at each iteration, and at the same time
• to ensure the update of the circle locations does not result in any overlapping.
The details of our framework will be discussed in the next section.
4.2
Local algorithm
In this section, we present our framework for solving the optimization given by Equation (2) in Section 3. Given a set of circles Ci with radii ri , i = 1, . . . , n, and a predetermined shape Ω with |Ω| = 1, our goal is to determine the maximum scaling factor k
and the corresponding circle packing configuration of the scaled circles kCi in Ω. The
detail steps of our method are given in Algorithm LPD1.0 as follows:
A LGORITHM LPD1.0 : Local Circle Packing Algorithm
I NPUT : Circles {Ci }ni=1 with radii {ri }ni=1 , a container Ω with |Ω| = 1, an initial scaling factor k and an initial valid configuration X = {xi }ni=1 of the scaled circles
{kCi }ni=1 .
O UTPUT : A resulting configuration of {kCi }ni=1 and k.
7
S TEPS:
1. Assign a radius of kri to each circle Ci , i = 1, . . . , n.
2. Construct the bounded power diagram {Ωi }ni=1 associated with {Ci }ni=1 and X in
Ω.
3. For each region Ωi , i = 1, . . . , n, compute its maximum inscribed circle (MIC),
C̃i , with center x̃i and radius r̃i = maxq∈Ωi minp∈∂ Ωi kp − qk, where ∂ Ωi denotes
the boundary of Ωi .
4. k0 ← k, k ← mini {r˜i /ri }.
5. If k = k0 , goto step 6; otherwise,X ← {x̃i }ni=1 and goto step 1.
6. Return X and k.
The above algorithm requires an initial scaling factor k and an initial position X of
the scaled circles kCi , i = 1, . . . , n, which gives a valid configuration, that is, kCi ⊂
Ω for all i, and kCi ∩ kC j = 0/ for all i 6= j. By choosing a very small value of k,
say k = 10−6 / maxi {ri } which depends on the size of the input circles, and a set of
random initial positions for the scaled circles, a valid configuration is easy to achieve.
Details of the initialization will be discussed further in Section 6.1. In each iteration,
the algorithm constructs the bounded power diagram for the scaled circles, updates
the circle configuration and computes a new scaling factor k for the next round. The
algorithm ends when no further improvement can be made to k.
→
k = 1e − 7
→
→ ··· →
k = 6.7277e − 3
k = 1.3003e − 2
k = 2.7485e − 2
Figure 3: Circular container, n = 5, r1 = 20, r2 = r3 = 15, r4 = 2.5, r5 = 8.5. The radius
of the obtained optimal containing circle is 36.3832.
→
k = 1e − 7
→
→ ··· →
k = 7.9136e − 3
k = 6.2151e − 3
k = 1.5165e − 2
Figure 4: Square container, n = 5, r1 = 20, r2 = r3 = 15, r4 = 2.5, r5 = 8.5. The edge
length of the obtained optimal containing square is 65.9396.
8
Given a cell Ωi , the largest circle that it can contain is given by the maximum inscribed
circle (MIC). Inspired by the Lloyd’s method which updates the sites to the centroids
of the Voronoi cells iteratively in computing a CVT, we update the circle position in
each cell by moving the circle to the centre of the MIC. We also choose a new scaling
factor k = mini {r˜i /ri }, where r˜i and ri are the radii of the MIC and the circle in Ωi , respectively. The factor k is the maximum enlargement possible so that the scaled circles
kCi are all contained within their cells and hence are non-overlapping. Moreover, the
choice of k in relation to the MIC guarantees that k is non-decreasing. The termination
condition for the iteration k = k0 is realized only when a circle is the MIC of its cell.
Hence, we have the following proposition:
Proposition 1. The algorithm LPD1.0 optimizes the objective function in Equation (2)
monotonically by increasing the value of k in each iteration. When the algorithm terminates, the resulting configuration always gives a valid circle packing. Also, at least
one of the circles coincides with the MIC of its power diagram cell.
We note that there is a difficulty in handling a power diagram cell whose MIC is not
unique. For example, if the cell is rectangular, there are infinite MICs that slide along
the two long parallel edges. In this case, we shall simply pick an arbitrary MIC. The
circle in such a cell is definitely free but can never get increased on its size unless the
cell is changed. Fortunately, this problem has little chance to happen in practice due to
the numerical accuracy. So we just assume that each power diagram cell has the unique
MIC in the following discussion.
5
Configuration evaluation
In this section we shall investigate the properties of each circle and the configuration
and analyze a local extremum of the problem from the geometric point of view, to
evaluate our local algorithm.
5.1
The property of a circle
For a single circle in the configuration, there are two exclusive states, free or locked,
defined as follows.
Definition 2. In a configuration, a circle is free if it can move an infinitesimal distance
without making any overlap with all other circles fixed. Otherwise, it is locked.
As the resulting configuration is valid, each two objects are either separated or touching each other. For the sake of easy depiction, we call an object that is tangent to a
given object as its contact neighbor. An object is either a circle or the container boundary. Concerning the container, each circle that is tangent to the boundary is its contact
neighbor. From the definition, if a circle C is locked, it will intersect with other circle(s)
or the container’s boundary when moving to any direction within an infinitesimal dis-
9
tance. In this case, C must have at least one contact neighbor and two touching points.
We say that C is locked by its contact neighbor(s).
To determine whether C is free or locked, we shall find out its contact neighbors, compute the shortest arc that covers all the tangent points with its contact neighbors, denoted as α, and do the following discussions subsequently.
I If α is empty, C is free.
a
II If α is a minor arc, C is free. (See the right figure, left.
C is in dashed line and α is highlighted.)
a
c
c
III If α is a major arc, C is locked. (See the right figure, right)
IV If α is a semi-circle, it needs further check.
Let the two endpoints of α be p1 and p2 , and the curve that is tangent C at p1 and
p2 is γ1 and γ2 respectively, i.e., γ1 and γ2 may be another circle or one segment
of the boundary. Denote the signed curvature at p1 of γ1 and at p2 of γ2 by K1 and
K2 respectively.
If K1 and K2 are of the same direction as the curvature of C at p1 and p2 respectively, C is locked. (Figure 5 (a))
If K1 and K2 are of the opposite direction to the curvature of C at p1 and p2 respectively, C is free. (Figure 5 (b))
Otherwise, we check the radius of curvature. If |1/K1 | ≥ |1/K2 | + 2rc , C is free
(Figure 5(c),(d)); if |1/K1 | < |1/K2 | + 2rc , C is locked (Figure 5(e)).
If K1 and K2 are zero, C is free (Figure 5( f )).
g
1
p1
g
g
2
1
c
(a)
p2 p1
g
g
2
1
c
p2 p1
(b)
g
g
2
1
c
p2 p1
(c)
g
1
g
2
c
(d)
p2 p1
g
g
2
1
c
p2 p1
(e)
g
2
c
p2
(f)
Figure 5: The property of circle C is: (a) locked; (b) free; (c) free; (d) free; (e) locked;
( f ) free.
In our resulting configuration, each circle’s location coincides with the MIC of its
power diagram cell, and hence case II never happens. When a circle has no intersection with its power diagram cell, it is free (case I), otherwise it may belong to case
III or IV, i.e., it is either locked or free. To eliminate the free circles of case IV, we
amend step 6 in LPD1.0 as follows.
A LGORITHM LPD1.5 : Amended Local Circle Packing Algorithm
The same as LPD1.0 except:
10
6. Detect the property of each circle.
If there exist free circles belonging to case IV, we perturb such circles with a
small and random displacement, meanwhile decrease k to keep them inside the
container, and goto step 1;
otherwise, return the configuration X and k.
Note that the perturbation strategy may fail and cause that algorithm converges to the
same configuration, however, empirically it will succeed within limited times of tries.
Figure 6 demonstrates an example which is stuck in the algorithm LPD1.0 and further improved by LPD1.5 . Now in the resulting configuration, a circle is locked and
belongs to case III iff it has intersection with its power diagram cell.
→
k = 0.1
→
k = 0.09
→
k = 0.09487
k = 0.12237
Figure 6: An example starting from step 6 in LPD1.5. Circular container, n = 4, r1 =
6, r2 = r3 = r4 = 2. The radius of obtained optimal containing circle is 8.17226.
5.2
The property of a configuration
In this subsection we firstly analyze a configuration from the geometric point of view
and build the connection between its geometry and being a local extremum, to examine
the results got from the above algorithm.
Definition 3. A configuration ψ with (x1 , . . . , xn ) is stable if ∃ε > 0, ∀(∆xi )ni=1 , such
that ∑ni=1 k∆xi k < ε, and configuration (xi + ∆xi )ni=1 is not valid.
Intuitively speaking, for the stable configuration, we cannot find infinitesimal adjustment for all circles (under the problem constraints) to achieve a smaller container.
Proposition 4. A configuration is stable iff it is a local extremum of the circle packing
problem.
Proof 5. We use Eqn. 1 in this proof. Assume we have a stable configuration ψ with
X∗ = (x∗1 , . . . , x∗n ). Let the minimal bounding circle be C∗ with radius r∗ . From the
definition it is clear that C∗ equals to the minimal bounding circle of all the locked
circles in ψ. If F(X∗ ) is not a local minimum, there exists another configuration that
has a smaller bounding circle than C∗ , say C0 . So at least one locked circle in ψ has to
move to be contained by C0 , which is contradictory to the assumption that ψ is stable.
Therefore, F(X∗ ) is a local minimum.
Conversely, suppose F has a local minimum at X∗ = (x∗1 , . . . , x∗n ). If X∗ is not stable,
then after finite steps of movement we can always find a stable configuration X0 =
(x01 , . . . , x0n ), such that all the circles be separated from each other, i.e., the bounding
11
circle is reduced. That is F(X0 ) < F(X∗ ), which is opposite to the assumption. Hence,
X∗ is a stable configuration. We need to point out that our algorithm does not guarantee to obtain a stable configuration. As shown in Figure 7, our algorithm terminates at the configuration in (a), but
it is not stable as by moving all circles downwards along the boundary while pushing
the two central circles upwards, the radius of the enclosing circle may be continuously
decreased, until the configuration in (b) is reached. Therefore, (a) is a saddle point
of the objective function, which has also been mentioned by Nenad et al. [39]. The
reason is that our algorithm aims at exploring each circle’s potential movement so that
all circles would grow bigger and the arrangement becomes better, however, the simultaneous movement of all or a group of circles is less considered. Fortunately, the latter
seldom happens when the given circles are nonidentical.
(a)
(b)
Figure 7: The instance of packing 10 unit circles into a circular container. (a) and (b) is
a saddle point and a local extremum of the objective function respectively. The radius
of the container is 3.82847 for (a) and 3.81302 for (b).
6
Improvement of local extrema
As the circle packing problem is non-convex and the number of local minimizers increases quite quickly with the number of circles [22], we discuss the improvement of
the results obtained by the above optimization algorithm from two aspects, the initialization selection and global optimization strategy.
6.1
Initialization selection
The initialization is critical to the result of the optimization algorithms. A careful initialization may lead to a fairly good configuration or fast convergence of the algorithm.
For identical circles, the CVT result serves as a good choice of the initialization. A
CVT is a special type of Voronoi tessellation, in which the position of each site is the
same as the centroid of its Voronoi cell. As a fundamental geometric data structure,
12
CVT has been widely studied in recent years and it can be computed very fast [33]. It
is embedded in our system and since the power diagram shares the same structure as
the Voronoi diagram, so we can use the CVT results directly. Referring to Figure 8, (a)
is the CVT result and (b) is the packing result starting from (a). We can see that CVT
is a good heuristic as it attempts to achieve the optimal distribution of points in some
sense, while matching our goal for circle packing naturally.
(a)
(b)
Figure 8: The instance of packing 30 unit circles into a circular container. (a) The
CVT result; (b) the packing result taken (a) as the initialization, with the radius of the
container 6.3072.
For nonidentical circles, instead of using random configurations, we may start from
the heuristic results of existing methods, such as the dynamic search proposed by Hifi
and M’Hallah [25] and the “maximal hole degree (MHD) rule” algorithm presented by
Huang et al. [30]. The MHD rule is a rather effective heuristic especially for packing
nonidentical circles. In [30], the authors proposed two algorithms A1.0 and A1.5 using
the MHD rule. Both A1.0 and A1.5 treat the circle packing problem as a decision problem, and thus dichotomous search is needed to find the minimal container. Therefore,
the resulting configuration is not an exact local minimum of the objective function. To
take advantage of the heuristic and avoid the disadvantages, we employ the algorithms
in our framework, iteratively applying A1.0 or A1.5 to the current configuration and
performing LPD1.5 afterwards to further optimize it. The interleaving procedure is
described as follows.
A LGORITHM LPD2.0 : Interleaving Procedure for Circle Packing Algorithm
I NPUT : Circles {Ci }ni=1 with radii {ri }ni=1 , a container Ω with |Ω| = 1.
O UTPUT : The configuration of {Ci }ni=1 .
S TEPS:
1. Set an initial valid configuration and an initial scaling factor k.
2. While algorithm A1.0 or A1.5 returns true,
perform algorithm LPD1.5.
3. Return the configuration and k.
13
In A1.0 and A1.5, the circles are packed one by one according to the MHD rule, while
A1.5 uses a selflook-ahead strategy leading to better results than A1.0 with the sacrifice
of more computation time.
6.2
Global optimization algorithm
Our framework also invokes a global optimization strategy to prevent the algorithm
from being trapped into local extrema or nearly local extrema of the objective function. We use the monotonic basin hopping (MBH) approach [22, 31] according to the
following flow.
A LGORITHM GPD : Global Circle Packing Algorithm
I NPUT : Circles {Ci }ni=1 with radii {ri }ni=1 , a container Ω with |Ω| = 1.
O UTPUT : The configuration of {Ci }ni=1 .
S TEPS:
1. Set an initial valid configuration and an initial scaling factor k.
2. Perform algorithm LPD1.5 and get the result X.
3. While the termination condition is not met,
• Perturb X by δ , and perform LPD1.5 to get the result Y;
• If F̃(Y) > F̃(X), X ← Y.
4. Return the configuration and k.
Perturbation The perturbation in step 3 is to find a neighbor
of the current configuration, it changes {xi }ni=1 to {xi + δ wi vi }ni=1 ,
where wi is the average length of all the slice edges of xi ’s power
ci
diagram cell and vi is a random vector in [−1, 1]2 . We call the
line from the center of the circle to the vertex of its power diagram
cell the slice edge (i.e., the dashed line in the right figure). The
parameter δ indicates how far away the perturbation would drag a circle from its current
position. It is critical for the performance of the global search: a too small value would
hinder the generation of the new extrema, while a too large value would disrupt the
structure of the current local extremum. From our experiments, 0.5 is a recommended
value for δ .
14
Termination condition We use the number of iterations without improvements as
the termination condition, denoted by the parameter MaxNoImp. The choice of this
parameter is particularly important: a too low value would cause the algorithm to
stop before reaching a good enough extremum, while a too large value means expensive computational effort. To stop the algorithm with reasonable expense, we set
MaxNoImp = 200 in the experiments.
See Figure 9 for an example: (a) is the result obtained by the local algorithm, which is
a local extremum of the objective function, and (b) is the result yielded by the global
algorithm.
(a)
(b)
Figure 9: An instance shows the results from local and global algorithm respectively.
n = 16, r1 = 0.8, r2...16 = 0.08. The radius of the containing circle is 0.9227 for (a) and
0.9192 for (b).
Note that the MBH strategy improves the local results, but does not guarantee to obtain the optimal solution within the limited time and might get stuck into a local extremum from which it is unable to escape [22]. Nevertheless, our local algorithm can
be employed by diverse global optimization schemes, such as simulated annealing and
genetic algorithm.
7
Results
In this section we present some experimental results to demonstrate the effectiveness
of our framework and give the comparison with several other methods. All algorithms
proposed in this paper have been implemented in C++. We used CGAL [6] to compute
the power diagram. For the container with different shapes, the only change is the intersection computation between each power diagram region and the container’s boundary.
The timing results are taken on a 3.33GHz computer and measured in seconds.
Firstly, we assess our algorithm on the problem of packing identical circles of radius
ri = 1, i = 1, . . . , n, in a circular container, where n = 10, 20, . . . , 100. Table 1 displays
the results obtained by existing methods and our local and global algorithms. Column
r∗ gives the best known results taken from the website [1]. Column rA1.0 , rA1.5 , rBS
report the smallest radii obtained by algorithm A1.0, A1.5 [30] and adaptive beam
search [7] respectively. We employ the CVT results as the initial configurations for
15
LPD1.5 and get the radii shown in column rLPD1.5 with the running time reported in
column tLPD1.5 . LPD1.5 outperforms algorithm A1.0 for all instances and yields better
results than A1.5 in 4 out of 10 instances. Column rGPD and tGPD show the radii and
timing results of our global algorithm GPD. We notice that GPD outperforms the three
listed methods except for the instance n = 70.
n
10
20
30
40
50
60
70
80
90
100
r∗
3.8130
5.1223
6.1977
7.1238
7.9475
8.6462
9.3457
9.9682
10.5461
11.0821
rA1.0
3.9239
5.3844
6.5397
7.3374
8.0742
9.0361
9.6883
10.2276
10.8364
11.5742
rA1.5
3.8211
5.1476
6.3068
7.2764
8.0701
8.7426
9.5074
10.1852
10.7260
11.2891
rBS
3.8131
5.1263
6.2358
7.1715
7.9886
8.6806
9.4120
10.0788
10.5986
11.2402
rLPD1.5
3.8680
5.2165
6.3072
7.1962
8.0452
8.7528
9.6097
9.9916
10.7454
11.2152
tLPD1.5
0.202
1.167
1.233
3.790
7.917
11.417
16.167
35.068
34.843
42.576
rGPD
3.8130
5.1223
6.1984
7.1245
7.9541
8.6564
9.4222
9.9916
10.5937
11.1972
tGPD
43
336
669
1142
1788
2738
3874
5292
7134
9006
Table 1: Results of identical circular circle packing problem.
Then we test our algorithm for packing nonidentical circles in a circular container on
several benchmark instance sets. We achieve better results than the best known ones
for some instances and display these values in bold type. All the results are available
on our website [3].
Table 2 records the results on the benchmark instances proposed by Huang et al., which
are available on the website [4]. Column r∗ reports the best known results obtained
by Akeb et al. [7]. Column rA1.5 indicates the container radii reported by Huang et
al. [30]. Firstly, we take the configurations obtained by Huang et al. as initializations
and apply LPD1.5 on them. Result radii of the container and running time are given in
column rLPD1.5 and tLPD1.5 respectively. We achieve smaller radii because the results
obtained by A1.5 are not the exact local minima, thus possessing the potential to be
driven to the nearby local minima by our optimization scheme. Afterwards we perform
the algorithm LPD2.0 using A1.5 on the configurations and further improve the results,
as shown in column rLPD2.0 and tLPD2.0 . We demonstrate the configuration of instance
NR60-1 in Figure 10 for the illustrative purpose.
Instance
NR26-1
NR40-1
NR50-1
NR60-1
n
26
40
50
60
r∗
246.4179
355.6587
378.0044
519.8494
rA1.5
246.75
357.00
380.00
522.93
rLPD1.5
246.1653
356.8379
379.7894
522.7590
tLPD1.5
2.30
4.39
7.21
11.28
rLPD2.0
246.1653
355.0152
377.8497
518.9965
Table 2: Results of the instances from Huang et al. [30].
16
tLPD2.0
4781
159736
230968
141789
(a)
(b)
Figure 10: The configurations for the instance NR60-1 with n = 60 in Table 2. (a) is
the result reported by Huang et al. [30] with r = 522.93; (b) is the result achieved by
our algorithm LPD2.0 with r = 519.8418.
The second set we used consists of the six problems proposed by Stoyan and Yaskov [42]
(data available on the website [5]). We list the results and performance information of
our algorithms in Table 3.
Firstly, we perform the algorithm LPD2.0 using A1.0 on the instance set and list the results in Table 3 (I). We start from the radii reported for A1.0 [30], as shown in column
rA1.0 and observe that in a few interleaving iterations of algorithm A1.0 and LPD1.5,
smaller radii are obtained, as shown in column rLPD2.0(A1.0) . The accumulated running
time is recorded in column tLPD2.0(A1.0) , from which we can see that when the number
of circles is large, A1.0 costs most of the running time, see instances SY5 and SY6.
Column #A1.0 indicates the times of successfully running A1.0.
We also perform the algorithm LPD2.0 using A1.5 on the instance set and list the results in Table 3 (II). We start from the radii reported for A1.5 [30] as shown in column
rA1.5 . Column rLPD2.0(A1.5) and tLPD2.0(A1.5) display the results and the accumulated
running time respectively. We can see that the results come by dichotomous search on
A1.5 still have potential to be improved under our optimization scheme, although the
interleaving process of LPD1.5 and A1.5 is very expensive, and most time is expended
on A1.5 refer to column time on A1.5. Column #A1.5 indicates the times of successfully running A1.5.
Last, we show our results in Table 3 (II) to the global algorithm GPD and report the
results in Table 3 (III). Column rGPD and tGPD give the radii and time gained by GPD.
We also show the density which is the ratio of total area of the circles to the area of the
∗ and t ∗ indicate the best results and the
container in column density(%). Column rBS
BS
related running time obtained by adaptive beam search algorithms [7], which are also
the best known results to date. (Note that their time data are recorded on a 1.6 GHz
computer.) We improve their results in 3 out of 6 instances.
The third benchmark instance set we used is proposed by Castilloa et al. [14]. The size
of the circles is defined by ri = i−1/2 , i = 1, . . . , n. We test our local and global strategy
on this set and list the results in Table 4. Column r∗ and t ∗ contain the best known
results reported in [14] and the corresponding timing. (Note that their timing data are
17
Instance
SY1
SY2
SY3
SY4
SY5
SY6
n
30
20
25
35
100
100
rA1.0
7.30
6.34
6.45
9.16
13.20
14.95
rLPD2.0(A1.0)
7.2754
6.3154
6.4562
9.1141
13.1553
14.9341
tLPD2.0(A1.0)
20.49
6.84
15.03
67
17713
8316
time on A1.0
2.60
0.44
2.76
39
17040
8200
#A1.0
2
2
3
5
9
2
tLPD2.0(A1.5)
2630
453
2325
7882
108562
366515
time on A1.5
2616
451
2319
7877
107830
365634
#A1.5
2
1
2
1
12
14
(I)
Instance
SY1
SY2
SY3
SY4
SY5
SY6
n
30
20
25
35
100
100
rA1.5
7.21
6.27
6.42
9.05
13.17
14.94
rLPD2.0(A1.5)
7.1954
6.2707
6.4054
9.0442
13.0830
14.8364
(II)
Instance
SY1
SY2
SY3
SY4
SY5
SY6
n
30
20
25
35
100
100
∗
rBS
7.1947
6.2542
6.3973
9.0406
13.0687
14.8394
∗
tBS
259200
151300
220140
137090
98700
172000
rGPD
7.1946
6.2662
6.4052
9.0311
13.0830
14.8364
tGPD
1309
405
1169
1309
10629
10437
density(%)
85.00
83.79
85.42
85.46
87.26
86.97
(III)
Table 3: Results of the instances from Stoyan and Yaskov [42].
18
recorded on a 2.00 GHz computer.) Column rLPD2.0 gives the results from algorithm
LPD2.0 using A1.5 and the total timing is shown in column tLPD2.0 . We can see that it
achieves better results than the known ones for the instances with n ≥ 12. Our global
optimization framework generally improves the results further, see column rGPD and
tGPD . The result of n = 20 is illustrated in Figure 11.
n
5
6
7
8
9
10
12
14
16
18
20
25
30
35
r∗
1.7516
1.8101
1.8387
1.8613
1.8900
1.9244
1.9696
2.0173
2.0464
2.0664
2.1050
2.1642
2.2008
2.2259
t∗
3
6
10
16
19
48
35
30
140
243
166
265
825
1312
rLPD2.0
1.7516
1.8178
1.8692
1.8692
1.9073
1.9256
1.9519
1.9817
2.0075
2.0455
2.0765
2.1047
2.1448
2.2056
tLPD2.0
0.05
0.10
0.20
0.71
0.98
1.46
7
43
95
13
30
3903
38159
188
rGPD
1.7516
1.8101
1.8387
1.8584
1.8788
1.9186
1.9519
1.9817
2.0075
2.0452
2.0568
2.1047
2.1448
2.1798
tGPD
27
337
113
87
73
390
126
313
514
697
639
1175
1367
2425
Table 4: Results of the instances with ri = i−1/2 , i = 1, . . . , n.
(b)
(a)
Figure 11: The configurations for the instance with ri = i−1/2 , i = 1, . . . , n,n = 20. (a) is
the result reported in [14] with r = 2.1050; (b) is the result achieved by our framework
with r = 2.0568.
Some examples of circle packing in the general polygon containers are shown in Figure 12.
19
(a) n = 20
(b) n = 50
(c) n = 20
(d) n = 50
Figure 12: Examples showing circle packing in the polygon containers, where ri = i.
The packing density for (a), (b), (c) and (d) are 76.978%, 76.884%, 77.882%, 82.003%,
respectively.
20
8
Discussion
There is one disadvantage of using the power diagram in our framework. Refer to
Figure 13. Consider two circles C1 , C2 with radius r1 , r2 . Their bisector l passes
through point P that has equal power distance to C1 and C2 . Let d1 and d2 represent the
distance from P to the boundary of C1 and C2 respectively. We have
⇒
|PO1 |2 − r1 2 = |PO2 |2 − r2 2
⇒
2r1 d1 + d1 2 = 2r2 d2 + d2 2
⇒
(r1 + d1 )2 − r1 2 = (r2 + d2 )2 − r2 2
d2
2r1 + d1
= .
2r2 + d2
d1
When r1 and r2 increase to be much larger than d1 and d2 , we get
r1
d2
≈ ,
r2
d1
which means that the distance from P to the boundary of C1 and C2 is inversely proportional to r1 and r2 . This is opposite to the intuition of the circle packing problem,
and it causes low convergence in the last steps of the iteration when the two circles are
quite close to each other. However, this disadvantage of power diagram does not affect
the final result of the configuration. And its fast computing property somehow makes
up for the low convergence in practice.
l
O1
O2
P
r1
r2
c2
d1 d2
c1
Figure 13: The illustration of the power diagram for two circles.
9
Conclusion
In this paper, we introduced a new framework for solving the circle packing problem
from the geometric point of view including both local and global algorithm. The local
algorithm optimizes the objective function monotonically via simple and fast computing, meanwhile is flexible to general shape of the container due to the utilization of
power diagram. Furthermore, some existing effective heuristic methods can be embedded in our algorithm to achieve better results. The global algorithm works well in
improving the results in a reasonable time. For the future work, the packing problem
21
with arbitrary packing objects, as rectangles, ellipses, general polygons etc., has potential to be integrated in our framework. The key is how to find the proper bisector
between two mutual objects and update the location. Besides, adapting our framework
for solving the packing problem in higher dimensions is feasible.
Acknowledgement
Acknowledgments will be given in the final version.
References
References
[1] http://www.packomania.com/.
[2] http://www.recmath.org/contest/CirclePacking/index.php.
[3] http://i.cs.hku.hk/ llu/CP/CPresult.htm.
[4] http://www.laria.u-picardie.fr/ yli/InstCirCir/NRInst/.
[5] http://www.laria.u-picardie.fr/hifi/OR-Benchmark/TDL/.
[6] C GAL, Computational Geometry Algorithms Library. http://www.cgal.org.
[7] Hakim Akeb, Mhand Hifi, and Rym M’Hallah. Adaptive beam search lookahead algorithms for the circular packing problem. International Transactions in
Operational Research, pages 1–23, 2009.
[8] Hakim Akeb, Mhand Hifi, and Rym M’Hallah. A beam search algorithm for the
circular packing problem. Comput. Oper. Res., 36(5):1513–1528, 2009.
[9] F. Aurenhammer. Power diagrams: properties, algorithms and applications. SIAM
J. Comput., 16(1):78–96, 1987.
[10] Franz Aurenhammer. Voronoi diagrams - a survey of a fundamental geometric
data structure. ACM Comput. Surv., 23(3):345–405, 1991.
[11] Addis Bernardetta, Locatelli Marco, and Schoen Fabio. Disk packing in a square:
A new global optimization approach. INFORMS J. on Computing, 20(4):516–
524, 2008.
[12] Addis Bernardetta, Locatelli Marco, and Schoen Fabio. Efficiently packing unequal disks in a circle. Operations Research Letters, 36(1):37–42, 2008.
[13] E. G. Birgin and F. N. C. Sobral. Minimizing the object dimensions in circle and
sphere packing problems. Comput. Oper. Res., 35(7):2357–2375, 2008.
22
[14] Ignacio Castilloa, Frank J. Kampas, and János D. Pintér. Solving circle packing
problems by global optimization: Numerical results and industrial applications.
European Journal of Operational Research, 191(3):786–802, 2008.
[15] Danny Z. Chen, Xiaobo Hu, Yingping Huang, Yifan Li, and Jinhui Xu. Algorithms for congruent sphere packing and applications. In SCG ’01: Proceedings
of the seventeenth annual symposium on Computational geometry, pages 212–
221, New York, NY, USA, 2001. ACM.
[16] Jorge Cortes and Francesco Bullo. Nonsmooth coordination and geometric optimization via distributed dynamical systems. SIAM Review, 51(1):163–189, 2009.
[17] Qiang Du, Vance Faber, and Max Gunzburger. Centroidal voronoi tessellations:
Applications and algorithms. SIAM Review, 41(4):637–676, 1999.
[18] Robert J. Fowler, Mike Paterson, and Steven L. Tanimoto. Optimal packing and
covering in the plane are NP-complete. Inf. Process. Lett., 12(3):133–137, 1981.
[19] De fu Zhang and An sheng Deng. An effective hybrid algorithm for the problem
of packing circles into a larger containing circle. Comput. Oper. Res., 32(8):1941–
1951, 2005.
[20] John A. George, Jennifer M. George, and Bruce W. Lamar. Packing differentsized circles into a rectangular container. European Journal of Operational Research, 84(3):693–712, August 1995.
[21] R. L. Graham and B. D. Lubachevsky. Dense packings of equal disks in an equilateral triangle: From 22 to 34 and beyond. J. of Combinatorics, 2:pp. (electronic)., 1995.
[22] Andrea Grosso, Jalal Uddin Abdur Jamali, Marco Locatelli, and Fabio Schoen.
Solving the problem of packing equal and unequal circles in a circular container.
Journal of Global Optimization, 47(1):63–81, May 2010.
[23] M. Hifi and R. M’Hallah. A dynamic adaptive local search algorithm for the circular packing problem. European Journal of Operational Research, 127(3):1280–
1294, December 2007.
[24] Mhand Hifi and Rym M’Hallah. Approximate algorithms for constrained circular
cutting problems. Comput. Oper. Res., 31(5):675–694, 2004.
[25] Mhand Hifi and Rym M’Hallah. Adaptive and restarting techniques-based algorithms for circular packing problems. Comput. Optim. Appl., 39(1):17–35, 2008.
[26] Mhand Hifi and Rym M’Hallah. A literature review on circle and sphere packing
problems: Models and methodologies. Advances in Operations Research, 2009.
[27] Mhand Hifi, Vangelis Th. Paschos, and Vassilis Zissimopoulos. A simulated annealing approach for the circular cutting problem. European Journal of Operational Research, 127(2):430–448, December 2004.
[28] Wenqi Huang and Yan Kang. A heuristic quasi-physical strategy for solving disks
packing problem. Simulation Modelling Practice and Theory, 10:195–207, 2002.
23
[29] Wenqi Huang, Y Li, H Akeb, and C M Li. Greedy algorithms for packing unequal
circles into a rectangular container. Journal of the Operational Research Society,
56(5):539–548, 2005.
[30] Wenqi Huang, Yu Li, Chumin Li, and Ruchu Xu. New heuristics for packing
unequal circles into a circular container. Comput. Oper. Res., 33(8):2125–2142,
2006.
[31] Wenqi Huang and Tao Ye. Global optimization method for finding dense packings of equal circles in a circle. European Journal of Operational Research,
210(3):474 – 481, 2011.
[32] J. Kepler. Strena seu de nive sexangula. Godefridum Tampach, Francofvrti
Ad Moenum (Frankfurt), 1611. English translation: Hardy, The six-cornered
snowflake, Clarendon Pr., Oxford, 1966.
[33] Yang Liu, Wenping Wang, Bruno Lévy, Feng Sun, Dong-Ming Yan, Lin Lu, and
Chenglei Yang. On centroidal voronoi tessellation—energy smoothness and fast
computation. ACM Trans. Graph., 28(4):1–17, 2009.
[34] Stuart P. Lloyd. Least squares quantization in PCM. IEEE Transactions on Information Theory, 28(2):129–136, 1982.
[35] Andrea Lodi, Silvano Martello, and Michele Monaci. Two-dimensional packing
problems: A survey. European Journal of Operational Research, 127(2):241–
252, September 2002.
[36] Zhipeng Lü and Wenqi Huang. PERM for solving circle packing problem. Comput. Oper. Res., 35(5):1742–1755, 2008.
[37] B. D. Lubachevsky and R. L. Graham. Curved hexagonal packings of equal disks
in a circle. Discrete and Computational Geometry, 18:179–194, 1997.
[38] F.K. Miyazawa and Y. Wakabayashi. Two- and three-dimensional parametric
packing. Computers & Operations Research, 34(9):2589–2603, 9 2007.
[39] Nenad Mladenović, Frank Plastria, and Dragan Urošević. Reformulation descent
applied to circle packing problems. Comput. Oper. Res., 32(9):2419–2434, 2005.
[40] János D. Pintér and Frank J. Kampas. Global Optimization, chapter MathOptimizer Professional: Key Features and Illustrative Applications, pages 263 – 279.
Springer Netherlands, 2006.
[41] Achill Schürmann. On packing spheres into containers–about Kepler’s finite
sphere packing problem. Documenta Mathematica, pages 393–406, 2006.
[42] Y.G. Stoyan and G.N. Yaskov. Mathematical model and solution method of optimization problem of placement of rectangles and circles taking into account special constraints. International Transactions in Operational Research, 5(1):45–57,
January 1998.
24
[43] Y.G. Stoyan and G.N. Yaskov. A mathematical model and a solution method for
the problem of placing various-sized circles into a strip. European Journal of
Operational Research, 156(3):590–600, 2004.
[44] Kokichi Sugihara, Masayoshi Sawai, Hiroaki Sano, Deok-Soo Kim, and Donguk
Kim. Disk packing for the estimation of the size of a wire bundle. Japan Journal
of Industrial and Applied Mathematics, 21(3):259–278, 2004.
[45] P. G. Szabó, M. Cs. Markót, T. Csendes, E. Specht, L. G. Casado, and aa I. Garc˙
New Approaches to Circle Packing in a Square: With Program Codes (Springer
Optimization and Its Applications). Springer-Verlag New York, Inc., Secaucus,
NJ, USA, 2007.
[46] Huaiqing Wang, Wenqi Huang, Quan Zhang, and Dongming Xu. An improved
algorithm for the packing of unequal circles within a larger containing circle.
European Journal of Operational Research, 127(2):440–453, September 2002.
25
© Copyright 2026 Paperzz