Polynomial-Time Approximation Schemes For Circle and Other Packing Problems
Polynomial-Time Approximation Schemes For Circle and Other Packing Problems
Polynomial-Time Approximation Schemes For Circle and Other Packing Problems
com/pdfstudio
1
Institute of Computing, University of Campinas, Brazil
{fkm,schouery}@ic.unicamp.br
2
Institute of Mathematics and Statistics, University of São Paulo, Brazil
arXiv:1412.4709v1 [cs.DS] 15 Dec 2014
{lehilton,yw}@ime.usp.br
3
Yahoo! Labs, New York, NY
sviri@yahoo-inc.com
Abstract
We give an asymptotic approximation scheme (APTAS) for the problem of packing a set
of circles into a minimum number of unit square bins. To obtain rational solutions, we use
augmented bins of height 1 + γ, for some arbitrarily small number γ > 0. Our algorithm is
polynomial on log 1/γ, and thus γ is part of the problem input. For the special case that γ
is constant, we give a (one dimensional) resource augmentation scheme, that is, we obtain a
packing into bins of unit width and height 1 + γ using no more than the number of bins in
an optimal packing. Additionally, we obtain an APTAS for the circle strip packing problem,
whose goal is to pack a set of circles into a strip of unit width and minimum height. These
are the first approximation and resource augmentation schemes for these problems.
Our algorithm is based on novel ideas of iteratively separating small and large items, and
may be extended to a wide range of packing problems that satisfy certain conditions. These
extensions comprise problems with different kinds of items, such as regular polygons, or with
bins of different shapes, such as circles and spheres. As an example, we obtain APTAS’s for
the problems of packing d-dimensional spheres into hypercubes under the Lp -norm.
1 Introduction
In the circle bin packing problem, we are given a list C of n circles identified by their indexes,
C = {1, . . . , n}, where circle i has radius ri ≤ 1/2, for 1 ≤ i ≤ n, and an unlimited number
of identical square bins of unit side. A packing is a non-overlapping placement of circles into
a set of bins, such that every circle is fully contained in a bin. Here, one circle i is packed
into one bin if we can associate coordinates xi , yi to its center, such that ri ≤ xi , yi ≤ 1 − ri ,
and for every other circle j with coordinates xj , yj that is packed into the same bin, we have
(xi − xj )2 + (yi − yj )2 ≥ (ri + rj )2 . The objective is to find a packing of C into a minimum
∗
This work was partially supported by CNPq (grants 303987/2010-3, 306860/2010-4, 477203/2012-4, and
477692/2012-5), FAPESP (grants 2010/20710-4, 2013/02434-8, 2013/03447-6, and 2013/21744-8), and Project
MaClinC of NUMEC at USP, Brazil.
1
PDF Studio - PDF Editor for Mac, Windows, Linux. For Evaluation. https://www.qoppa.com/pdfstudio
number of bins. In the circle strip packing problem, that is also known as circle two-dimensional
open dimension problem [22, 35], the set of circles C must be packed into a strip of unit width
and unbounded height, and the objective is to obtain a packing of minimum height.
There are several results in the literature for packing problems involving circles, that are
tackled using different methods, such as continuous and nonlinear systems, and discrete meth-
ods [8]. A large portion of the works deals with the problem of maximizing the number of circles
of a given radius in a square [33]. In the context of origami design, Demaine et al. [14] proved
that the decision problem that asks whether a set of circles can be packed into a unit square
or into an equilateral triangle is NP-hard. Therefore, the circle bin packing problem and the
circle strip packing problem are also NP-hard.
We are interested in the design of approximation algorithms for the circle bin packing and
the circle strip packing problems. As it is usual for packing problems, the measure we look for
is the asymptotic performance. Given an algorithm A, and a problem instance I, we denote
by A(I) the value of the solution produced by A, and by OPT(I) the value of an optimum
solution for I. For some α ≥ 1, we say that a polynomial-time algorithm A (for a minimization
problem) is an asymptotic α-approximation algorithm if, for every instance I, we obtain A(I) ≤
α OPT(I)+O(1). Also, a family of polynomial-time algorithms {Aε } is said to be an asymptotic
polynomial-time approximation scheme (APTAS) if, for every instance I, and fixed ε > 0,
we have Aε (I) ≤ (1 + ε) OPT(I) + O(1). If the constant term O(1) is omitted from the
definitions, that we say that A is an α-approximation algorithm, and {Aε } is a polynomial-time
approximation scheme (PTAS), respectively.
2
PDF Studio - PDF Editor for Mac, Windows, Linux. For Evaluation. https://www.qoppa.com/pdfstudio
that can be done with the aid of standard quantifier elimination algorithms from algebra.
This helped us to avoid the use of combinatorial brute-force algorithms that are based on
discretization, which would depend exponentially on log 1/γ. Second, to pack small items, we
cut the free space of previous packings into smaller sub-bins, and use the algorithm for large
items, recursively.
3
PDF Studio - PDF Editor for Mac, Windows, Linux. For Evaluation. https://www.qoppa.com/pdfstudio
For the 3-dimensional strip packing problem, whose items are boxes, Li and Cheng [27] were
the first to present an asymptotic 3.25-approximation algorithm. Their algorithm was shown
to have approximation ratio 2.67 [29], 2 + ε [23] and finally 1.69 [4]. Bansal et al. [3] showed
that there is no asymptotic approximation scheme for the rectangle bin packing problem, which
implies that there is no APTAS for the 3-dimensional strip packing problem. When the items
are cubes, the first specialized algorithm was shown to have asymptotic ratio of 2.6875 [27], and
the best result is an asymptotic approximation scheme due to Bansal et al. [4].
4
PDF Studio - PDF Editor for Mac, Windows, Linux. For Evaluation. https://www.qoppa.com/pdfstudio
We can use any algorithm for the more general quantifier elimination problem to de-
cide this formula. There are several algorithms for this problem, such as the algorithm of
Tarski-Seidenberg Theorem [34], that is not elementary recursive, or the Cylindrical Decompo-
sition Algorithm [13], that is doubly exponential in the number of variables. Since the formula
corresponding to the circle packing problem contains only one block of variables (of existential
quantifiers), we can use faster algorithms for the corresponding algebraic existential problem,
such as the algorithms of Grigor’ev and Vorobjov [18], or of Basu et al. [6]. For an extensive
list of algorithms for real algebraic geometry, see [7].
Sampling points of the solution Any of the algorithms above receiving formula (4) as input
will return “true” if, and only if, the circles in C can be packed into a bin of size w × h. When
the answer is “true”, we are also interested in a realization of such packing. The algorithms
in [18, 6] are based on critical points, that is, they also return a finite set of points that meets
every semi-algebraic connected component of the semi-algebraic set. Thus, a realization of the
packing can be obtained by choosing one of such points (that is a point that corresponds to a
connected component where all polynomials fi , 1 ≤ i ≤ s, are nonnegative).
Typically, a sample point is represented by a tuple (f (x), g0 (x), . . . , gk (x)) of k +2 univariate
polynomials with coefficients in Q, where k is the number of variables, and the value of the i-th
variable is gi (x)/g0 (x) evaluated at a real root of f (x). Since a point in a semi-algebraic set
may potentially be irrational, we use the algorithm of Grigor’ev and Vorobjov [18], for which we
have g0 (x) = 1, and thus an approximate rational solution of arbitrary precision can be readily
obtained. In particular, the theorem given in [18] implies the following result.
5
PDF Studio - PDF Editor for Mac, Windows, Linux. For Evaluation. https://www.qoppa.com/pdfstudio
Definition 2. Given an instance (C, w, h) for the circle packing problem, and a number ε ≥ 0,
we say that a set of points pi = (xi , yi ), for 1 ≤ i ≤ n, is an ε-packing of C into a rectangular
bin of size w × h, if the following hold:
We adopt the following strategy to fix intersections of an approximate bin packing: (a) first,
we shift the x-coordinate of all circles that intersect the left or right border until they are fully
contained in the bin, (b) then, we iteratively lift each circle in order of the y-coordinate by
an appropriate distance so that it does not intersect any of the circles considered in previous
iterations. First, the next lemma bounds the distance that one circle needs to be raised to avoid
intersection with lower circles in an εh-packing. Then, Lemma 2 transforms an approximate
packing into a packing with bins of augmented height.
Lemma 1. Let r1 , r2 , h, ε be positive numbers such that εh ≤ r1 + r2 ≤ h, and p1 = (x √1 , y1 ),
p2 = (x2 , y2 ) be points in R2 . If y1 ≥ y2 , dist(p1 , p2 ) ≥ r1 + r2 − εh, and p01 = (x1 , y1 + 2εh),
then dist(p01 , p2 ) ≥ r1 + r2 .
Proof. By direct calculation,
q √
dist(p01 , p2 ) = (x1 − x2 )2 + (y1 + 2εh − y2 )2
q √
= (x1 − x2 )2 + (y1 − y2 )2 + 2 2εh(y1 − y2 ) + 2εh2
q √
= dist(p1 , p2 )2 + 2 2εh(y1 − y2 ) + 2εh2
p
≥ (r + r2 − εh)2 + 2εh2
p 1
= (r1 + r2 )2 − 2εh(r1 + r2 ) + ε2 h2 + 2εh2
≥ r1 + r2 ,
Lemma 2. Given an instance (C, w, h) for the circle packing problem, and a corresponding
εh-packing of C into
√ a bin of size w × h for some ε > 0, we can find a packing of C into a bin
of size w × (1 + n 6ε)h in linear time.
Proof. For 1 ≤ i ≤ n, let pi = (xi , yi ) be the center of circle i corresponding to the εh-
packing. We start by modifying the given εh-packing to obtain a 3εh-packing into a bin of
size w × (h + 2εh), with the additional property that no circle intersects a border of such
rectangular bin. For each 1 ≤ i ≤ n, let p0i = (x0i , yi0 ) be the center of circle i in the modified
packing. The y-coordinate is defined as yi0 = yi + ε, and the x-coordinate is defined as: x0i = xi
if i does not intersect the left or right border; x0i = ri if i intersects the left border; and
x0i = w − ri if i intersects the right border (notice that i cannot intersect both the left and the
right borders, since 2ri ≤ w). Clearly, the definition of the centers guarantees that no circle
intersects any border of the augmented bin. To see that the set of points p0i is a 3εh-packing,
just note that any two circles i, j are lifted by the same distance, so by the triangle inequality
dist(p0i , p0j ) ≥ dist(pi , pj ) − 2εh ≥ ri + rj − 3εh.
Now, we transform √ the 3εh-packing
√ into a packing in a bin of width w and height
h + 2εh + (n − 1) 6εh ≤ (1 + n 6ε)h. We can assume, without loss of generality, that cir-
cles 1, . . . , n are ordered in nondecreasing order of the y-coordinate of their centers p0i . For
6
PDF Studio - PDF Editor for Mac, Windows, Linux. For Evaluation. https://www.qoppa.com/pdfstudio
√
every circle i, 1 ≤ i ≤ n, define its new center as p00i √ = (x0i , yi0 + (i − 1) 6εh). Notice that the
y-coordinate of the last circle is increased by (n − 1) 6εh, and thus no circle intersects any of
the borders. To complete the proof, we show that no two circles i and j, with 1 ≤ j < i ≤ n,
intersect:
√ √
dist(p00i , p00j ) = dist((x0i , yi0 + (i − 1) 6εh), (x0j , yj0 + (j − 1) 6εh))
√
= dist((x0i , yi0 + (i − j) 6εh), (x0j , yj0 ))
√
≥ dist((x0i , yi0 + 6εh), (x0j , yj0 )) ≥ ri + rj ,
where the last inequality follows from Lemma 1, and the fact that we had a 3εh-packing.
Definition 3. Given an instance (C, w, h) for the circle bin packing, we denote by OPTw×h (C)
the minimum number of rectangular bins of size w × h that are necessary to pack C.
We will obtain an approximation algorithm for the bin packing of large circles, that is,
assuming that the radius of each circle is greater than a given constant. In this case, we can
use an algorithm similar to that by Fernandez De La Vega and Lueker [16] to obtain a bin
packing of large circles. In this case, the maximum number of circles that fit in a bin is at
most a constant, M , so we can partition the set of circles into a small number of groups with
approximate sizes, and enumerate all patterns of groups with no more than M circles. Then, we
may apply the algorithm of Corollary 1 to list which patterns correspond to feasible packings,
and use integer programming in fixed dimension to find out how many bins of each pattern are
necessary to cover all circles.
We split the algorithm in two parts. First, Lemma 3 considers the special case where the
number of different radii is bounded by a constant, and obtain a bin packing using at most the
optimal number of bins, OPTw×h (C). Then, Theorem 1 reduces the general case to the case
of bounded number of radii, and obtain a bin packing using at most an additional ε fraction
of OPTw×h (C). In the following, we will denote the area of the circle of radius r by Area(r).
Lemma 3. Let (C, w, h) be an instance of the circle bin packing, such that w, h ∈ O(1),
min1≤i≤n ri ≥ δ, and |{r1 , . . . , rn }| ≤ K, for constants K and δ. For any given number γ > 0,
we can obtain a packing of C into at most OPTw×h (C) rectangular bins of size w × (1 + γ)h in
polynomial time.
Proof. Notice that a bin of size w × h may contain at most M = dwh/Area(δ)e circles of C.
Consider an ordering of distinctPK radii r̄1 , . . . , r̄K . We say that a vector of nonnegative inte-
gers c = (c1 , . . . , cK ) with i=1 ci ≤ M is a configuration, and, for each 1 ≤ i ≤ K, that ci is
the number of circles with radius r̄i of c. A configuration c is said to be feasible if there is a
packing into a bin of size w × h containing all circles of c.
Let ε = γ 2 /(6M 2 ), and let α = εh/4. We enumerate each of the (at most M K ) configura-
tions c, and use the algorithm of Corollary 1 to decide whether c is feasible. For each feasible
c, we also obtain an approximate packing, such that each circle of c has rational center p0 at
distance at most 2α of the center p in the packing realization. Then, for any two circles, with
centers p1 and p2 in the packing realization, and approximate rational centers p01 and p02 , we
have dist(p1 , p2 ) − dist(p01 , p02 ) ≤ 4α alpha=eps*h/(2*d)
= εh. Thus, the obtained approximate packing is an εh-
packing of circles in c. For each feasible packing, we use√Lemma 2, and obtain a packing of
the circles of c into a bin of width w and height (1 + M 6ε)h = (1 + γ)h. Let X be the set
d*alpha 7
gamma^2/((4d+2)M
^2)
PDF Studio - PDF Editor for Mac, Windows, Linux. For Evaluation. https://www.qoppa.com/pdfstudio
of feasible configurations, and let ni , for 1 ≤ i ≤ K, denote the number of circles in C with
radius r̄i . Solving the following integer program, we obtain a bin packing of size OPTw×h (C)
that contains xc bins of configuration c for each c ∈ X .
P
minimize c∈X xc
P
subject to c∈X ci xc ≥ ni , 1 ≤ i ≤ K
xc ∈ Z+ c∈X
Since this program has a constant number of variables, and bit-size O(log n), it can be solved
in O(log n) using fixed dimension integer programming [26, 15].
Now, the following theorem gives a (1 + ε)-approximation for the particular case in which
circles’ radii are greater than a constant.
Theorem 1. Let (C, w, h) be an instance of the circle bin packing, such that w, h ∈ O(1), and
min1≤i≤n ri ≥ δ, for some constant δ. For any given constant ε > 0, and number γ > 0, there
is a polynomial-time algorithm that packs C into at most (1 + ε) OPTw×h (C) rectangular bins of
size w × (1 + γ)h.
3. create an instance C 0 by changing the radius of each circle in C to the smallest radius of
its group;
We have obtained a packing P 0 of C 0 of size OPTw×h (C 0 ) into rectangular bins of size w×(1+γ)h.
Notice that, with exception of circles in the first group, every circle in C can be mapped to
a circle in C 0 of non-smaller radius, thus we can obtain a packing for C with the following
steps: pack each circle in the first group in a new bin; for every other circle, pack at the
position of the mapped circle in P 0 . Thus, we have obtained a packing of C that uses at most
OPTw×h (C 0 ) + Q ≤ OPTw×h (C) + εnArea(δ) ≤ (1 + ε) OPTw×h (C) bins.
If n ≤ K, then the number of different radii in C is at most K, otherwise, if n > K, the
number of different radii in C 0 is at most d Q
n n
e = d bεnArea(δ)c 2n
e ≤ d εnArea(δ) e = K. In either case,
using Lemma 3, we can conclude that the algorithm is polynomial.
8
PDF Studio - PDF Editor for Mac, Windows, Linux. For Evaluation. https://www.qoppa.com/pdfstudio
packing into bins of the original size; then, we consider sub-bins with a small fraction of the
original size, and solve the problem of packing the remaining groups (of “small” circles) in such
sub-bins recursively. To obtain a solution of the original problem, we place each obtained small
bin into the free space of the packing obtained for large circles.
The key idea to obtain an APTAS is that, if the size of the small bins is much smaller than
the size of large circles, then the waste of space in the packing of the large circles is proportional
to a fraction of large circles’ area. Moreover, if the size of a such small bin is also much larger
than the size of small circles, then restricting the packing of small circles to small bins does not
increase much the cost of a solution.
1. Let ε = 1/r;
2. For every integer i ≥ 0, define Gi = {j ∈ C : ε2i w ≥ 2rj > ε2(i+1) w};
3. For each 0 ≤ j < r, define Hj = {` ∈ Gi : i ≡ j (mod r)};
4. Find an integer t such that Area(Ht ) ≤ εArea(C);
5. Place each circle of Ht into its bounding box, and pack the boxes in separate bins of size
w × (1 + γ)h using NFDH strategy [28];
6. For every integer j ≥ 0, define Sj = it+jr−1
S
= t+(j−1)r+1 Gi ; (see Figure 1)
7. Define w0 = w, h0 = h, and wj = hj = ε2(t+(j−1)r)+1 w for every j ≥ 1;
8. Let F0 = ∅;
9. For every j ≥ 0:
(a) Use the algorithm of Theorem 1 to obtain a packing of circles Sj into bins of size wj ×
(1 + γ)hj . Let Pj be the set of such bins;
(b) Let Aj be a set of max{|Pj | − |Fj |, 0} new empty bins of size wj × (1 + γ)hj ;
(c) Place each bin of Pj into one distinct bin of Fj ∪ Aj ;
(d) Set Fj+1 = ∅, and Uj = ∅; (Uj is used only in the analysis)
(e) For each bin B of Fj ∪ Aj :
• Let V be the set of bins corresponding to the cells of the grid with cells of
size wj+1 × (1 + γ)hj+1 over B;
• Add to Fj+1 all bins in V that do not intersect any circle of Sj .
• Add to Uj all bins in V that intersect a circle of Sj .
(f) If all circles are packed, go to step 10.
10. Place the bins A0 , A1 , . . . into the minimum number of bins of size w × (1 + γ)h.
9
PDF Studio - PDF Editor for Mac, Windows, Linux. For Evaluation. https://www.qoppa.com/pdfstudio
Ht :
S0 : G0 , ... Gt−1 Gt
S1 : Gt+1 , Gt+2 , ... Gt+r−1 Gt+r
S2 : Gt+r+1 , Gt+r+2 , ... Gt+2r−1 Gt+2r
Sj : Gt+(j−1)r+1 , Gt+jr+2 , ... Gt+jr−1 Gt+jr
.. ..
. .
In step 2, we group the set of circles into disjoint subsets, Gi , with exponentially decreasing
radii. Then, in step 3, these groups are joined into disjoint bunches, Hi , according to the
remainder of the division of the group index by r. This induces the creation of r bunches, so in
step 4 we may find a bunch Ht whose area corresponds to a fraction of at most 1/r = ε of the
overall circles’ area. In step 5, we pack the circles of Ht using the NFDH strategy, that is, we
pack the circles Ht greedily in “shelves” and in decreasing order of radii, as in Figure 2.
In step 6, the remaining unpacked circles are joined in maximal sequences, Sj , of consecutive
groups. This leads to a partition of C into sets Ht , S0 , S1 , . . . The considered groups and sets
can be distributed over a table, as depicted in Figure 1, where each row corresponds to a
sequence Sj , and the last column corresponds to bunch Ht .
For each j, we consider the subproblem of packing the circles of Sj into bins of size wj × hj ,
as defined in step 7. This definition guarantees that the circles in Sj are large when compared
to bins of size wj × hj , and so we can use the algorithm for large circles of Theorem 1. Also,
the bins considered in the next iteration have size wj+1 × hj+1 , and are much smaller than the
circles of Sj . Finally, since the circles in Ht are considered separately, each remaining unpacked
circle (of Sj+1 , Sj+2 , . . . ) fits in a bin of size wj+1 × hj+1 .
In step 9, we solve each subproblem iteratively. In each iteration j ≥ 0, the algorithm keeps
a set Fj of free bins of size wj × (1 + γ)hj obtained from previous iterations. We obtain a
packing of circles of Sj into a set of bins Pj . Then, we place such bins into the free space of Fj ,
or into additional bins Aj , if necessary. The set of sub-bins of Fj ∪ Aj of size wj+1 × (1 + γ)hj+1
that intersect circles of Sj are included in the set of used sub-bins Uj , and the remaining free
sub-bins are saved in Fj+1 for the next iteration. The algorithm finishes when all circles are
considered, and the created bins A0 , A1 , ... are combined into bins of size w × (1 + γ)h in step 10.
We remark that the assumption that hr/w is integer is without loss of generality. If this is
not the case, then, after the first iteration of the algorithm, we could extend the height h0 of bins
We pack each circle in the corresponding bounding box, and then use the
NFDH strategy for rectangle bin packing.
Figure 2: Packing medium circles of Ht .
10
PDF Studio - PDF Editor for Mac, Windows, Linux. For Evaluation. https://www.qoppa.com/pdfstudio
in P0 to the next integer multiple of w/r. The final solution would have the property that circles
packed in the extended area are completely packed in the top cells of size w1 × h1 . Thus, one
can easily modify such a solution by moving these cells to at most d1/r |P0 |e ≤ O(ε) OPT(C) + 1
new bins of size w × h. For the sake of clarity, from now on, we assume that hr/w is integer.
4.2 Analysis
Now, we analyze the algorithm. The idea of the analysis is that the generated solution is almost
optimal, except that it is restricted in certain ways. The main strategy will be modifying
an optimal solution, so that it respects the same kind of constraints of a solution given by the
algorithm. Also, the cost increase due to these modifications will be bounded by a small fraction
of the optimal cost. In what follows, we assume that we have run Algorithm 1, giving as input
an instance for the circle bin packing (C, w, h), and parameters r ∈ Z+ , γ > 0.
First, we give some definitions that will be useful for the analysis. In each iteration, the algo-
rithm considers small sub-bins, that are obtained by creating grids of elements with size wj × hj ,
for some j ≥ 0, over the larger bins of size w × h. This notion is formalized in the following.
Next, the function Grj (B) will denote the set of elements in the grid of sub-bins of size
wj × hj over one bin B.
Definition 5. Let j ≥ 0. For a given bin B, we denote by Grj (B) the set of elements of the
grid of sub-bins of size wj × hj over B. Also, if D is a set of bins, then Grj (D) = ∪B∈D Grj (B).
We also need a definition to account the estimate number of bins of original size w × h, that
are needed to pack a set of sub-bins or circles.
Definition 6. If B is a rectangle or
P circle, then N(B) = Area(B)/(wh). Also, if D is a set of
rectangles or circles, then N(D) = B∈D N(B).
We remark that, if a set of bins D respects w × h, then bins of D can be easily combined
into bins of size w × h using almost the same area. Thus, N(D) is an estimate on the number
of bins of size w × h needed to pack D. Indeed, if there is a packing of a set of circles C into a
set of bins D that respects w × h, then there is a packing of C in dN(D)e bins of size w × h.
Our algorithm also deals with bins of size wj × (1 + γ)hj . Each of the definitions above has a
counterpart for the augmented bins. We say that a bin B of size wB × hB respects w × (1 + γ)h
if wB = wj and hB = (1 + γ)hj for some j ≥ 0. Also, we decorate with a tilde the analogous
versions of Gr and N, so G̃rj (B) represents the grid of sub-bins of size wj × (1 + γ)hj over a
bin B, and Ñ(B) = Area(B)/((1 + γ)wh).
Lemma 4. Let C ∈ Sj be a circle packed into a bin B, and let D ⊆ G̃rj+1 (B) be the subset of
bins in the grid that intersect circle C, but are not contained in C. Then Ñ(D) ≤ 16εN(C).
11
PDF Studio - PDF Editor for Mac, Windows, Linux. For Evaluation. https://www.qoppa.com/pdfstudio
Proof. Let rc be the radius of C. Each element of D has width wj+1 = ε2(t+jr)+1 w, and height
(1 + γ)hj+1 = (1 + γ)ε2(t+jr)+1 w. Also, since C ∈ Sj , we have 2rc ≥ ε2(t+jr) w. Consider the
circles C+ and C− , centered at the same point as C, and with radii r+ = rc + wj+1 + (1 + γ)hj+1
and r− = rc − wj+1 − (1 + γ)hj+1 . Notice that every element of D is contained in C+ \ C− . We
obtain
2 2
Area(D) ≤ Area(C+ ) − Area(C− ) = π(r+ − r− )
≤ (1 + 2ε + (1 + γ)2ε)2 − (1 − 2ε − (1 + γ)2ε)2 πrc2
≤ (1 + γ)16εArea(C).
12
PDF Studio - PDF Editor for Mac, Windows, Linux. For Evaluation. https://www.qoppa.com/pdfstudio
Each circle of W has diameter at most εwj . To rearrange the rectangles into
bins of size wj × wj (of Rj ), we use one side of length wj . To ensure every
circle is in a rectangle, the other side has length 3εwj (see lower circle).
Figure 3: Removing circles that intersect grid lines.
2. Let D0 = Opt ∪ R1 ;
3. For each j ≥ 1:
13
PDF Studio - PDF Editor for Mac, Windows, Linux. For Evaluation. https://www.qoppa.com/pdfstudio
We will show that D is a bin packing of C \ Ht . First, we note that the procedure is well
defined. It is enough to check that Rj has free space to pack bins of Lj . Indeed, it is not hard
to show the following claim.
Claim 1. For every j ≥ 1, Area(Lj ) = Area(Rj ) = Area(R1 ).
Proof. First, note that Area(Lj ) = Area(R1 ) for every j ≥ 1. Indeed, we have
|Grj (Opt)| = |Opt|(wh)/(wj hj ), and for each bin B in Grj (Opt), we create a set V such that
Area(V ) = 4 · 3εwj hj , so Area(Lj ) = 12ε(wh)|Opt| = Area(R1 ).
Also, note that Area(Rj+1 ) = Area(Lj ), since for each B ∈ Grj+1 (Lj ), Area(Rj+1 ) is
increased by Area(B). This is clear if steps (3(f)i) and (3(f)iii) are executed, so it is enough
to show that, if step (3(f)ii) is executed for bins B, B 0 in Grj+1 (Lj ), with φ(B) = φ(B 0 ),
then B = B 0 . By the definition in step (3(b)iii), B and B 0 must intersect the same region of a
circle in Sj . Since each such circle is contained in exactly one rectangle of Lj , it follows that,
indeed, B = B 0 . Then Area(Rj+1 ) = Area(Lj ).
Therefore Area(Rj ) = Area(R1 ) for every j ≥ 1.
Now, it will be shown that the algorithm produces a modified solution with the desired
properties.
Claim 2. At the end of iteration j ≥ 0, the following statements hold:
1. Dj is a packing of C;
2. for each ` = 0, . . . , j, there is a packing of S` into a set P`0 ⊆ Gr` (Dj ) of bins of size w` ×h` ;
3. the bins in Rj+1 ⊆ Grj+1 (Dj ) do not intersect any circle of C.
Proof. By induction on j. For j = 0, the statements are clear. So let j ≥ 1, and assume that
the statements are true for j − 1.
Statement 1: Clearly, Lj is a packing of the circles that were removed from the original
packing Dj−1 . Since r is a multiple of 3 and by Claim 1, step (3c) is well defined, and we can
place rectangles of Lj over bins of Rj . After step (3c), we have a bin packing of C, since, by
the induction hypothesis, the set Rj did not intersect any circle at the beginning of iteration j.
This shows statement 1.
Statement 2: Since, at the end of iteration, each circle of Sj that intersected a line of the
grid Grj (Dj−1 ) is completely contained in a bin of Rj ⊆ Grj (Dj ), we obtain statement 2.
Statement 3: If step (3(f)i) or step (3(f)iii) is executed, then we add a free bin to Rj+1 .
Thus, we only need to argue that, whenever step (3(f)ii) is executed, the bin φ(B) does not
intersect any circle. Let C be the circle that contains B, so that at the beginning of the
iteration, φ(B) was contained in C. Since C was moved to Lj , φ(B) does not intersect any
circle when step (3(f)ii) is executed. This completes the proof.
14
PDF Studio - PDF Editor for Mac, Windows, Linux. For Evaluation. https://www.qoppa.com/pdfstudio
In addition to requiring that each set of circles Sj be packed into bins of the grid with cells
of size wj × hj , we also require that the bins used to pack Sj+1 , Sj+2 , . . . do not intersect circles
of S1 , . . . , Sj−1 . Again, this restriction only increases the cost of a solution by a small fraction
of the optimal value, as shown by the next lemma.
Lemma 7. There is a packing of C \ Ht into a set of bins D that respects w × h with N(D) ≤
(1 + 44ε) OPTw×h (C), such that for every j ≥ 0, there is a packing of Sj into a set of bins
Pj0 ⊆ Grj (D). Moreover, if B ∈ Pj0 , then B does not intersect any circle in S` for ` < j.
Proof. We start with a solution D0 given by Lemma 6, and corresponding bin packings Pj0 for
each j. Without loss of generality, we assume that for each B ∈ Pj0 , there is a circle i ∈ Sj
packed in B, since otherwise we could simply remove B from Pj0 . We execute the following
steps:
2. For each j ≥ 1:
(a) Let V ⊆ Grj (D) be the set of circles that intersect a circle C ∈ Sj−1 , but are not
contained in C.
(b) Create a set V 0 of |V | new bins of size wj × hj , and move the circles in V to V 0
preserving the arrangement.
(c) Let Pj00 = Pj0 ∪ V 0 , and add V 0 to D.
(d) If C \ Ht = S0 ∪ · · · ∪ Sj , stop.
Clearly, the output of this procedure is a bin packing of C, and a simple induction shows
that at the end of iteration m, for every j ≤ m, set Pj00 ⊆ Grj (D) is a bin packing of Sj , and
for every B ∈ Pj0 , B does not intersect any circle in S` for ` < j. Using Lemma 5, we obtain
N(D) ≤ N(D0 ) +
P
j≥0 16εN(Sj )
≤ (1 + 28ε) OPT(C) + 16ε OPT(C)
= (1 + 44ε) OPT(C).
Lemma 8. Algorithm 1 produces a packing of C into bins of size w × (1 + γ)h using at most
(1 + O(ε)) OPTw×h (C) + 2 bins.
Proof. Let D be the packing of C obtained from Lemma 7, and let sets Pj0 , j ≥ 0, be the
packings obtained for each Sj . Notice that for each j ≥ 0, OPTwj ×hj (Sj ) ≤ |Pj0 |. Recall that
Algorithm 1 uses Theorem 1 to obtain a packing Pj of Sj with |Pj | ≤ (1 + ε) OPTwj ×hj (Sj )
bins. Therefore, |Pj | ≤ (1 + ε)|Pj0 |, and thus Ñ(Pj ) ≤ (1 + ε)N(Pj0 ).
15
PDF Studio - PDF Editor for Mac, Windows, Linux. For Evaluation. https://www.qoppa.com/pdfstudio
If |Am+1 | > 0, then we know that that Ñ(Am+1 ) + Ñ(Fm+1 ) = Ñ(Pm+1 ), so we get
m+1
X m
X
Ñ(Aj ) = Ñ(Aj ) + Ñ(Am+1 )
j=0 j=0
m
X
= Ñ(Uj ) + Ñ(Fm+1 ) + Ñ(Pm+1 ) − Ñ(Fm+1 )
j=0
m
X
0
≤ (1 + 16ε) N(Sj ) + (1 + ε)N(Pm+1 )
j=0
m
X m
X
0
= (1 + ε) N(Sj ) + N(Pm+1 ) + 15ε N(Sj )
j=0 j=0
m+1
X
≤ (1 + ε)N(D) + 15ε N(Sj ).
j=0
The first inequality comes from Lemma 4, and the second inequality comes from the fact that
0
bins in Pm+1 do not intersect circles in S1 , . . . Sm .
It follows that the total area of bins used for circles in C \ Ht is
P P
j≥0 Ñ(Aj ) ≤ (1 + ε)N(D) + 15ε j≥0 N(Sj )
≤ (1 + ε)(1 + 44ε) OPT(C) + 15ε OPT(C)
≤ (1 + 105ε) OPT(C).
For the circles in Ht , we used the NFDH algorithm to pack the bounding boxes of the circles,
thus the density of the packing in each used bin of size w × (1 + γ)h, with the exception of the
last, is at least 1/4. Since each circle occupies a fraction of π/4 of its bounding box, the total
number of bins used for Ht is bounded by
16
PDF Studio - PDF Editor for Mac, Windows, Linux. For Evaluation. https://www.qoppa.com/pdfstudio
Therefore, noticing that the sets of bins A0 , A1 , . . . respects w × (1 + γ)h, we obtain that
the total number of bins of size w × (1 + γ)h used to pack C is
Next lemma shows that running time of Algorithm 1 is polynomial if the ratio of a bin’s
dimensions is bounded by a constant.
Lemma 9. Suppose h/w = O(1). For any given constant r, and number γ > 0, the running
time of Algorithm 1 is polynomial.
Proof. Notice that in an implementation of Algorithm 1, we only run step (9) for nonempty
sets Sj . In each such iteration, we only need to account for the running time of step (9a), and
the running time to pack the bins of Pj in free space of current bins.
We consider the following equivalent and alternative procedure for step (9a):
1. scale the radius of each circle in Sj by 1/wj and obtain a set Sj0 ;
2. run algorithm of Theorem 1 with the scaled Sj0 and bins of width 1 and height
hj /wj ≤ h/w ∈ O(1), and obtain a packing Pj0 ;
Notice that for every j, the radius of the smallest circle in Sj0 is at least a constant
δ = ε2(t+jr) w/(2wj ) = ε2(t+jr) w/(2ε2(t+(j−1)r)+1 w) = ε2r−1 , thus, Theorem 1 implies that the
total running time of step (9a) is polynomial.
To pack a bin of Pj , for j ≥ 0, we need to find one element G̃rj (A0 ∪ · · · ∪ Aj−1 ) that is
not in U0 , . . . , Uj−1 , that is, we need to find a grid cell that does not intersect any circle of
S0 ∪ · · · ∪ Sj−1 . To verify whether a grid cell intersects a circle of S` , with 0 ≤ ` ≤ j − 1, it
is enough to list the elements of U` that intersect the border of the circle. There is at most a
constant number of such elements per circle, so at most O(n) elements are listed until we find
one free cell. Therefore, Algorithm 1 can be implemented in polynomial time.
Theorem 2. Let (C, w, h) be an instance of the circle bin packing. For any constant ε > 0, and
number γ > 0, we can obtain in polynomial time a packing of C into at most (1+ε) OPTw×h (C)+
2 rectangular bins of size w × (1 + γ)h.
Proof. If h/w < 1/ε2 ∈ O(1), then the theorem is immediate, so assume h/w ≥ 1/ε2 . Consider
an optimal solution Opt of bins of size w × h. We will transform this solution into a packing
of bins of size w × w/ε. First, split each bin of Opt in sub-bins of size w × w/ε. Then, remove
all circles that intersect consecutive sub-bins. The total area of removed circles is at most
|Opt|(w · 2w)bh/(w/ε)c ≤ |Opt|2whε. Finally, place the removed circles into their bounding
boxes and pack them into additional bins of size w × w/ε using the NFDH strategy. Since each
additional bin has density of at least π/16 (with exception of the last), the number of such
bins is bounded by d(16/π |Opt|2whε)/(w(w/ε))e. Therefore, we know that OPTw×w/ε (C) is
bounded by |Opt|dh/(w/ε)e + d(16/π |Opt|2whε)/(w(w/ε))e ≤ (1 + O(ε))|Opt|(h/w) ε, where
we have used h/w ≥ 1/ε2 in the inequality.
Now, we use Lemma 8 and obtain a packing of C into bins of size w × (1 + γ)w/ε of cost at
most
(1 + O(ε)) OPTw×w/ε (C) + 2 ≤ (1 + O(ε))|Opt|(h/w) ε + 2.
17
PDF Studio - PDF Editor for Mac, Windows, Linux. For Evaluation. https://www.qoppa.com/pdfstudio
By joining each group of bh/(w/ε)c bins, we obtain a packing into bins of size w × (1 + γ)h of
cost at most
(1 + O(ε))|Opt|(h/w) ε + 2
≤ (1 + O(ε))|Opt| + 2,
bh/(w/ε)c
where the inequality follows from the fact that h/w ≥ 1/ε2 , and assuming ε sufficiently small.
To complete the proof, it is enough to notice that the running time is given by Lemma 9.
Theorem 3. Let C be a set of circles. For any given constant ε > 0, we can obtain in polynomial
time a packing of C in a strip of unit width and height (1+ε)OPTS(C)+O(1/ε), where OPTS(C)
is the height of the minimum packing of C in a strip of unit width.
Theorem 4. Let (C, w, h) be an instance of the circle bin packing. For any given constant ε > 0,
we can obtain in polynomial time a packing of C into at most OPTw×h (C) rectangular bins of
size w × (1 + ε)h.
A few sources are responsible for the additional bins used in the algorithm of Theorem 2.
In Theorem 1, which was used for the packing of large circles, we spent additional bins for the
first group of Q circles. In Algorithm 1, the elements in the set of intermediate circles Ht are
packed in separate new bins. Also, we wasted the space of sub-bins that partially intersected
18
PDF Studio - PDF Editor for Mac, Windows, Linux. For Evaluation. https://www.qoppa.com/pdfstudio
large circles. In the following, we will discuss how to slightly modify our algorithm, and avoid
the use of additional bins for each case. This will be done by augmenting the bin with small
strips of height O(ε)h, thus obtaining Theorem 4.
First we consider an alternative approach for the packing of large circles of Theorem 1.
Instead of mapping large circles to small circles, we simply round down the radius of each circle,
and obtain an approximate packing.
Lemma 10. Let (C, w, h) be an instance of the circle bin packing, such that w, h ∈ O(1), and
min1≤i≤n ri ≥ δ, for some constant δ. For any given constant ε > 0, there is a polynomial-time
algorithm that packs C into at most OPTw×h (C) rectangular bins of size w × (1 + ε)h.
Proof. Let M = dwh/Area(δ)e and α = ε2 /(6M 2 ). We obtain a modified instance C 0 such that
the radius of each circle is rounded down to a number in the sequence δ, δ + α, δ + 2α, . . .
Thus, in C 0 , the number of different radii is at most a constant. We use Lemma 3, and obtain
a packing into at most OPTw×h (C 0 ) ≤ OPTw×h (C) bins of size w × (1 + ε)h. By restoring the
original radii, we get a 2α-packing of C. Finally, we use Lemma 2, and obtain a packing of C
into no more than OPTw×h (C) bins of size w × (1 + O(ε))h.
Proof of Theorem 4. First, we pack the circles of Ht into at most OPT(C) strips of height O(ε)h.
We assume, without loss of generality, that t > 0, since otherwise we could modify the algorithm
and find some t0 > 0, such that Area(Ht0 ) ≤ 2εArea(C). Since t > 0, each circle of Ht has radius
at most εh. Therefore, we can pack Ht into strips of size w × 11εh using the NFDH strategy.
Using density arguments, we obtain that the total number of strips is
Now, we only need few more changes to Algorithm 1. First, we set parameter γ = ε. Then, in
step 9a, we replace Theorem 1 by Lemma 10. Finally, in step 10, rather than packing sub-bins of
A0 , A1 , ... into bins of size w×(1+ε)h, we pack A0 , A1 , ... into bins of size w × (1 + 105ε)(1 + ε)h.
Notice that the simple first-fit greedy algorithm that packs such sub-bins in decreasing order of
height has the property that, if a new bin is created to pack a sub-bin B, then either B ∈ A0 ;
or B 6∈ A0 and every other created bin is fully used. P Therefore, it is not hard to see that the
total number of bins is bounded by max{|A0 |, d j≥0 Area(Aj )/((1 + 105ε)(1 + ε)wh)e}.
By Lemma 10, we may bound the first term as |A0 | ≤ OPT(S0 ) ≤ OPT(C). To bound the
second term, we may repeat the proof of Lemma 8, and obtain
P
j≥0 Ñ(Aj ) ≤ (1 + 105ε) OPT(C),
which implies P
j≥0 Area(Aj ) ≤ (1 + ε)(1 + 105ε)wh OPT(C).
Therefore
P
j≥0 Area(Aj )
(1 + ε)(1 + 105ε)wh OPT(C)
≤ = OPT(C).
(1 + 105ε)(1 + ε)wh (1 + 105ε)(1 + ε)wh
To complete the proof, we combine the bins used for A0 , A1 , ... with the strips used for Ht .
19
PDF Studio - PDF Editor for Mac, Windows, Linux. For Evaluation. https://www.qoppa.com/pdfstudio
6 Generalizations
In this section, we discuss possible generalizations to our algorithm that preserve the approxi-
mation ratio. We notice that, although Algorithm 1 only considers the case of circles, it can be
applied to many other packing problems. Indeed, Algorithm 1 induces a unified framework for
packing problems that satisfy certain assumptions, such as the existence of a polynomial-time
algorithm to approximately pack “large” items (in an augmented bin), and bounded wasted
volume of sub-bins that partially intersect an item.
As an illustrative example, in this section, we will consider the problem of packing d-
dimensional Lp -norm spheres1 in d-dimensional boxes, and give a high-level summary of nec-
essary changes in the algorithm. Moreover, we will discuss how our algorithm can be used for
bins of different shapes, provided that we can satisfy some conditions.
Also, let r ∈ R+ , and c ∈ Rd . The d-dimensional Lp,ω -norm sphere of radius r and centered
at c is the set of points x ∈ Rd such that ||x − c||p,ω < r. The d-dimensional L∞,ω -norm sphere
is defined analogously.
Figure 4 contains examples of the considered spheres. Notice that the assumption that
ω(i) ≥ 1, for 1 ≤ i ≤ d, ensures that each sphere of radius r fits in a box with sides of
length 2r. This is without loss of generality, since we could normalize the radii of the spheres
otherwise. Also, we will consider only the case that p ≥ 1. This restriction implies that the
spheres correspond to convex regions in the d-dimensional space (see Figures 4(a) and 4(f) for
examples when p < 1).
Now we show how to pack d-dimensional Lp,ω -norm spheres, for given d, p and ω. For that,
we need three main steps:
1. obtain an algorithm that decides whether a set of spheres can be packed in a given box,
and provides a packing within an arbitrarily small error precision;
3. and show that the wasted volume after discarding bins that partially intersect spheres is
a small factor of the spheres’ volume.
1
To comply with the majority of works in the literature, in this paper we use the term circle, rather than disk,
to refer to the interior of a region. Similarly, and for the sake of consistency with the multidimensional packing
literature, we use the term sphere, rather than ball, to refer to the interior of a solid.
20
PDF Studio - PDF Editor for Mac, Windows, Linux. For Evaluation. https://www.qoppa.com/pdfstudio
First, consider the case that p is rational, and let a and b be positive integers such that
p = a/b. Also, let v ∈ Rd+ be the box size, and ω ∈ Rd+ be the norm weight. We want to obtain
an algorithm similar to that of Corollary 1. The convexity of the spheres implies that deciding if
a set C = {1, . . . , n} of Lω,p -spheres of radii r1 , r2 , . . . , rn can be packed in a box of size v can be
encoded by the following system of inequalities, where variables x1 , x2 , . . . , xn ∈ Rd correspond
to centers of the spheres.
Pd
k=1 (ω(k)|xi (k) − xj (k)|)p ≥ (ri + rj )p for 1 ≤ i < j ≤ n, and (8)
ri ≤ xi (k) ≤ v(k) − ri for 1 ≤ i ≤ n, 1 ≤ k ≤ d. (9)
In order to transform (8)-(9) into a polynomial system, we have to deal with two problems:
avoiding the modulus operator, and dealing with non-integer exponents. Consider an expres-
sion e. We can replace |e| by a new variable z, if we add the constraints z 2 = e2 , and z ≥ 0.
Also, if e ≥ 0, we can replace ea/b by a new variable y, by adding the constraints ea = y b ,
and y ≥ 0. Therefore, we can transform (8)-(9) into a system of polynomial inequalities and
equalities by adding new variables yij and zij in Rd for every 1 ≤ i < j ≤ n, and considering
the following system.
Pd
k=1 yij (k) ≥ (ri + rj )p for 1 ≤ i < j ≤ n,
ri ≤ xi (k) ≤ v(k) − ri for 1 ≤ i ≤ n, 1 ≤ k ≤ d,
b a
yij (k) = (ω(k)zik (k)) for 1 ≤ i < j ≤ n, 1 ≤ k ≤ d,
2 2
zij (k) = (xi (k) − xj (k)) for 1 ≤ i < j ≤ n, 1 ≤ k ≤ d, and
yij (k), zij (k) ≥ 0 for 1 ≤ i < j ≤ n, 1 ≤ k ≤ d.
We can solve this system in a way similar to Corollary 1, and obtain an arrangement of
the spheres that intersect by at most a small value. Now, we modify this arrangement to
obtain a feasible packing in an augmented box, like in Lemma 1. The d-dimensional box will
be augmented only in its first dimension. Therefore, to avoid intersection of two spheres, one
of these will have the first coordinate shifted. The following lemma gives a bound on the shift
length that is necessary.
21
PDF Studio - PDF Editor for Mac, Windows, Linux. For Evaluation. https://www.qoppa.com/pdfstudio
Lemma 11. Let r1 , r2 , h, ε be positive numbers such that εh ≤ r1 + r2 ≤ h, and ε < 1, and
let x1 , x2 be points in the d-dimensional space. If x1 (1) ≥ x2 (1), ||x1 − x2 ||p,ω ≥ r1 + r2 − ε2 h,
and x01 = (x1 (1) + t, x1 (2), . . . , x1 (d)), where t = (2a ε)1/p h/ω(1), then ||x01 − x2 ||p,ω ≥ r1 + r2 .
Proof. By direct calculation,
P 1/p
d
||x01 − x2 ||p,ω = 0
k=1 (ω(k)|x1 (k) − x2 (k)|)
p
1/p
= (ω(1)|x01 (1) − x2 (1)|)p + dk=2 (ω(k)|x01 (k) − x2 (k)|)p
P
1/p
= (ω(1)|x1 (1) + t − x2 (1)|)p + dk=2 (ω(k)|x1 (k) − x2 (k)|)p
P
1/p
= (ω(1)|x1 (1) − x2 (1)| + ω(1)t)p + dk=2 (ω(k)|x1 (k) − x2 (k)|)p
P
1/p
≥ (ω(1)|x1 (1) − x2 (1)|)p + tp ω(1)p + dk=2 (ω(k)|x1 (k) − x2 (k)|)p
P
For the case p = ∞, we cannot repeat the same lifting strategy to obtain a packing in an
augmented bin. As an example, even if two spheres intersect in a small portion, it could be
necessary to raise one of them by twice the radius of the other sphere (see Figure 5). Therefore,
instead of using algebraic quantifier elimination algorithm to pack a set of spheres in a given
box, we can use an algorithm based on discretization. This has been already done, for example,
by Bansal et al. [3] for hypercubes, and the generalization is straightforward.
Now, what is missing to extend Algorithm 1 is bounding the wasted volume of grid elements
that partially intersect spheres. The following lemma bounds the distance between any two
points in a grid element of side length `. Then, we observe that the grid elements that are
wasted must intersect the border of a packed sphere.
22
PDF Studio - PDF Editor for Mac, Windows, Linux. For Evaluation. https://www.qoppa.com/pdfstudio
(x, y + r1 )
(x, y)
Lemma 12. If x and y are two points in a hyperrectangle of side length `, then
||x − y||p,ω ≤ `( dk=1 ω(k)p )1/p , and ||x − y||∞,ω ≤ `(max1≤k≤d ω(k)).
P
Now, if p = ∞, we get
Also let C be an Lp,ω -norm sphere of radius r centered at a point c, such that r ≥ t, C+ be the
Lp,ω -norm sphere of radius r + t centered at c, and C− be the interior of the Lp,ω -norm sphere
of radius r − t centered at c. If C intersects Q, but Q is not contained in C, then Q ⊆ C+ and
Q ∩ C− = ∅.
Proof. Since C ∩ Q 6= ∅, and Q 6⊆ C, there exists x ∈ Q such that ||c − x||p,ω = r. Also, consider
an arbitrary point y ∈ Q (see Figure 6). Using the triangle inequality, and Lemma 12, we have
that
||c − y||p,ω ≤ ||c − x||p,ω + ||x − y||p,ω ≤ r + t,
23
PDF Studio - PDF Editor for Mac, Windows, Linux. For Evaluation. https://www.qoppa.com/pdfstudio
z
x
y
C− C C +
Point x is at the boundary of C.√ The dashed box has side 2`, and is centered
at x. Point y is at a distance ` 2 of x, and is not contained in C− . Similarly,
z is not contained in C+ . For this configuration, every box of side ` that
intersects x must be contained in the region delimited by the dashed square.
Figure 6: Bounding the box intersection to a sphere boundary.
from where we conclude that y ∈ C+ , and hence Q ⊆ C+ . Again from the triangle inequality,
and Lemma 12, we get
From Lemma 13, one may obtain a statement similar to Lemma 4. Using arguments of
Section 4, combined with the discussion in this subsection, it is now possible to obtain an
asymptotic approximation scheme for the problem of packing Lω,p -spheres in the minimum
number of d-dimensional bins of a given size. It is straightforward to extend these results for
the strip packing problem of Lω,p -spheres, when the recipient contains an unbounded dimension,
and the objective is to minimize span of packed spheres in this dimension.
We finish this subsection by noticing that the bin packing of L∞,ω -norm spheres is, in fact,
a particular case of the general hyperrectangle bin packing problem when all hyperrectangles
are congruent.
These constraints requires that there exists a feasible arrangement of the spheres in the
d-dimensional space, and that each center is contained in the bin. Now, we will ensure that
24
PDF Studio - PDF Editor for Mac, Windows, Linux. For Evaluation. https://www.qoppa.com/pdfstudio
every point of the sphere is indeed in the bin. To do this, for each sphere i, we will consider a
mapping from the (d + 1)-dimensional space to this sphere, centered at xi , that is, the function
gi : Rd \ {0} × R → Rd defined as
a
gi (a, λ) = ri + xi .
||a||p,ω (1 + λ2 )
This maps any pair (a, λ) of the domain to a point yi = gi (a, λ) in the Lp,ω -sphere centered
at xi with radius ri , or at its boundary. Analogously, each point in the sphere, with exception
of the center, is mapped to a point of the domain. Therefore, it is enough to make sure that
every such mapped point yi is in the bin. This is done by adding the following constraints.
Notice that if ||a||p,ω = 0, then inequality (12) is trivially satisfied, since in this case we
have a(k) = 0 for every 1 ≤ k ≤ d, so yi can be set as any point of the bin to satisfy in-
equality (13). Now, conjoining all the constraints, we obtain a quantified first-order formula.
Therefore, deciding if there is a packing of C in B is equivalent to deciding the formula
Although constraints (10) and (12) contain non-polynomial terms, it is possible to obtain an
equivalent formula with only polynomial inequalities and equalities using the process discussed
before. Therefore, one can use any quantifier elimination algorithm to solve it, provided that it
supplies a realization of the points at a given precision.
Also in this case, the obtained center coordinates can be irrational, so only approximate
values may be available. To use resource augmentation, here we will scale both the recipient
and the radii of the spheres by a factor 1 + γ before solving the algebraic system. This is done
by replacing polynomial fi by polynomial fi0 = fi (x/(1 + γ)), for 1 ≤ i ≤ s, and radius ri by
ri0 = (1 + γ)ri , for 1 ≤ i ≤ n. After obtaining an approximate packing, we scale back the radii of
the spheres to their original values. The precision of the obtained packing is adjusted according
to parameter γ, so that intersection is avoided.
Notice that after the first iteration of the packing algorithm, the remaining space of the bin
will be partitioned into a grid of boxes. Therefore, the volume of the boxes that intersect the
boundary of the bin will be lost. This is not a problem because we use a fine-grained grid, for
which the wasted volume will be bounded by a small fraction of the bin volume.
7 Final Remarks
We presented the first approximation algorithms for the circle bin packing problem using aug-
mented bins, and the circle strip packing problem. We obtained asymptotic approximation
schemes for circle packings exploring novel ideas, such as iteratively distinguishing large and
small items, and carefully using the free space left after packing large items. We believe that our
algorithm can lead to further results for related problems, and we have already presented some
possible generalizations. Also, our use of algebraic quantifier elimination algorithms exemplifies
how results from algebra can be successfully used in the context of optimization. Using these
algorithms helped us to avoid discretization algorithms, whose running time would depend ex-
ponentially on the size of resource augmentation parameter, log 1/γ, and allowed the packing
of more general items, in a simple and concise manner.
25
PDF Studio - PDF Editor for Mac, Windows, Linux. For Evaluation. https://www.qoppa.com/pdfstudio
We highlight that our algorithm is not restricted to circles, and indeed it can be seen as
a unified framework to different packing problems. These problems need to satisfy certain
conditions, such as requiring that items may be partitioned into groups of large and small items
(as in Figure 1), and the packing of large items in an augmented bin can be approximately
solved. One may consider, for example, the problem of packing regular polygons, by using a
discretization algorithm to deal with large items. Notice that one could even consider instances
with items of mixed shapes. A very natural generalization of our algorithm is considering
the packing of Lp -norm spheres, as done in Section 6. Moreover, minor modifications of the
algorithm allow using bins of different shapes. In Section 6, the illustrative example considers
a whole set of semi-algebraic sets as possible bins, what comprises, for instance, the problem
of packing spheres in spheres. For the particular case that a bin is enlarged by a constant, we
avoid the approximation, and obtain a resource augmentation scheme.
Finally, we note that, although the quantifier elimination algorithms we used give a precise
representation of a packing in a non-augmented bin, the returned solution may possibly con-
tain irrational coordinates. To provide solutions with rational numbers, we used approximate
coordinates with arbitrary precision. This is the only reason why we used augmented bins in
our APTAS, and thus resource augmentation can be avoided in a more general computational
model. We left open the question to determine if it is always possible to obtain a rational
solution to the problem of packing a set of circles of rational radii in a non-augmented bin of
rational dimensions.
Acknowledgement We would like to thank Frank Vallentin for providing us with insights
and references on the cylindric algebraic decomposition and other algebraic notions.
References
[1] B. Baker, E. Coffman, Jr., and R. Rivest. Orthogonal packings in two dimensions. SIAM
Journal on Computing, 9(4):846–855, 1980.
[2] N. Bansal, A. Caprara, and M. Sviridenko. A New Approximation Method for Set Cov-
ering Problems, with Applications to Multidimensional Bin Packing. SIAM Journal on
Computing, 39(4):1256–1278, 2010.
[3] N. Bansal, J. R. Correa, C. Kenyon, and M. Sviridenko. Bin Packing in Multiple Dimen-
sions: Inapproximability Results and Approximation Schemes. Mathematics of Operations
Research, 31(1):31–49, 2006.
[4] N. Bansal, X. Han, K. Iwama, M. Sviridenko, and G. Zhang. A harmonic algorithm for
the 3D strip packing problem. SIAM Journal on Computing, 42(2):579–592, 2013.
[5] N. Bansal and A. Khan. Improved Approximation Algorithm for Two-Dimensional Bin
Packing. In Proceedings of the Twenty-Fifth Annual ACM-SIAM Symposium on Discrete
Algorithms, pages 13–25, 2014.
[6] S. Basu, R. Pollack, and M.-F. Roy. On the Combinatorial and Algebraic Complexity of
Quantifier Elimination. Journal of the ACM, 43(6):1002–1045, Nov. 1996.
[7] S. Basu, R. Pollack, and M.-F. Roy. Algorithms in Real Algebraic Geometry. Springer-
Verlag Berlin Heidelberg, 2006.
26
PDF Studio - PDF Editor for Mac, Windows, Linux. For Evaluation. https://www.qoppa.com/pdfstudio
[8] E. G. Birgin and J. M. Gentil. New and improved results for packing identical unitary
radius circles within triangles, rectangles and strips. Computers and Operations Research,
37(7):1318–1327, 2010.
[9] A. Caprara. Packing 2-dimensional bins in harmony. In Proceedings of the 43rd Annual
IEEE Symposium on Foundations of Computer Science, pages 490–499, 2002.
[10] F. Chung, M. Garey, and D. Johnson. On Packing Two-Dimensional Bins. SIAM Journal
on Algebraic Discrete Methods, 3(1):66–76, 1982.
[11] E. Coffman, Jr., M. Garey, D. Johnson, and R. Tarjan. Performance bounds for level-
oriented two-dimensional packing algorithms. SIAM Journal on Computing, 9(4):808–826,
1980.
[12] J. E. G. Coffman, J. Csirik, G. Galambos, S. Martello, and D. Vigo. Bin Packing Approx-
imation Algorithms: Survey and Classification. In P. M. Pardalos, D.-Z. Du, and R. L.
Graham, editors, Handbook of Combinatorial Optimization, pages 455–531. Springer New
York, 2013.
[13] G. E. Collins. Quantifier elimination for real closed fields by cylindrical algebraic decompos-
tion. In Proceedings of the 2nd GI Conference on Automata Theory and Formal Languages,
pages 134–183, 1975.
[14] E. D. Demaine, S. P. Fekete, and R. J. Lang. Circle Packing for Origami Design Is Hard.
In Proceedings of the 5th International Conference on Origami in Science, pages 609–626,
2010.
[16] W. Fernandez de la Vega and G. S. Lueker. Bin packing can be solved within 1 + ε in
linear time. Combinatorica, 1(4):349–355, 1981.
[19] R. Harren, K. Jansen, L. Prädel, and R. van Stee. A (5/3 + ε)-approximation for strip
packing. In Proceedings of the 12th Algorithms and Data Structures Symposium, pages
475–487, 2011.
[20] R. Harren and R. van Stee. Improved absolute approximation ratios for two-dimensional
packing problems. In Proceedings of the 12th International Workshop, APPROX 2009, and
13th International Workshop, RANDOM 2009, pages 177–189, 2009.
[21] R. Harren and R. van Stee. Absolute approximation ratios for packing rectangles into bins.
Journal of Scheduling, 15(1):63–75, 2012.
[22] M. Hifi and R. M’Hallah. A literature review on circle and sphere packing problems: Models
and methodologies. Advances in Operations Research, 2009:1–22, 2009.
27
PDF Studio - PDF Editor for Mac, Windows, Linux. For Evaluation. https://www.qoppa.com/pdfstudio
[23] K. Jansen and R. Solis-Oba. An asymptotic approximation algorithm for 3D-strip packing.
In Proceedings of the Seventeenth Annual ACM-SIAM Symposium on Discrete Algorithm,
pages 143–152, 2006.
[28] A. Meir and L. Moser. On packing of squares and cubes. Journal of Combinatorial Theory,
5(2):126–134, 1968.
[29] F. Miyazawa and Y. Wakabayashi. An algorithm for the three-dimensional packing problem
with asymptotic performance analysis. Algorithmica, 18(1):122–144, 1997.
[31] D. D. Sleator. A 2.5 times optimal algorithm for packing in two dimensions. Information
Processing Letters, 10(1):37–40, 1980.
[32] A. Steinberg. A strip-packing algorithm with absolute performance bound 2. SIAM Journal
on Computing, 26(2):401–409, 1997.
[33] P. G. Szabó, M. C. Markót, T. Csendes, E. Specht, L. Casado, and I. Garcı́a. New Ap-
proaches to Circle Packing in a Square. Springer, 2007.
[34] A. Tarski. A decision method for elementary algebra and geometry. University of California
Press, 1951.
[35] G. Wäscher, H. Haußner, and H. Schumann. An improved typology of cutting and packing
problems. European Journal of Operational Research, 183(3):1109–1130, 2007.
28