Circle Packing Survey
Circle Packing Survey
https://doi.org/10.1007/s40863-022-00301-3
SPECIAL ISSUE COMMEMORATING THE GOLDEN JUBILEE OF THE INSTITUTE
OF MATHEMATICS AND STATISTICS OF THE UNIVERSITY OF SÃO PAULO
Abstract
This survey provides an introductory guide to some techniques used in the design
of approximation algorithms for circle packing problems. We address three such
packing problems, in which the circles may have different sizes. They differ on the
type of the recipient. We consider the classical bin packing and strip packing, and a
variant called knapsack packing. Our aim is to discuss some techniques and basic
algorithms to motivate the reader to investigate these and other related problems.
We also present the ideas used on more elaborated algorithms, without going into
details, and mention known results on these problems.
1 Introduction
Problems on packing of objects like circles and spheres have always attracted great
attention of mathematicians and have been investigated for many centuries.
Dedicated to the memory of Imre Simon (1943–2009), who continues to inspire us.
* Flávio K. Miyazawa
[email protected]
Yoshiko Wakabayashi
[email protected]
1
Institute of Computing, University of Campinas, Campinas, Brazil
2
Institute of Mathematics and Statistics, University of São Paulo, São Paulo, Brazil
13
Vol.:(0123456789)
586 São Paulo Journal of Mathematical Sciences (2022) 16:585–615
One of the most famous packing problems concerns a question on the densest
possible arrangement of equally sized spheres in the three-dimensional Euclid-
ean space. A solution to this problem was conjectured by Johannes Kepler [38]
in 1611, but only in 1998 Thomas Hales [31] announced to have found a proof.
Hales’s proof is based on exhaustive tests making use of complex computer cal-
culations. Several years later, in 2017, a formal proof presented by Hales et al.
[32] was published in the journal Forum of Mathematics, Pi.
The corresponding highest-density arrangement of equally sized circles on
the Euclidean plane was studied by Joseph Louis Lagrange (in 1773) and also
by Carl Friedrich Gauß (in 1831) and proofs were presented by Axel Thue [52]
(in 1910) and László Fejes-Tóth [20] (in 1940) that the hexagonal lattice is the
asymptotically
√ densest of all possible circle packings (yielding a density close to
𝜋∕ 12 ≈ 0.9069). For results on packing of identical circles, we refer the reader
to [3, 5, 19, 26, 28, 51].
While these highest-density arrangement/packing problems were object of
study of mathematicians since many centuries ago, more recently, other types
of packing problems have been considered in the literature. Since 1970, they
have attracted more attention of computer scientists, interested both in theoreti-
cal issues concerning their computational complexity, as well as more practical
issues concerning the design of algorithms to solve them.
Most classical packing problems are NP-hard, in particular, the problems we
shall focus here. Such negative results lead naturally to question whether it is pos-
sible to obtain efficient algorithms for these problems that provide solutions that
are reasonably close to the optimal ones.
Of course, to answer this question appropriately, we have to define formally
what we mean by “efficient” algorithms and “reasonably close” solutions.
Roughly speaking, we can say that the answer is yes for many packing prob-
lems. In fact, the algorithms we shall consider here—called approximation algo-
rithms—are of this nature. They are required to be polynomial (in the size of the
instance) and must provide a solution with the guarantee that its value is within
some factor of the optimum value, for any instance of the problem. Moreover,
such a guarantee has to be shown with formal proofs, and should not be based on
experimental results.
The concept of approximation algorithms will be defined formally in the next
subsection. For the moment, we want to mention that for some NP-hard problems no
approximation algorithm exists, and for others, they may exist, but with not so good
approximation factor.
Approximation algorithms for NP-hard problems were investigated even before
the proof of the existence of NP-complete problems [16, 29], and Garey, Graham,
and Ullman [27], as well as Johnson [37], formalized the concept of approxima-
tion algorithms. Johnson’s PhD thesis [36] on approximation algorithms for the bin
packing problem contains beautiful and ingenious ideas to analyse relatively sim-
ple algorithms that were proposed for the one-dimensional case. These pioneering
works opened up an area of research that has become very central in the design of
algorithms. For surveys on approximation algorithms for packing problems, see [7,
9, 10, 43].
13
São Paulo Journal of Mathematical Sciences (2022) 16:585–615 587
Given a real-valued function f defined on a discrete set S, we denote by f(S) the value
∑
i∈S f (i). The diameter of a geometric object X, denoted by diam(X), is the largest
distance between any two points of the object. Given two objects X and Y, we say
that X is small compared to Y if diam(X) = O(𝜀)diam(Y) for a small constant 𝜀 > 0.
Throughout this text, an input set of circles is given by a list of indices
L = {1, … , n}, where each i ∈ L corresponds to a circle with radius ri and area ai .
For a subset S ⊆ L , the area of S, denoted by Area (S), is the sum of the areas of
the elements in S. We also denote by Area (𝜌) the area of a circle of radius 𝜌 . The
recipients, called bins, are usually unit squares or rectangular strips of width 1.
Without loss of generality, we consider that ri ≤ 1∕2.
A packing of a set of circles L into a two-dimensional (2D) bin B is a function
that maps the center of each circle i ∈ L into the region that defines B, satisfying the
following properties: each packed circle must be totally contained within the region
of B, and the inner region of any two distinct packed circles may not intersect.
The problems to be addressed here can be formally defined as follows:
Circle bin packing ( CBP ): Given a list C of circles, find a packing of C into a
minimum number of unit square bins.
Circle strip packing ( CSP ): Given a list C of circles, find a packing of C into a
rectangular strip of width 1 so as to minimize the height of the rectangular area
that contains the packed circles.
Circle knapsack ( CK ): Given a list C of circles and values vi > 0 for each
i ∈ C , find a subset S ⊆ C and a packing of S into a unit square bin such that v(S)
is maximized.
Sometimes, we will use bins of different sizes. In this case, if a bin has width w
and height h, we denote an instance for the CBP and CK problems by a tuple
(L, w, h); and if the strip has width w, we denote by (L, w) an instance of the CSP
problem. In any case, we consider that w and h are constants.
13
588 São Paulo Journal of Mathematical Sciences (2022) 16:585–615
13
São Paulo Journal of Mathematical Sciences (2022) 16:585–615 589
clear whether every instance, with bins and items given by rational numbers, always
has an optimal solution with center coordinates that are also rational numbers. To
deal with this problem, we may consider augmented bins (of a very small factor), and
now, any packing (with possible irrational coordinates) can be rearranged to one using
rational positions in an augmented bin. Although the algorithms use augmented bins,
we compare the obtained solutions with the value of optimum packings using unit bins.
As in the CSP and SSP problems we are concerned with packings into one bin of
unlimited height, and we want to minimize the height of the packing, there is no need
to consider an augmented bin.
Many algorithms for packing problems subdivide the input list into sublists and gen-
erate specific packings for each sublist, and finally concatenate these packings to obtain
a final packing of the input list. Given two packings P1 and P2 for a packing problem
𝛱 , we denote by P1 ‖P2 the concatenation of these two packings. For the CBP prob-
lem, the concatenation is a union of the packed bins of the two packings, and for the
CSP problem the packing P1 ‖P2 is a packing containing packings P1 and P2 within the
same rectangular strip, but with P2 starting at the top of P1.
When we design approximation algorithms, it is important to consider how we can
compare, for each instance I, the value of a solution returned by the algorithm with the
value of an optimal solution. For that, we may use some argument (based on a perfect
packing, even if it is not feasible), or we may exhibit another structure (a feasible solu-
tion) that can be computed efficiently, whose objective value is a bound for the value of
an optimal solution.
An example of a simple argument, in the two-dimensional case, is one based on the
area of the items in the input list. As we are considering bins where the bounded edge
size is equal to 1, the following lemma is straightforward, and will be useful in the
forthcoming analyses of some area-based algorithms.
Lemma 1 Let 𝛱 be one of the problems CSP or CBP. Then, for any instance I for
the problem 𝛱 , we have Area (I) ≤ OPT𝛱 (I).
13
590 São Paulo Journal of Mathematical Sciences (2022) 16:585–615
3.1 Area‑based algorithms
As we mentioned, the area of the objects in the input list is a lower bound for an
optimum value. Thus, it is natural to consider algorithms that can take advantage
of this fact, guaranteeing a minimum area occupation in each bin, except perhaps
for a few of them.
A straightforward idea for this problem is to round circles to shapes for which
known packing algorithms exist. For example, in the literature we find many
algorithms to pack squares; thus one possible idea is to inscribe each circle in a
square and use these algorithms to obtain packing for circles. This can be done
in the d-dimensional case, if algorithms for d-dimensional cubes are available.
Given an algorithm A for a d-dimensional cube packing problem, we denote by
A◦ the corresponding algorithm that encloses each d-dimensional sphere into a
d-dimensional cube and uses the packing algorithm A to solve the problem.
We exemplify this idea in the 2-dimensional case. For that, let us consider a
well-known packing algorithm called NFDH (Next Fit Decreasing Height) [11,
47], designed for the rectangular strip and bin packing problems. To pack squares,
this algorithm works as follows: it packs the input items following a non-increas-
ing order of their sizes. The items are packed over shelves (of zero thickness) side
by side from left to right, starting at the bottom of the bin. As items are sorted
in non-increasing order of their sizes, the height of each shelf is defined by the
first item it receives. When an item cannot be packed into a shelf, it creates a new
shelf over the previous shelf, before placing that item. For the rectangular bin
packing version, if a shelf cannot be created in the current bin, then it is created
in the bottom of a new bin (see Fig. 1).
13
São Paulo Journal of Mathematical Sciences (2022) 16:585–615 591
Modifying the previous algorithm, by changing the idea of “Next Fit” to “First
Fit”, we obtain an algorithm called FFDH (First Fit Decreasing Height). This
algorithm first tries to pack the current item in the end of the first existing shelf
with room to accommodate it; and, if necessary, creates a new shelf (with the
same height of the item) at the top of the current packing. The description of
these algorithms are for the strip packing problem, but can be converted to the bin
packing problem using a one-dimensional packing algorithm to pack shelves into
bins. In particular, the algorithm called HFF (Hybrid First Fit) uses FFDH to gen-
erate shelves and uses again a first fit approach to pack shelves into two dimen-
sional bins. All these algorithms are offline and were designed for the d-dimen-
sional case; for more details, see [8].
When the items to be packed are squares, each one with side length at most 1/m,
for an integer m ≥ 1, it is known that HFF guarantees an area occupation factor in
each bin of at least ( m+1
m 2
) , except perhaps for the last bin. As the process of inscrib-
ing circles in squares increases the area by a factor of 4∕𝜋 ≈ 1.274, the following
result holds.
For the general case of CBP problem, that is, when m = 1, the above result com-
bined with Lemma 1 gives us that HFF◦ has an asymptotic approximation factor that
is at most 4 ⋅ 1.274 ≈ 5.093.
Proposition 1 For any list L of circles for the CBP problem, we have that
HFF◦ (L) ≤ 5.093 OPTCBP (L) + 1.
Recently, Fekete et al. [24] showed an algorithm called Split Packing, which we
denote here by ASP , that packs any set of circles into a square bin if its total area is at
13
592 São Paulo Journal of Mathematical Sciences (2022) 16:585–615
most a factor of 𝛾 = 0.5390 … of the square bin. This factor is tight and best possi-
ble, and is called critical density [24]. Using ASP , we can design a simple algorithm
for the CBP problem that has an asymptotic approximation factor at most 2∕𝛾 . Let
us call it, ASP . It proceed as follows:
CBP
Sort the items in L in decreasing order of their sizes. Partition the input list L
into sublists L1 , L2 , …, obtained by inserting each circle c ∈ L in the first list Li if
Area (Li ) + Area (c) is at most 𝛾 . If there is no such list, insert c in a new empty list Li+1.
Clearly, at the end of this procedure, we have that each list Li has only one circle
or its total area is at most 𝛾 . Moreover, each sublist has total area at least 𝛾∕2, except
perhaps the last one. If a sublist has only one circle, we can pack it in the center of
the bin, while if the total area is at most 𝛾 , we can use ASP.
Denote by N the number of bins used by ASP . Consider N ≥ 2, otherwise the
CBP
result is immediate. Since each bin, except perhaps the last one, has an area occupa-
tion of at least 𝛾∕2, we have Area (L) ≥ (N − 1) 𝛾2 , and therefore,
CBP 2
ASP (L) ≤ Area (L) + 1 ≤ 3.7105 OPTCBP (L) + 1.
𝛾
If we only consider packing arguments based on the straighforward use of area, we
cannot expect a better factor. Suppose all circles in the input list have radius 𝜌2 + 𝜀,
where 𝜀 > 0 is a small value and 𝜌2 = 1√ . The value of 𝜌2 is the largest radius of
2+ 2
two equal circles that can be packed in a unit square bin. The area of each circle of
radius 𝜌2 + 𝜀 can be made as close to 𝛾∕2 as desired, using a sufficiently small value
of 𝜀.
In general, for small circles we can obtain better area occupation. For example,
using the algorithm stated in Lemma 2, the area occupation in each bin tends to
𝜋∕4 ≈ 0.7854 (and for very small equally sized √circles we can produce hexagonal
packings with area occupation that tends to 𝜋∕ 12 ≈ 0.9069 as their sizes become
smaller). These ideas would lead to better approximation algorithms when circles
become smaller. But using only area occupation argument, it is not possible to have
an analysis that will lead to asymptotic approximation schemes, as we may have
input lists with small circles of the same size and the hexagonal packing is the best
one can do. To obtain better approximation algorithms, there is a need to analyse
more closely the structure of optimum packings.
Before presenting the APTAS for the circle bin packing problem, we √ present a
way to pack small circles guaranteeing an area occupation close to 𝜋∕ 12 (the
maximum possible circle density, as the circles become smaller). Note that, as the
squares become smaller, the NFDH algorithm, mentioned in Sect. 3.1, obtains an
area occupation that approaches 1. On the other hand, if we inscribe each circle in
a square, we cannot guarantee the mentioned area occupation anymore. A possibil-
ity would be to subdivide the input list of small circles into sublists with similar
radii and obtain a hexagonal packing shape for each sublist. However, we may not
13
São Paulo Journal of Mathematical Sciences (2022) 16:585–615 593
subdivide the input list in too many sublists, as this would increase the additive term
𝛽 , that appears in the inequality of the asymptotic approximation bound, to a non-
constant value.
To tackle this problem, Hokama et al. [34] presented an algorithm that combines
the subdivision of the input list with the subdivisions of the bins. Their idea is to
consider a recursive subdivision of hexagonal or trapezoidal (half hexagons) bins
into smaller sub-bins of hexagonal or trapezoidal shapes, as in Figs. 2b and 2c. In
this subdivision, a hexagon of side length 𝓁 can be partitioned into six smaller hexa-
gons of side length 𝓁∕3 and other six trapezoids, each one with three sides of length
𝓁∕3 and one side with length 2𝓁∕3. The idea is to subdivide the small circles into
K types based on their radii and pack them into hexagonal bins of the same type.
For each type, the first hexagonal bins are obtained by the hexagonal tiling of a unit
square bin, as in Fig. 2a. Moreover, circles and bins of each type are classified by
subtypes, also based on their radii, so that a circle of one subtype is packed in a
hexagonal bin obtained by sudivisions of hexagonal or trapezoidal bins of larger
subtype. The authors show that the average area loss in each bin, given by the area
of the bins subtracted by the total area of the circles, is due to the hexagonal tiling
of the unit square bins and the packing of circles into hexagons. They prove
√ that an
area occupation in each bin can be made, asymptotically, close to 𝜋∕ 12 , as the
circles become smaller and the number of types increases.
Although larger circles lead to worse area occupation guarantee, it is easier to obtain
optimum packings for them. So, a first idea to take advantage of this fact is to sub-
divide the input list into a sublist of large circles and a sublist of small circles and
obtain a combined packing, consisting of an optimum packing for the first sublist
and a packing with good area occupation for the second sublist.
To use this idea, we may consider the problem of packing k largest equally
sized circles into a unit square, for which there is an extensive literature [33, 44,
51]. We denote by 𝜌k the largest radius for which it is possible to pack k circles
with radius 𝜌k into a unit square. Optimum configuration Ck to pack k such circles
is known for many values of k. The website maintained by Specht [50] presents
Fig. 2 Recursive subdivision of hexagonal/trapezoidal bins into smaller hexagonal or trapezoidal shapes
13
594 São Paulo Journal of Mathematical Sciences (2022) 16:585–615
references and the best known values for 𝜌k , for k up to 30 [18, 45]. Recently, val-
ues of 𝜌k , for k ∈ {31, 32, 33}, have been obtained by Markót [46]. If we denote
by Lk the circles in the input list with radii in the interval (𝜌k+1 , 𝜌k ], an algorithm
to pack Lk can be obtained by rounding up each circle of Lk to have radius 𝜌k and
then using packing configurations Ck , for each bin, except perhaps for the last bin,
which may have fewer circles.
Based on the results that tell us the optimum values of 𝜌k , we can obtain the
least area occupation if we pack k circles that belong to the list Lk . For k ≤ 8,
these values are shown in Table 1.
In Table 1, we can see that the worst area occupation is given by the (large)
circles in list L1 that has an area occupation of 0.26951, and the list L2 that has an
area occupation of at least 0.40643. For the remaining lists, the area occupation is
at least 0.53901. This is stated in the next proposition. As one can see, in general,
the area occupation becomes better for small circles.
Proposition 2 In Table 1 it is indicated the least area occupation when one packs k
circles of radius in the interval (𝜌k+1 , 𝜌k ] in a bin, when k ≤ 8. For k ≥ 4, the area
occupied by k circles in the list Lk is at least 0.53901.
13
São Paulo Journal of Mathematical Sciences (2022) 16:585–615 595
Area (L� )
|P� | ≤ 0.26951
+ 𝛽 � and
Area (L�� )
|P�� | ≤ 0.53901
+ 𝛽 �� ,
where 𝛽 ′ and 𝛽 ′′ are constants, given by the number of bins without the given area
occupation for the corresponding packings.
For the sublist L′, we can also obtain an optimum packing in polynomial time. To
see this, note that we cannot pack three circles of L′ in a same bin, as each of these
circles has radius greater than 𝜌3. So, any bin in an optimum packing of L′ has at
most two circles. Thus, we can obtain an optimum packing by finding one that maxi-
mizes the number of bins with two circles. For that, we construct a graph whose
vertices correspond to the circles, and two vertices are adjacent if the corresponding
circles can be packed in a same bin. The optimum packing can be obtained by com-
puting a matching of maximum cardinality in this graph. Each edge of the maximum
matching indicates a pair of circles that should be packed together. Therefore, for
such packing, we have
Proof Let N � = |P� | − 𝛽 � and N �� = |P�� | − 𝛽 ��. The result follows when N ′ ≤ 0 or
N ′′ ≤ 0. Therefore, consider the case when N ′ > 0 and N ′′ > 0. As OPT(L) ≥ |P� |
and OPT(L) ≥ Area (L), we have
The previous idea can be improved considering that we can obtain an almost opti-
mum packing for any set of circles with radii at least a certain constant 𝜀—one of
the ingredients of the APTAS we consider in the next section—, combined with the
fact that
√ we can obtain area occupation that approaches the density of equal circles,
of 𝜋∕ 12 , for sufficiently small circles, using the algorithm mentioned in Sect. 3.2.
13
596 São Paulo Journal of Mathematical Sciences (2022) 16:585–615
Using the same technique of the algorithm presented in Proposition 3, and the
algorithm to pack small circles, it is possible to obtain an algorithm with an asymp-
totic approximation factor that can be made as close as we want to
N � + N ��
√ ≤ 1.8055.
max{N � , 0.2695N � + 𝜋∕ 12N �� }
We have discussed two approaches: the first, based on the idea of subdividing the
input list; and the second, based on the idea of subdividing the bins. In both cases,
the analyses were based on the least area occupation and partial optimal packings of
the used bins.
In the next section, we consider an algorithm that combines ideas of sublists and
ideas of subdivision of the bins, in a more sophisticated way to obtain an APTAS.
In this section, we deal with the main ingredients used in the APTAS for the CBP
problem that is presented in [48]. One of the main ingredients is a circle packing
algorithm that, given a list of circles L, with constant number of circles of bounded
radii, decides if L can be packed into a rectangle of size w × h. This is presented in
the next section, and is used as a subroutine of the PTAS presented in the subse-
quent section.
The authors first consider the problem of packing a list of circles L = {1, … , n},
with constant number n of items to be packed into a bin of size w × h, where each
circle i has radius ri that is at least a constant 𝛿 , and 2ri ≤ min{w, h}. The authors
model this problem as a semi-algebraic quantifier elimination problem, to find real
numbers xi , yi ∈ ℝ+, for each i ∈ L , where (xi , yi ) corresponds to the position where
the center of the circle i is packed, conditioned to the following constraints:
ri ≤ yi ≤ h − ri for i ∈ L. (3)
The first constraints guarantee that two distinct circles do not overlap, and the next
two constraints guarantee that any circle is totally packed within a bin. The set of
solutions that satisfy the above system is a semi-algebraic set in the field of the real
numbers. As the number of variables and constraints are constants, the existential
problem of the above system can be solved in polynomial time by quantifier elimina-
tion algorithms [2, 30]. Since a point in a semi-algebraic set may potentially be irra-
tional, it is possible to obtain an approximate rational solution of arbitrary precision
13
São Paulo Journal of Mathematical Sciences (2022) 16:585–615 597
in polynomial time. To avoid circle intersections or that a circle stays partially out-
side the bin, the authors showed that it is possible to convert this approximate solu-
tion into a feasible packing within an augmented bin. To achieve this, the circles are
moved by a small amount, and one of the bin sizes (e.g., its height) is increased by
a small factor 𝜉 > 0. The time complexity depends polynomially on log 1∕𝜉 , and
the parameter 𝜉 can be given as part of the problem instance. We do not present
here the details on how to transform a solution with irrational coordinates to one
with rational coordinates that corresponds to a packing into an augmented bin by a
desired small factor 𝜉 > 0. These results are stated in some of the forthcoming lem-
mas and theorems on augmented bins. We refer the reader to [48] for details on how
this can be done.
Consider now that the input list L has only “large” circles (that is, ri ≥ 𝛿 > 0, for
each i ∈ L ) and the number of different radii s1 , … , sk is bounded by a constant (that
is, each circle in L has radius sj , for some j ∈ {1, … , k}).
We use the term pattern to refer to a packing of a set of circles S ⊆ L into an
(augumented) bin. For our purpose, we are interested in patterns for different set
of circles; and we consider that patterns corresponding to a same set of circles
are equal. As the circles in L are large, the maximum number of circles in a bin is
bounded by a constant, and therefore, we can enumerate all potential sets of circles
that can be packed in a bin, and consequently, obtain the patterns, in augmented bins,
with the algebraic quantifier elimination algorithm for the feasible ones. Denote by
P1 , … , PK all possible patterns, where K is constant, and by aij the number of circles
of radius si in pattern Pj . If we define an integer variable xj representing the number
of patterns Pj used in the solution and by ni the number of circles of radius si in L,
the following ILP (integer linear program) solves the problem.
K
∑
min xj (4)
j=1
K
∑
aij xj =ni for i = 1, … , k (5)
j=1
Lemma 3 Given an instance (L, w, h) for the CBP problem, and a constant 𝜉 > 0,
where L consists of circles with radii at least a constant, and the number of different
13
598 São Paulo Journal of Mathematical Sciences (2022) 16:585–615
Let us consider instances containing only large circles, i.e., circles with radius at least
a certain 𝛿 > 0. We recall that Area (𝛿) denotes the area of a circle with radius 𝛿.
To obtain almost optimum packings, the authors in [48] use the so-called linear
rounding technique, first presented by Fernandez de la Vega and Lucker [25], and
used in the development of many approximation schemes for packing problems.
They combine this technique with the previous algorithm for packing instances
with large circles and bounded number of different radii and obtain an approxima-
tion scheme for the packing of large items in augmented bins.
Let 𝜀 be a small positive constant. Before applying this technique, it is first veri-
fied if the number of circles is at most K = ⌈2∕(𝜀 Area (𝛿))⌉, in which case the algo-
rithm returns the packing obtained from the algorithm stated in Lemma 3. Other-
wise, it performs the following steps.
1. Sort L in non-increasing order of the radii of its n circles, and greedily partition L
into groups each one with Q = ⌊n𝜀 Area (𝛿)⌋ consecutive circles, except perhaps
the last group, which may have fewer circles.
2. Let L′ the list obtained from L rounding down the radii of the circles in each group
to the smallest radius in the corresponding sublist.
3. Use the algorithm from Sect. 3.4.2 to obtain an optimum packing P′ in augmented
bins for the list L′.
4. Except for the circles in the first group, denoted by L0 , it is possible to map each
circle in L ⧵ L0 to a different circle in P′, with non-smaller radius. For each circle
in P′, replace it with the mapped circle in L ⧵ L0 , removing non-mapped circles.
Denote by P′′ the obtained packing of L ⧵ L0.
5. Let P0 be a packing of L0 , obtained by packing each circle in L0 in one bin.
6. Return the packing P0 ‖P′′.
Note that the size of packing P′′ is at most OPT(L), as it was obtained from
an optimum packing for the items of L with radii rounded down. For the list L0,
note that it has at most 𝜀n Area (𝛿) bins and using the area lower bound, we have
|P0 | ≤ 𝜀n Area (𝛿) ≤ 𝜀 Area (L) ≤ 𝜀 OPT(L). Therefore, the final packing, which is
the concatenation of packings P0 and P′′, uses at most (1 + 𝜀) OPT(L) augmented
bins.
The following lemma can be derived from the previous discussion.
Lemma 4 Given an instance (L, w, h) for the CBP problem, each circle with radius
at least 𝛿 , and a constant 𝜉 > 0, there is a polynomial-time algorithm that packs L
into at most (1 + 𝜀) OPTw×h (L) bins of size w × (1 + 𝜉)h.
13
São Paulo Journal of Mathematical Sciences (2022) 16:585–615 599
The algorithm presented in the previous subsection obtains almost optimum packings
for most of the practical situations, as the constant 𝛿, that bounds the radii of large cir-
cles can be chosen arbitrarily small. On the other hand, it is difficult to pack the small
circles in the space not occupied by the large circles and also maintain the packing
close to optimum. In fact, as the separation of large and small circles are based only on
a threshold 𝛿, the size of large circles may be very close to the small ones. In this case,
the packing of the large circles may not leave sufficient unused space to accommodate
the small ones.
The key idea of the mentioned APTAS is to obtain a partition of the input list L
into a gap-structured partition, defined as follows.
Definition 1 Let I = (L, w, h) be an instance for the CBP problem. We say that L has
a gap-structured partition if it can be partitioned into sets Ht , S0 , … , Sm, and there
exists bin sizes B0 , … , Bm where B0 has size w × h, such that
Lemma 5 For any instance I = (L, w, h) for the circle bin packing problem, it holds
that L has a gap-structured partition (Ht , S0 , … , Sm ) as defined above.
1. Partition the input list L into groups G0 , G1 , … with (decreasing) radii bounded
by powers of 𝜀2 , that is, Gi = {j ∈ L ∶ 𝜀2i w ≥ 2rj ≥ 𝜀2(i+1) w} for i ≥ 0.
2. Let r = 1∕𝜀 and Hk = {𝓁 ∈ Gi ∶ i ≡ k (mod r)}, for 0 ≤ k < r.
3. Let t be an integer such that Area (Ht ) ≤ 𝜀 Area (L) and 0 ≤ t < r.
⋃t+jr−1
4. Let Sj = i=t+(j−1)r+1 Gi , for j ≥ 0.
5. Def ine bins Bj wit h size wj × hj , where w0 = w , h0 = h , and
wj = hj = 𝜀2(t+(j−1)r)+1 w , for every j ≥ 1.
To see the construction of these sets, the input list L is partitioned into groups
G0 , G1 , …, that can be organized in the following way:
Ht :
S0 : G0 , ... Gt−1 Gt
S1 : Gt+1 , Gt+2 , . . . Gr ... Gt+r−1 Gt+r
S2 : Gt+r+1 , Gt+r+2 , . . . G2r ... Gt+2r−1 Gt+2r (7)
Sj : Gt+(j−1)r+1 , Gt+jr+2 , . . . G3r ... Gt+jr−1 Gt+jr
.. .. ..
. . .
13
600 São Paulo Journal of Mathematical Sciences (2022) 16:585–615
The circles in the groups Gi ’s are grouped again according to its group index
modulo r. These are the sets Hk ’s that contain the groups in the same column.
Since there are r = 1∕𝜀 columns, at least one of the sets Ht has total area at most
𝜀 Area (L). This implies that OPT(Ht ) ≤ 𝜀 OPT(L).
After removing the set Ht , each set Sj is defined as the set of circles that
belongs to groups Gi such that t + (j − 1)r < i < t + jr . Note the gap induced by
the removal of the set Gt+jr ⊆ Ht between sets Sj and Sj+1. Therefore, the parti-
tion of L ⧵ Ht into sets S0 , … , Sm satisfies the remaining gap-structured partition
conditions.
As wj+1 (resp. hj+1) divides wj (resp. hj ), for j ≥ 1, any bin Bj can be perfectly
partitioned into bins of size Bj+1. The APTAS works as follows.
1. Let Pj be the packing of Sj using the algorithm of Sect. 3.4.3 and using bins Bj of
size wj × hj , for j ≥ 0.
2. For every j ≥ 0, do:
(a) Consider a square grid over each bin of the packing Pj , where each empty
square cell is considered a bin of size Bj+1.
(b) Pack the bins of Pj+1, into these empty square cells.
(c) If there is insufficient empty cells to pack the bins of Pj+1, iteratively sub-
divide an empty cell/bin of size Bj′, for some j′ < j , into smaller grids until
obtain a cell/bin of size Bj . If necessary, start this process with a new empty
unit bin.
3. Return the packing obtained in the previous step, concatenated with a packing
of Ht of size at most 𝜀 OPT(L), e.g. produced by Algorithm ASP (described in
Sect. 3.1).
13
São Paulo Journal of Mathematical Sciences (2022) 16:585–615 601
Bj+1 Bj+1
Bj+1 Bj+1
Bj+1
Bj+1
Sj+1
Bj+1
Sj
Bj+1
Bj+1
Bj+1 Bj+1
Bj+1 Bj+1
Fig. 3 Example of a packing of a circle of Sj , grid Gr j+1, bins Bj+1 and circles of Sj+1
Also note that although the description of the algorithm considers bins that are
not augmented, the use of augmented packings does not increase the bins by too
much, as we are always considering augmented bins by a factor of 𝜉 larger than the
original bins. Therefore, if the original bin is augmented by a factor of 𝜉 , this is also
sufficient to lead to augmented (sub-)bins obtained from small grid cells.
To show that the packing obtained is indeed almost optimum, we need to show
that there exists an almost optimum packing that follows the same algorithmic pat-
tern. To do so, we note that there are three important aspects that we have to con-
sider to obtain such an optimum packing. To this end, consider an optimum packing
P∗, and suppose the following happens with respect to this packing.
A1. The items of Ht may have been packed mixed with the other circles.
A2. Bins Bj+1 obtained from a grid over a packing of Sj may have been occupied
partially by a circle of Sj.
A3. Circles of Sj+1 may have been packed over the grid lines that define the bins Bj+1 .
13
602 São Paulo Journal of Mathematical Sciences (2022) 16:585–615
such circles are much smaller than the corresponding bins. In fact, the total area
occupied by these circles in a bin is at most a factor of 𝜀 of the corresponding bin.
On the other hand, we cannot allocate new bins by considering each set Sj indepen-
dently, as we may end up allocating too much area. To deal with this situation, the
algorithm first reserves a certain amount of new space corresponding to bins of size
B1 (a factor of O(𝜀) of the Area (L)). Instead of moving circles to the new space, the
algorithm uses a more sophisticated approach, moving set of circles to a new space,
but also considering the space freed by large circles as new free space for smaller
circles.
The APTAS result, proved in [48], can be summarized in the following theorem.
Theorem 1 Let (L, w, h) be an instance for the CBP problem, and let 𝜀 > 0 and
𝜉 > 0 be constants. There exists an asymptotic polynomial-time approximation
scheme A𝜀 for the circle bin packing problem that finds a packing of L into at most
CBP
In this section, we follow the same approach used for the circle bin packing prob-
lem. We start with a more straighforward area-based algorithm and then present an
approach that uses equal circles. At last, we discuss an APTAS based on the APTAS
for the circle bin packing problem.
4.1 Area‑based algorithms
As in the previous section, we start with a simple and natural algorithm that rounds
the given circles by circumscribed squares. Coffman et al. [11] showed that if a list L
consists of squares with side lengths at most 1/m, for an integer m ≥ 1, then NFDH
algorithm (mentioned in the previous section) for the square strip packing problem
has the following performance: NFDH(L) ≤ (1 + 1∕m) Area (L) + 1∕m.
Based on this result, a first algorithm for the circle strip packing problem is to
encapsulate each circle within a square and execute the NFDH algorithm. Since a
circle inscribed in a unit square has area 𝜋∕4, the asymptotic approximation ratio of
NFDH◦ is at most (4∕𝜋)(1 + 1∕m). Thus, for m = 1 (the general case), this algorithm
has an asymptotic factor of 2.5465.
For small circles, it is not hard to obtain a similar result with asymptotic
√ factor
that tends to 1∕𝜏 ≈ 1.1027 as the circles become smaller, where 𝜏 = 𝜋∕ 12 is the
factor of the highest-density arrangement of equally sized circles. One can use the
algorithm we discussed in the end of Sect. 3.3 to pack circles into unit bins and con-
catenate them to obtain a packing into√ a rectangular strip. This algorithm guarantees
an area occupation that tends to 𝜋∕ 12 , as the circles become smaller. This same
guarantee holds for the occupied area in the strip.
13
São Paulo Journal of Mathematical Sciences (2022) 16:585–615 603
In this subsection, we use a strategy to subdivide the input list into sublists, each
one with similar circles. The radii of the circles in a same sublist are rounded to be
all equal, and an algorithm to pack equal circles is used to obtain a packing for each
sublist. The packing for the original instance is obtained by concatenating the pack-
ings obtained for each sublist.
To this aim, we first consider the problem of packing equal circles. The packing
of congruent circles into an infinite strip has been investigated for many years. In
the seventies, Fejes-Tóth [21] raised a question about the densest packing of equal
circles into a strip, and according to Brass et al. [6] and Fejes-Tóth [17], Molnár
conjectured that the density d of a packing of unit circles in a parallel strip of width
w satisfies
(n + 1)(n + 2)𝜋 √
d≤ � � � , where n = ⌊(w − 2)∕ 3⌋.
� √ �2
2w n + 4 − w − 2 − n 3
Now let us consider the case in which the circles have different sizes. The fol-
lowing algorithm, which we denote by A𝜀, subdivide the input list into sublists with
(a) (b)
13
604 São Paulo Journal of Mathematical Sciences (2022) 16:585–615
circles of similar radii, and round up to a same value the radii of the circles in a
same sublist. Then, it applies the corresponding Algorithm E𝛿 for each sublist and
returns the concatenation of the produced packings. More formally, the steps are the
following.
As each of the newly obtained radii is at most 1 + 𝜀 of the original radii, the area of
each perturbed circle is at most a factor of 1 + 3𝜀 of the area of the original circle.
Summing up the area√occupation for each sublist, we obtain an area density that can
be made as close to 27∕𝜋 ≈ 1.654 as desired. This result can be stated as follows.
Proposition 4 Given a list L of circles for the CSP problem, there exists a polyno-
mial-time algorithm E𝜀′ such that E𝜀� (L) ≤ (1.654 + O(𝜀)) OPT(L) + O(1∕𝜀), for any
𝜀 > 0.
It is possible to apply the same idea used in Sect. 3.3, where the input list is par-
titioned into large and small circles, obtaining a (quasi-)optimum packing for the
large circles and better area guarantee for the remaining circles. This approach leads
to an algorithm with smaller approximation factor, but its straightforward applica-
tion does not lead to approximation schemes. In the next section, we consider the
APTAS presented by Miyazawa et al. [48], that is also based on the gap-structured
partition.
In this section we present the main ideas of the APTAS presented by Miyazawa
et al. [48], and based on the APTAS for the circle bin packing problem. First, we
observe that the APTAS presented for the bin packing problem can be extended to
pack circles into bins of size w × h, as long as w and h are constant values.
The APTAS for the circle strip packing problem (on the input list L), which we
denote by A𝜀 , proceed as follows: executes the APTAS A𝜀 for the circle bin pack-
CSP CBP
ing on the input list L, using bins of size 1 × 1∕𝜀, and then returns a packing that
concatenates the packed bins one on top of the other. The following result holds for
this algorithm.
Theorem 2 Given a list L of circles for the CSP problem, there exists a polynomial-
time algorithm A𝜀 that packs L into a rectangular strip of unit width and infinite
CSP
13
São Paulo Journal of Mathematical Sciences (2022) 16:585–615 605
The proof of the above inequality follows from the close relation between pack-
ings for the circle strip packing and for the bin packing version. Denote the mini-
mum number of bins of size 1 × 1∕𝜀 to pack L as OPTB (L) and the minimum height
of a packing of L into a rectangular strip of width 1 as OPTS (L).
Given an optimum packing P∗S for the strip packing problem, we can obtain a
packing for the bin packing version with bins of size 1 × 1∕𝜀, in the following way:
cut the packing P∗S with horizontal lines at height 𝓁0 , 𝓁1 , … where 𝓁i cuts the pack-
ing P∗S at height i∕𝜀, for i ≥ 0. Then, generate packings into bins of size 1 × 1∕𝜀
moving the packing of the circles totally contained between the lines 𝓁i−1 and 𝓁i
to a bin Bi , for i ≥ 1. Now consider the circles crossed by the lines 𝓁i’s. For each
line, the crossed circles ocupy a region of width 1 and height 2, as the diameter of
each circle is at most one. Therefore, we can group the circles crossed by at least
1∕(2𝜀) lines into a new bin of size 1 × 1∕𝜀. These last steps cause the use of at most
⌈2𝜀2 OPTS (L)⌉ new bins. So,
OPTS (L)
OPTB (L) ≤ + ⌈2𝜀2 OPTS (L)⌉ ≤ 𝜀(1 + 2𝜀) OPTS (L) + 1.
1∕𝜀
As the size A𝜀 (L) is basically the concatenation of the bins of size 1 × 1∕𝜀, we have
CSP
1
A𝜀 (L) = AB𝜀 (L)
CSP
𝜀
1
≤ ((1 + 𝜀) OPTB1×1∕𝜀 (L) + 2)
𝜀
1
≤ ((1 + 𝜀)(𝜀(1 + 2𝜀) OPTS (L) + 1) + 2)
𝜀
4
≤(1 + 4𝜀) OPTS (L) + .
𝜀
5 Circle knapsack
In this section, we present two algorithms for the CK problem. The first, is an algo-
rithm with approximation factor 1∕3 − 𝜀, for any 𝜀 > 0, and the second algorithm is
a PTAS for the version where the value of each circle is its own area.
Let us denote by C𝜀 the (1∕3 − 𝜀)-approximation factor algorithm for the CK prob-
CK
lem that is based on the ideas presented by Diedrich et al. [13] for the three-dimen-
sional box knapsack problem. We will describe it formally in what follows, but first
we sketch the idea behind it.
It first selects a set of circles based only on the area and value of the circles. To
this end, it uses an algorithm for the 1D Knapsack (1K ) problem. Then, the set of
selected circles are packed into at most three unit bins, and the packing in one of the
bins with largest value is returned.
13
606 São Paulo Journal of Mathematical Sciences (2022) 16:585–615
Proof Let (L, v) be the input to the CK problem, and let (L, s, v) be the input to AIK 𝜀
,
according to step 1 (of the description of Algorithm C𝜀 ). Let L′ be the set of circles
CK
obtained by AIK 𝜀
(L). Clearly, we have v(L� ) ≥ (1 − 𝜀) OPTCK (L). Let {S1 , S2 , S3 } be
the partition of L′ produced in step 3. First, we need to prove that any set Si chosen
in step 4, has only one circle or has total area at most 𝛾 = 0.5390 … (see Sect. 3.1).
Without loss of generality, suppose that Area (S1 ) ≥ Area (S2 ) ≥ Area (S3 ). Let j be
the last circle packed in S1 and y = Area (j). At the moment j was packed, the other
two sets have total volume at least x = Area (S1 − j). As the total area of the circles
is at most 1 + 𝜉 , for a constant 𝜉 , due to the augmented bin, we have 3x + y ≤ 1 + 𝜉 .
Since y ≤ x , the maximum value we have for Area (S1 ), given by x + y, is when
y = x . Therefore, Area (S1 ) ≤ 1∕2 + 𝜉 ; and thus, S1 can be packed by Algorithm ASP ,
using sufficiently small value of 𝜉 . Since the set S chosen in step 4 has the largest
value, we have v(S) ≥ (1∕3)v(L� ) ≥ (1∕3)(1 − O(𝜀)) OPTCK (L).
To show that the ratio is tight, consider an instance consisting of 4 circles: one
circle with radius 1/2 and value 1 and three equal circles with radius 0.3 and value
1∕3 + 𝜀. In step 1, it is possible to make the approximation scheme select the three
equal circles, obtaining value 1 + 3𝜀. Then, these circles are packed in separate
bins, and the algorithm returns a solution (with one of the 3 equal circles) of value
13
São Paulo Journal of Mathematical Sciences (2022) 16:585–615 607
1∕3 + 𝜀. It is immediate that the optimum solution is given by the largest circle that
has value 1. ◻
When the values of the circles are given by their area, Lintzmayer et al. [41] pre-
sented an approximation scheme for the circle knapsack problem. The algorithm
also uses (indirectly) the gap-structured partition approach used in the APTAS
for the CBP problem, presented in Sect. 3.4.4. Since this algorithm uses a similar
approach, we only mention the main ideas involved in this PTAS. The presentation
is divided in two parts. One part for the version of multiple bins and large circles,
and the second part for the main algorithm, that uses the algorithm for the first part
as a subroutine.
13
608 São Paulo Journal of Mathematical Sciences (2022) 16:585–615
this case, the model has one integer variable for each pattern; a constraint to impose
that each circle is not used more than its demand; and a constraint to impose that
the total number of patterns is bounded by f. The objective function maximizes the
total area of the chosen patterns. As this integer linear program has constant number
of variables, it can be solved in polynomial time [14, 40]. The result presented by
Lintzmayer et al. [41] can be summarized as follows.
Lemma 7 Given an instance (L, w, h, f) for the CMK problem, where each circle
i ∈ L has radius at least a constant 𝛿 > 0, there is a polynomial-time algorithm that
finds a solution (L� , P� ) into augmented bins such that Area (L� ) ≥ OPTCMK (L, w, h, f ).
As a first step, Lintzmayer et al. [41] consider that the input list has circles with total
area at least some constant factor of the bin area. To this end, we can consider that
the input list has total area at least 𝛾 = 0.539 (a factor of the unit bin), otherwise it
is possible to pack all circles in the input list into a unit bin using the Split Packing
algorithm [24], already mentioned in the Sect. 3.1. From now on, we consider that
the input list has total area at least 𝛾 , which implies that the optimum is at least 𝛾∕2.
The main idea of this algorithm also relies on the technique of gap-structured
partition, that we have mentioned to obtain the APTAS for the CBP problem. For
the latter problem, the gap-structured partition (Ht , S0 , … , Sm ), is obtained by par-
titioning the input list into groups G0 , G1 , … which are also organized into r = 1∕𝜀
columns, producing sets H0 , H1 , … , Hr−1 where Hi contains the set of circles in
the groups Gj , where j = i (mod r). The idea to organize in these many sets was to
obtain a set Ht that could be removed, so that we keep the gap-structured property
for the remaining sets, and the packing of Ht has a small impact in the final packing.
Similarly, for the CK problem, the organization in these same sets will guarantee
the existence of a set Ht that will also have small impact in an optimum solution.
More precisely, if L∗ is an optimum solution, there must exist t ∈ [0, r − 1] such that
Area (Ht ∩ L∗ ) ≤ 𝜀 OPTCK (L), as we have r = 1∕𝜀 sets Hi’s. If we know such set Ht ,
we can simply remove these circles from the input list and the remaining circles will
still lead to a quasi-optimum solution.
Unlike the CBP problem, we cannot identify the set Ht in advance, as the opti-
mum solution for an instance of the CK problem may not include all circles of the
input list. On the other hand, we can test each possible t, obtaining a solution Tt
produced from the set L ⧵ Ht . At last, the algorithm returns the best obtained solu-
tion among the sets T0 , T1 , … , Tr−1. Proceeding this way, the algorithm will produce
a quasi-optimal solution equal to or as good as the solution obtained excluding the
correct set Ht.
From now on, we assume that the correct set Ht was removed from the input list and
we are left with the sets S0 , S1 , … , Sm with the property of gap-structured partition.
The algorithm also considers bins of sizes B0 , … , Bm, for which circles in Sj are small
13
São Paulo Journal of Mathematical Sciences (2022) 16:585–615 609
compared to bins of size Bj, which are small compared to circles in Sj−1, for j ≥ 1, as
made for the APTAS for the CBP problem.
The algorithm starts with a set F0 containing one bin B of type B0, and setting its
availability as a0 = 1. The algorithm iterates for each j ≥ 0, packing circles of Sj into aj
bins of size Bj maximizing the area allocation in each iteration. For each iteration j ≥ 0,
the algorithm finds an optimum packing of Sj into the aj (augmented) bins of Fj, using
the algorithm of Sect. 5.2.1. Then, it updates the number aj+1 ≤ n of available bins for
the next iteration. To this end, the algorithm generates a grid Gr j+1 with cells of size
Bj+1 over the used bins of Fj and let Fj+1 be the grid cells that do not intersect circles of
Sj, added with the number of bins of size Bj+1 that can be made available from the pre-
vious iterations. This process stops when all non-empty sets Sj’s have been processed.
An important aspect to use gap-structured instances is the fact that after packing cir-
cles from the sets S0 , … , Sj, the remaining circles of Sj+1 , … , Sm and bins Bj+1 , … , Bm
are like sand that can be more freely alocated around the spaces between the larger
circles. Moreover, after packing circles in the set Sj, the bins from the grid Gr j+1 that are
partially covered by circles from Sj may be disregarded, as they will represent a small
fraction of the packed circles of the set Sj.
To conclude the analysis, it is also needed to show the existence of an optimum or
quasi-optimum packing respecting this type of structured packing separated into bins.
We do not need to show the existence of an optimum packing, but a quasi-optimal
packing whose value differs from the optimum by a factor of at most 𝜀. We will not
go into details, as the process is similar to the one considered to show that an optimum
packing for the CBP problem packs the selected circles of Sj into bins of size Bj, for
j ≥ 0, using a small amount of additional space. For the CK problem, this additional
space can be discarded, as it represents a small amount of space. The PTAS result can
be sumarized in the following theorem.
Theorem 4 Given an instance (L, w, h) for the CK problem, and a constant 𝜖 > 0,
there exists a polynomial-time approximation scheme A𝜀 that obtains a solution
CMK
6 Online algorithms
In this section, we present online algorithms for both the circle strip packing and the
circle bin packing problems, to give a flavour of them. These algorithms are based on
the algorithms presented in Sects. 4.1 and 4.2 .
13
610 São Paulo Journal of Mathematical Sciences (2022) 16:585–615
for the rectangular online strip packing problem, they called Next Fit Shelf with param-
eter 0 < p < 1, denoted by NFSp. This algorithm packs, if possible, a rectangle of
height h, where pk+1 < h ≤ pk, into the last level of height pk. If this is not possible, a
new empty level of height pk is created on top of the current packing, before packing
the next rectangle. For the packing of squares, the next result is valid.
Given an instance for the circle strip packing problem, we can inscribe each circle in
a square and use the algorithm NFSp. Let us call NFS◦p the resulting algorithm. Since
the area of a circle inscribed into a square is 𝜋∕4 of the square, the NFS◦p algorithm can
have an asymptotic factor that can be made as close to 8∕𝜋 ≈ 2.5465 when p → 1.
Now we show that it is possible to adapt the algorithm presented in Sect. 4.2, for the
(offline) strip packing problem, to the online case. Recall that this algorithm subdivides
the input list of circles according to their diameters: it rounds up the diameter in the
interval (1∕(1 + 𝜀)i+1 , 1∕(1 + 𝜀)i ] to 1∕(1 + 𝜀)i, for i ≥ 0. Then, the input list is par-
titioned into sublists, each one with circles of the same size and the final packing is a
concatenation of packings of equal circles. Although the above description does not
seem suited for an online algorithm, we may adapt this algorithm to the online case.
The idea is to pre-reserve sufficiently large regions to pack circles of the same size
in an online fashion within each region and booking new regions whenever a region
cannot receive more items. More precisely, the adapted algorithm packs equal cir-
cles of diameter 1∕(1 + 𝜀)i into active regions, which are bins of width 1 and height
1∕(𝜀(1 + 𝜀)i ). When a region cannot receive another circle, it is closed and a new active
region is opened for the circles of the same size. When a region becomes closed, its
area occupation is close to the best possible for circles of the same size. The active
regions may have small area occupation, but a simple calculation shows that it is pos-
sible to bound the total area of all active regions to O(1∕𝜀2 ). Moreover, the unused frac-
tion in each closed bin, due to incomplete packings at the top and bottom of each bin, is
at most O(𝜀).
Considering the worst area guarantee for the packing of regions √ of large and small
circles, it is possible to guarantee an area occupation close to√𝜋∕ 27 ≈ 0.6046. Thus,
we obtain an algorithm with asymptotic performance bound 27∕𝜋 ≈ 1.654.
Lemma 9 Given a list of circles L, there is an online algorithm A𝜀 for the CSP prob-
lem, where 𝜀 > 0, such that A𝜀 (L) ≤ (1.6538 + 𝜀) Area (L) + O(1∕𝜀2 ).
An important technique used to prove bounds for bin packing problems is the
use of a weighting function introduced by Ullman [53] and used to prove
13
São Paulo Journal of Mathematical Sciences (2022) 16:585–615 611
approximation factors for many packing algorithms [9, 10, 49]. Consider any
instance (L, B) of a bin packing problem variant, where a list of items L must be
packed into the minimum number of recipients of type B, and an algorithm A
for this same problem variant. The idea resumes to obtain a weighting function
WA ∶ L → ℝ such that
where C ≥ 0 and 𝛼 ≥ 1 are constants. When these two conditions are valid, we
conclude that A has asymptotic approximation factor 𝛼 , as we have
A(L) ≤ WA (L) + C ≤ 𝛼 OPT(L) + C.
to guarantee that each bin has an area occupation of at least 𝛾∕2 , except perhaps
the last bin. Recall that 𝛾 = 0.5390 … is the upper bound area for any list S for
which ASP is guaranteed to pack S in only one bin [24]. Let WACBP be a weighting
SP
function defined as WACBP (c) = 2
𝛾
Area (c), for any circle c. As each bin produced
SP
by the Algorithm ASP has an area occupation of at least 𝛾∕2 , except possibly for
CBP
the last bin, the weighting function guarantees a total weight of at least 1 for any
bin produced by Algorithm ASP , except possibly for the last bin. Moreover, the
CBP
maximum weight of a bin is at most 2∕𝛾 , as the total area of a bin is at most 1.
This shows that algorithm ASP has asymptotic approximation factor 2∕𝛾 ≈ 3.7105.
CBP
As an exercise, the reader can prove the bounds proved in Sect. 3.3 using appro-
priate weighting functions.
Using this technique, Hokama et al. [34] presented an algorithm that sub-
divides the input list L into M sublists, L1 , … , LM−1 , LM , for a certain constant
integer M, where Li has the circles in L with radius in (𝜌i+1 , 𝜌i ], mentioned in
Sect. 3.3, for i = 1, … , M − 1. The last sublist LM has the remaining circles. Here,
the circles in the sublist LM are called small while the circles in sublist Li , for
i = 1, … , M − 1 are called big circles of type i.
For the packing of big circles of type i, the algorithm packs i circles in each
bin, except perhaps in the last bin. To this end, the algorithm maintains one active
bin for each type of big circle, and whenever a type i circle cannot be packed in
the corresponding active type i bin, the algorithm closes this bin and packs the
circle in a newly created active type i bin. For the circles of sublist LM , it uses the
13
612 São Paulo Journal of Mathematical Sciences (2022) 16:585–615
algorithm presented in Sect. 3.2, that can be made to execute in online fashion.
The weighting function used for this algorithm, gives a weight of 1/i for each big
circle of type i. This guarantees that each closed bin for these circles has weight
at least 1, as the algorithm packs i circles of type i in each closed bin of type i.
For each small circle
√ c in sublist LM , the algorithm defines a weight that is a bit
larger than Area (c) 12∕𝜋. As the sublist LM has circles with small radius and the
algorithm
√ presented in Sect. 3.2 obtains an area occupation that becomes close to
𝜋∕ 12 as M becomes larger, it also leads to total weight of at least 1 for each closed
bin with small circles.
To obtain an upper bound of 2.4394 for the asymptotic approximation factor of this
algorithm, they used a combined integer programming and constraint programming
approach to show that any set S that is packable in one bin has total weight at most
2.4394. The above algorithm can be implemented to use at most a constant number
of active bins, in which case it is said to be a bounded online algorithm. Using similar
approach, they also showed that any algorithm using a constant number of active bins
must have an asymptotic approximation factor at least 2.2920.
Further, Lintzmayer et al. [42], using the same approach and improving the occupa-
tion ratio for a class of small circles, improved the upper bound to 2.3536.
These authors also presented online approximation algorithms for packing circles
into isosceles right triangle bins, with asymptotic approximation factor bounded by
2.5490 and a lower bound of 2.1193. They also considered a variant where the items
must be packed in an online fashion, but are allowed to be reorganized inside the bin
(but cannot leave the bin where they are packed). For this variant, they presented algo-
rithms that combine large circles of different types and use a generalized form of the
weighting method [15, 49], using two weighting functions. They obtained circle bin
packing algorithms with asymptotic approximation factors bounded by 2.311 for the
case of square bins and by 2.51 for isosceles right triangle bins.
All problems we have considered for circles have a corresponding version for the three-
dimensional case, or higher dimensions. Most of the results we have shown here can be
extended. In fact, the asymptotic approximation schemes presented by Miyazawa et al.
[48] are also valid for the d-dimensional bin and strip packing versions, for any constant
dimension d. Moreover, their work can also be generalized to other bins/items of differ-
ent shapes, like ellipses, regular polygons, or even Lp-norm spheres. Lintzmayer et al.
[42] also presented online algorithms for the problem of packing spheres into cubes,
presenting an algorithm with asymptotic approximation factor bounded by 2.5316 and
a lower bound of 2.7707 for any bounded space algorithm.
13
São Paulo Journal of Mathematical Sciences (2022) 16:585–615 613
8 Concluding remarks
Acknowledgements The authors are grateful to the referees for many valuable suggestions, references
and comments.
References
1. Baker, B.S., Schwarz, J.S.: Shelf algorithms for two-dimensional packing problems. SIAM J.
Comput. 12, 508–525 (1983)
2. Basu, S., Pollack, R., Roy, M.F.: On the combinatorial and algebraic complexity of quantifier
elimination. J. ACM 43(6), 1002–1045 (1996)
3. Baur, C., Fekete, S.: Approximation of geometric dispersion problems. Algorithmica 30, 451–
470 (2001)
4. Becker, A., Fekete, S., Keldenich, P., Morr, S., Scheffer, C.: Packing geometric objects with opti-
mal worst-case density. In: Proc. of the 35th International Symposium on Computational Geom-
etry (SoCG 2019), pp. 63:1–63:6 (2019)
5. Boll, D.W., Donovan, J., Graham, R.L., Lubachevsky, B.D.: Improving dense packings of equal
disks in a square. Electron. J. Comb. 7(R46), 9 (2000)
6. Brass, P., Moser, W., Pach, J.: Research Problems in Discrete Geometry. Springer, Berlin (2005)
7. Christensen, H.I., Khan, A., Pokutta, S., Tetali, P.: Approximation and online algorithms for
multidimensional bin packing: a survey. Comput. Sci. Rev. 24, 63–79 (2017)
8. Chung, F.R.K., Garey, M.R., Johnson, D.S.: On packing two-dimensional bins. SIAM J. Alge-
braic Discrete Methods 3, 66–76 (1982)
13
614 São Paulo Journal of Mathematical Sciences (2022) 16:585–615
9. Coffman, E.G., Jr., Garey, M.R., Johnson, D.S.: Approximation algorithms for bin packing: an
updated survey. In: Ausiello, G., Lucertini, M., Serafini, P. (eds.) Algorithms Design for Computer
System Design, pp. 49–106. Springer, New York (1984)
10. Coffman, Jr., E.G., Garey, M.R., Johnson, D.S.: Approximation algorithms for bin packing: a sur-
vey. In: Hochbaum, D. (ed.) Approximation Algorithms for NP-hard Problems, chap. 2, pp. 46–93.
PWS (1997)
11. Coffman, E.G., Jr., Garey, M.R., Johnson, D.S., Tarjan, R.E.: Performance bounds for level oriented
two-dimensional packing algorithms. SIAM J. Comput. 9, 808–826 (1980)
12. Demaine, E.D., Fekete, S.P., Lang, R.J.: Circle packing for origami design is hard. In: Proceedings
of the 5th International Conference on Origami in Science, pp. 609–626 (2010)
13. Diedrich, F., Harren, R., Jansen, K., Thöle, R., Thomas, H.: Approximation algorithms for 3d
orthogonal knapsack. J. Comput. Sci. Technol. 23(5), 749–762 (2008)
14. Eisenbrand, F.: Fast Integer Programming in Fixed Dimension. In: Di Battista, G., Zwick, U. (eds.)
Algorithms - ESA 2003. Lecture Notes in Computer Science, vol. 2832, pp. 196–207. Springer,
Berlin (2003)
15. Epstein, L.: Two-dimensional online bin packing with rotation. Theoret. Comput. Sci. 411, 2899–
2911 (2010)
16. Erdős, P.: Gráfok páros körüljárású részgráfjairól. Mat. Lapok (N.S.) 18, 283–288 (1967)
17. Fejes-Tóth, G.: New results in the theory of packing and covering. In: Gruber, P., Wills, J. (eds.)
Convexity and its Applications. Birkhäuser, Basel (1983)
18. Fejes-Tóth, G.: Packing and covering. In: Goodman, J., O’Rourke, J., Tóth, C.D. (eds.) Handbook of
Discrete and Computational Geometry, 3rd edn. CRC Press, Boca Raton (2017)
19. Fejes-Tóth, G., Kuperberg, W.: A survey of recent results in the theory of packing and covering. In:
Pach, J. (ed.) New Trends in Discrete and Computational Geometry, Algorithms and Combinatorics,
vol. 10, pp. 251–279. Springer, Berlin (1993)
20. Fejes-Tóth, L.: Über einen geometrischen Satz. Math. Z. 46, 83–85 (1940)
21. Fejes-Tóth, L.: Parasites on the stem of a plant. Am. Math. Mon. 78(5), 528–529 (1971)
22. Fekete, S., Gurunathan, V., Juneja, K., Keldenich, P., Scheffer, C.: Packing squares into a disk with
optimal worst-case density. In: Proc. of the 37th International Symposium on Computational Geom-
etry (SoCG 2021), pp. 35:1–36:16 (2021)
23. Fekete, S., Keldenich, P., Scheffer, C.: Packing disks into disks with optimal worst-case density. In:
Proc. of the 35th International Symposium on Computational Geometry (SoCG 2019), pp. 35:1–
35:19 (2019)
24. Fekete, S.P., Morr, S., Scheffer, C.: Split packing: algorithms for packing circles with optimal worst-
case density. Discrete Comput Geom 61, 562–594 (2019)
25. Fernandez de la Vega, W., Lueker, G.S.: Bin packing can be solved within 1 + 𝜖 in linear time. Com-
binatorica 1(4), 349–355 (1981)
26. Füredi, Z.: The densest packing of equal circles into a parallel strip. Discrete Comput. Geom. 6,
95–106 (1991)
27. Garey, M.R., Graham, R.L., Ullman, J.D.: Worst-case analysis of memory allocation algorithms. In:
Proc. 4th Annual ACM Symp. on the Theory of Computing, pp. 143–150 (1972)
28. Graham, R., Lubachevsky, B.: Repeated patterns of dense packings of equal disks in a square. Elec-
tron. J. Comb. 3 (1996)
29. Graham, R.L.: Bounds for certain multiprocessor anomalies. Bell Syst. Tech. J. 45, 1563–1581
(1966)
30. Grigor’ev, D.Y., Vorobjov, N.N., Jr.: Solving systems of polynomial inequalities in subexponential
time. J. Symb. Comput. 5(1–2), 37–64 (1988)
31. Hales, T.C.: A proof of the Kepler conjecture. Ann. Math. 162(3), 1065–1185 (2005)
32. Hales, T.C., Adams, M., Bauer, G., Dang, T.D., Harrison, J., Hoang, L.T., Kalisxyk, C., Magron,
V., MClaughlin, S., Nguyen, T.T., Nguyen, Q.T., Nipkow, T., Obua, S., Pleso, J., Rute, J., Solovyev,
A., Ta, T.H.A., Tran, N.T., Trieu, T.D., Urban, J., Vu, K., Zumkeller, R.: Formal Proof of the Kepler
Conjecture. Forum Math Pi 5, e2 (2017)
33. Hifi, M., M’Hallah, R.: A literature review on circle and sphere packing problem: models and meth-
odologies. Adv. Oper. Res. (2009)
34. Hokama, P., Miyazawa, F.K., Schouery, R.C.S.: A bounded space algorithm for online circle pack-
ing. Inf. Process. Lett. 116(5), 337–342 (2016)
35. Ibarra, O.H., Kim, C.E.: Fast approximation algorithms for the knapsack and sum of subset prob-
lems. J. ACM 22, 463–468 (1975)
13
São Paulo Journal of Mathematical Sciences (2022) 16:585–615 615
36. Johnson, D.S.: Near-optimal bin packing algorithms. Ph.D. thesis, MIT, Cambridge, MA (1973)
37. Johnson, D.S.: Approximation algorithms for combinatorial problems. J. Comput. Syst. Sci. 9(3),
256–278 (1974)
38. Kepler, J.: Strena Seu de Nive Sexangula (New Year’s Gift of Hexagonal Snow). Godfrey Tampach,
Frankfurt-am-Main, Germany (1611)
39. Kertész, G.: On a Problem of Parasites (in Hungarian). Master’s thesis, Eötvös University, Budapest
(1982)
40. Lenstra, H.W.: Integer programming with a fixed number of variables. Math. Oper. Res. 8(4), 538–
548 (1983)
41. Lintzmayer, C.N., Miyazawa, F.K., Xavier, E.C.: Two-dimensional knapsack for circles. In: M.A.
Bender, M. Farach-Colton, M.A. Mosteiro (eds.) Proc. of the LATIN 2018: Theoretical Informatics,
vol. LNCS 10807, pp. 741–754 (2018)
42. Lintzmayer, C.N., Miyazawa, F.K., Xavier, E.C.: Online circle and sphere packing. Theoret. Com-
put. Sci. 776, 75–94 (2019)
43. Lodi, A., Martello, S., Monaci, M.: Two-dimensional packing problems: a survey. Eur. J. Oper. Res.
141, 241–252 (2002)
44. Maranass, C.D., Floudas, C.A., Pardalos, P.M.: New results in the packing of equal circles in a
square. Discrete Math. 142(1–3), 287–293 (1995)
45. Markót, M.C.: Interval methods for verifying structural optimality of circle packing configurations
in the unit square. J. Comput. Appl. Math. 199(2), 353–357 (2007). Special Issue on Scientific
Computing, Computer Arithmetic, and Validated Numerics (SCAN 2004)
46. Markót, M.C.: Improved interval methods for solving circle packing problems in the unit square. J.
Global Optim. 81(3), 773–803 (2021)
47. Meir, A., Moser, L.: On packing of squares and cubes. J. Comb. Theory Ser. A 5, 116–127 (1968)
48. Miyazawa, F.K., Pedrosa, L.L.C., Schouery, R.C.S., Sviridenko, M., Wakabayashi, Y.: Polynomial-
time approximation schemes for circle and other packing problems. Algorithmica 76(2), 536–568
(2016)
49. Seiden, S.S.: On the online bin packing problem. J. ACM 49(5), 640–671 (2002)
50. Specht, E.: Packomania. http://www.packomania.com (2021)
51. Szabó, P.G., Markót, M.C., Csendes, T., Specht, E., Casado, L., García, I.: New Approaches to Cir-
cle Packing in a Square. Springer, Berlin (2007)
52. Thue, A.: Über die dichteste Zusammenstellung von kongruenten Kreisen in einer Ebene. Chris-
tiania [Oslo] : J. Dybwad (1910)
53. Ullman, J.D.: The performance of a memory allocation algorithm. Tech. Rep. 100, Princeton Uni-
versity (1971)
Publisher’s Note Springer Nature remains neutral with regard to jurisdictional claims in published
maps and institutional affiliations.
13