Jose R. Correa and Claire Kenyon- Approximation Schemes for Multidimensional Packing

download Jose R. Correa and Claire Kenyon- Approximation Schemes for Multidimensional Packing

of 10

Transcript of Jose R. Correa and Claire Kenyon- Approximation Schemes for Multidimensional Packing

  • 8/3/2019 Jose R. Correa and Claire Kenyon- Approximation Schemes for Multidimensional Packing

    1/10

    Approximation Schemes for Multidimensional Packing

    Jose R. Correa Claire Kenyon

    Abstract

    We consider a classic multidimensional generaliza-tion of the bin packing problem, namely, packingddimensional rectangles into the minimum numberof unit cubes. Our two results are: an asymptoticpolynomial time approximation scheme for packing d-dimensional cubes into the minimum number of unitcubes and a polynomial time algorithm for packing rect-angles into at most OPT bins whose sides have length(1 + ), where OPT denotes the minimum number of

    unit bins required to pack the rectangles. Both algo-rithms also achieve the best possible additive constantterm. For cubes, this settles the approximability of theproblem and represents a significant improvement overthe previous best known asymptotic approximation fac-tor of 2 (2/3)d + . For rectangles, this contrastswith the currently best known approximation factor of1.691 . . ..

    1 Introduction

    Bin packing problems have attracted much attention inthe literature since the seventies. In the one dimensionalcase the problem consists of using the minimum numberof unit (one dimensional) bins to pack a list of items ofsize at most one. One dimensional bin packing is knownto be NP-hard; moreover, no approximation algorithmwith approximation factor better than 3/2 can existunless P = N P. This leads to the consideration ofasymptotic performance guarantees: Fernandez de laVega and Lueker [5] thus settled the approximability ofone dimensional bin packing by giving an asymptoticapproximation scheme. In spite of that, in many realworld applications the one dimensional framework is toolimited and extensions to higher dimensions are needed.Unfortunately, the treatment of higher dimensional

    versions of bin packing has not been as satisfactory asthe one dimensional case so far.Several generalizations of one dimensional bin pack-

    ing have been considered. Square packing, vector pack-ing and rectangle packing seem to be the most com-

    Operations Research Center, Massachusetts Institute of Tech-

    nology, Cambridge, MA 02139-4307. [email protected] dInformatique, Ecole Polytechnique, 91128

    Palaiseau Cedex. [email protected]

    monly known extensions. The square packing problemconsists of packing a list of squares into the minimumnumber of unit squares (bins). Leung et al. [10] provedthat deciding whether a list of squares can be packed ina unit square is NP-hard; therefore, square packing isNP-hard. This immediately implies [6] that there is nobetter than 2 approximation algorithm for square pack-ing unless P = N P. On the other hand, the best knownasymptotic approximation algorithms for square pack-ing, independently obtained by Seiden and van Stee [13]

    and Kohayakawa et al. [9], have an asymptotic perfor-mance guarantee of 14/9 + for any > 0. Kohayakawaet al.s algorithm also works in higher dimensions andhas an asymptotic approximation factor arbitrarily closeto 2 (2/3)d; furthermore, it runs in polynomial timewhen d is a fixed constant.

    Here we first study the ddimensional cube packingproblem, d-CP for short. For a list I of ddimensionalcubes, let us denote by OPT(I) the minimum numberof unit cubes in which I can be packed. The first mainresult in this paper reads as follows.

    Theorem 1.1. There exists an algorithm A which,

    given a list I of n ddimensional cubes and a positivenumber , produces a packing of I into A(I) copies of[0, 1]d such that:

    A(I) (1 + ) OPT(I) + 1.

    The running time of A is polynomial for fixed d and .

    Note that our approximation scheme is best possiblein the sense that the hardness result above impliesthat there can not be an approximation scheme withconstant term strictly less than 1. (Nevertheless, thereis not enough evidence to rule out the existence of apolynomial time algorithm producing a packing intono more than OPT(I) + 1 bins.). Theorem 1.1 wasindependently proved by Bansal and Sviridenko [1] butwith an additive constant ofO(1), that depends on 1/,instead of just 1.

    The rectangle packing problem (or two dimensionalbin packing) consists of packing a list of rectanglesinto the minimum number of unit squares. Recently,Bansal and Sviridenko [1] showed the following veryinteresting result: there is no asymptotic polynomial

  • 8/3/2019 Jose R. Correa and Claire Kenyon- Approximation Schemes for Multidimensional Packing

    2/10

    time approximation scheme for rectangle packing unlessP = N P. Their strong result contrasts with the bestapproximation algorithm has an asymptotic guaranteeof 1.691... obtained by Caprara [3]. Nevertheless, theapproximation gap is still wide. Here is our second mainresult.

    Theorem 1.2. There exists an algorithm A which,given a listI of rectangles and a positive number , pro-duces a packing of I into A(I) copies of [0, 1 + ]2 suchthat:

    A(I) OPT(I),where OPT(I) is the minimum number of unit cubesin which I can be packed. The running time of A ispolynomial for fixed .

    The last theorem is also best possible in the sense thatthe constant cannot be improved and that there is no

    APTAS for rectangle packing.In Section 2, we prove Theorem 1.1. Besides using

    extensions of the approach of Fernandez de la Vegaand Lueker [5], the main idea behind the hypercubepacking algorithm is to divide the input list into threesets, large, medium and small, in such a way suchthat the medium cubes are negligible. As a warm up,we first see how an almost optimal packing of the smallcubes can be found, then we do the same for large cubes;finally we bring the pieces together and show how theappropriate partition is found.

    In Section 3, we prove Theorem 1.2. There is nonatural total order on rectangles, hence the rounding

    technique used by Fernandez de la Vega and Luekerdoes not seem to extend here. Hence, we round sizes in astraightforward manner, at the cost of enlarging the binsizes from [0, 1]2 to [0, 1 + ]2. This enables one to dealwith rectangles which are both wide and tall. The mainproblem is to deal with the rectangles which are eithervery wide and flat or very thin and tall, and for eitherkind we can essentially use the strip-packing algorithmof Kenyon and Remila [7]. Our algorithm thus relieson an appropriate partition of rectangles into large,small, horizontal, vertical, and medium, insuch a way that the medium rectangles are negligible.It only remains to mix gracefully the various kindsof rectangles; this requires discretizing a near-optimalsolution appropriately so as to be able to guess notonly where the large rectangles go, but also the areasused to pack horizontal rectangles and the areas used topack vertical rectangles.

    Finally, in Section 4, we discuss a related packingproblem with applications in VLSI design. Specifically,we show how the ideas in Section 3 can be used to obtaina PTAS for this problem.

    2 Hypercube Packings

    2.1 Definitions and Preliminaries. We adopt twostandard assumptions in multidimensional bin packing:first, items are allowed to touch i.e., they can intersectin a face; second, items can not be rotated (orthogonalpacking without rotation).

    A ddimensional cube is given by a positive numbera, representing the length of its side. Since we will packsquares into unit squares, we need to assume a 1.Given an input list I of n ddimensional cubes withsides of length ai [0, 1] for i = 1, , . . . , n, the volumeof the list is defined as: vol(I) =

    ni=1 a

    di . Given two

    cubes and their positions in the space, we say that theyare nonoverlaping if their interiors are disjoint.

    A packing of I into k bins, is a positioning ofthe cubes into k copies H1, . . . , H k of the unit hy-percube [0, 1]d, so that no two cubes overlap. Theddimensional cube packing problem consists of find-ing a packing of I into the minimum number of bins,OPT(I). We denote A(I) the number of bins algorithmA uses to pack I.

    We now establish a simple result that will be neededlater.

    Lemma 2.1. Let S be a set of n nonoverlapingddimensional cubes positioned inside [0, 1]d. Then,[0, 1]d \ S can be seen as the union of no more than(2n + 1)d nonoverlaping ddimensional rectangles.

    Proof. Extending each facet of each cube in S, we obtaina grid in [0, 1]d consisting of (2n + 1)d cells.

    Observation 2.1. In the last lemma we can assumewithout loss of generality that in the setS there is a cubetouching each of the hyperplanes xi = 0, fori = 1, . . . , d.Thus, [0, 1]d\S can be seen as the union of no more than(2n)d nonoverlaping ddimensional rectangles.

    Observation 2.2. In the 2-dimensional case, no morethan 3n rectangles are needed to cover [0, 1]2 \ S. Thisbound can be seen as follows. For each square in Sdraw an horizontal line at its top and bottom until itintersects some other square as in Figure 1. Assumingthe bottom-most square is at height 0, we have drawn2n

    1 horizontal lines. This partitions the unit square

    into at most3n rectangles (two to the side of each squareand another to the top of each square in S) plus theoriginal n squares.

    2.2 Packing Small Cubes. In this section we lookat multidimensional cube packing in case all cubes aresmall. In this setting we are given an input list Sof cubes with sides ai for some positive (small)constant . We will use a multidimensional version of

  • 8/3/2019 Jose R. Correa and Claire Kenyon- Approximation Schemes for Multidimensional Packing

    3/10

    Figure 1: Decomposing the unit square into rectangles

    the Next-Fit-Decreasing-Height shelf heuristic (NFDH).Coffman, Garey, Johnson, and Tarjan [2] analyzed thisheuristic in the context of strip packing pointing outproperties closely related to what we extend here tohigher dimensions.

    In two dimensions, the NFDH algorithm is a levelalgorithm which uses the next-fit approach to pack thesorted (by nonincreasing size) list of squares. The

    squares are packed, left-justified on a level (shelf) untilthe next rectangle will not fit. This rectangle is usedto define a new level and the packing continues on thislevel. The earlier levels are not revisited. In generalwe define the NFDH heuristic inductively. Assume weknow how to perform NFDH in d 1 dimensions. Theddimensional NFDH heuristic will look at a facet Fofthe bin and pack squares on it using its d1 dimensionalversion. After it finishes packing the facet, it will cut offfrom the bin a ddimensional rectangle (slice) with baseFand height a1. It will proceed packing the remaininglist in the rest of the bin.

    Lemma 2.2. Let S denote the instance and assumeall cubes in S have side smaller than . Considerthe NFDH heuristic applied to cubes in S. If NFDHcan not place any other cube in a rectangle R of sizer1r2 rd (withri 1), the total wasted (unfilled)space in that bin is no more than:

    2d

    i=1

    ri

    Proof. The key idea of the proof is that the smallestcube in slice i is larger than the largest cube in slicei + 1. This says that the volume covered by cubes inslice i is almost as big as (could be even bigger) the totalvolume of slice i + 1.

    Let us denote by h1, h2, . . . , hl the height of theslices generated by the algorithm. Clearly

    li=1 hi

    1 . For d = 2 the total wasted space can be boundedby 2r1 + r2. The factor 2r1 comes from the first slice(that we cannot bound) and the wasted space abovethe last slice while the factor r2 arises from the wastedspace to the right of each slice.

    The same argument above applies in general andthe total wasted space can be bounded by

    j=1

    rj +d

    i=1

    j=i

    rj 2d

    i=1

    ri.

    Note that, as in the two-dimensional case, only for i = 1we waste the volume of two slices.

    Observation 2.3. If in the previous lemma we are us-ing the NFDH heuristic to place cubes in many rectan-gles, a slightly more careful argument (which will boundthe height of slice 1 of a given rectangle Ri with the sizeof the smallest item in the last slice of rectangle Ri1)can be used to improve the bound on the wasted space inrectangle R to:

    di=1 ri.

    Corollary 2.1. LetS denote the instance and assumeall cubes in S have side smaller than , then

    NFDH(S) (1 + 2d)vol(S) + 1.

    That is, NFDH is an APTAS when all cubes are small.

    2.3 Packing Large Cubes. We now concentrate inthe case of packing large cubes. In this case we aregiven an input list L ofn cubes whose sides are at least. For simplicity, we split the analysis into two steps (asin [5, 14]).

    Lemma 2.3. If the input listL contain only large cubes,say ai

    for all i = 1, . . . , n and there are only K

    different cube sizes for some constant K. Then, we cansolve d-CP optimally in polynomial time.

    Proof. Clearly the number of items that fit in a bin isbounded by M = 1/d. Let us see that the numberof bin types R is also constant.

    Assume cubes of type i have side length equal to i.A bin type will be denoted by a vector ( x1, x2, . . . , xK)i.e., x1 cubes of type 1, x2 cubes of type 2, upto xK cubes of type K , that fi t in a bin. If agiven vector of cubes fit in a bin, they have fit inan arrangement (position) that place their vertices inpoints with coordinates belonging to the set:

    C =

    Ki=1

    ii : i ZZ+ and 0 Ki=1

    ii 1

    .

    Indeed, given a general placement of the cubes in thebin, fix a dimension l = 1, . . . , d and sort the cubesby their leftmost point in their lth coordinate. Nowpush the cubes one-by-one, starting from the cubes withsmaller lth coordinate, a little bit to the left until the

  • 8/3/2019 Jose R. Correa and Claire Kenyon- Approximation Schemes for Multidimensional Packing

    4/10

    vertices lth coordinates belong to C. By doing thisfor all coordinates we obtain the claimed result.

    Now let C denote the cardinality of the set C. Sincei any point

    Ki=1 ii in C will satisfy i 1/

    for all i = 1, . . . , K . Hence, C (1/)K which is a(huge) constant. This implies that in a bin type all

    cubes will be placed with their vertices in Cd. Then,there is at most

    Cd

    M

    MK possible bin types, which is

    again a constant. Moreover, we can check in constanttime if a given vector (x1, . . . , xK) is a bin type or not.

    Therefore, both M and R are constants and clearlyOPT(L) n. Hence, we can try all possible packings

    in polynomial time, in fact no more thann+RR

    such

    packings can exist.

    Lemma 2.4. If ai for all i = 1, . . . , n then there isa (1 + ) approximation algorithm for d-CP.

    Proof. Let L denote the given instance list. Sort the

    n cubes in nonincreasing order of sizes and partitionthem in K = 1/d+1 groups, each containing at mostQ = n/K cubes. We construct two instances J (resp.J) by rounding up (resp. down) all items in each groupto the largest (resp. smallest) cube in the group. Clearly

    OPT(J) OPT(L) OPT(J).

    Moreover, the argument of Fernandez de la Vega andLueker applies here as well, then,

    OPT(J) OPT(J) + Q

    OPT(L) + Q

    (1 + ) OPT(L).The last inequality follows directly from OPT(L) ndtogether with Q nd+1.

    Therefore, the algorithm is to first round the in-stance and then apply the previous lemma to solve therounded instance optimally.

    2.4 The General Case in Two Dimensions. Inthis section we prove Theorem 1.1 in the case cubes ofany size are allowed to be part of the input list thatwe now denote by I. Although we already know howto construct almost optimal packings of only big andonly small cubes separately, we can not directly applythe algorithms in the previous sections to construct apacking in the general case. One extra step will berequired to allow the combination of the previously seenalgorithms.

    For the sake of simplicity in the notation we workin this section only in the two dimensional case. Theextension to higher dimensions is straightforward anddiscussed at the end of the section.

    The general asymptotic polynomial time approxi-mation scheme for square packing is as follows:

    (1) Let I be the input list and > 0 fixed. Consider

    the sequence , 3, . . . , 2i1, . . . and let Mi = {j :

    aj

    [2

    i+11, 2i1)

    }.

    (2) Take M := Mi for some index i satisfyingvol(Mi) OPT(I). Define the set of large itemsas L = {j : aj > 2i1} and the set of small itemsas S = {j : aj 2i+11}.

    (3) Find an almost optimal packing ofL as in Lemma2.4.

    (4) Use NFDH to pack as many squares in Sas possibleusing only the remaining space in the alreadyopened bins (possibly a set S Swas not packed).

    (5) Use NFDH using only new bins to pack M S

    .

    From now on, we call this algorithm as algorithm A.We analyze its running time and prove that satisfies thebound in Theorem 1.1.

    Analysis of the Running Time. It is clear that steps(3)-(5) take polynomial time for fixed d and . We thenonly need to see that in step (1)-(2) we can find the setMi such that vol(Mi) OPT(L) in polynomial time.Indeed, since:

    i1/

    vol(Mi) OPT(I)

    and there are 1/ terms (a constant amount) in thesum. We can find an index i with the desired propertyby exhaustive search. Hence, algorithm A runs inpolynomial time.

    Analysis of the Algorithm. To prove that algorithmA satisfies the result in Theorem 1.1, we need todistinguish two cases depending on what the set S wasafter step (4). In both cases the bound in the theoremholds.

    (i) After step (4), S is empty. In this case, after step(4) the number of bins algorithm A has opened isbounded by

    (1 + 2i1) OPT(L S) (1 + ) OPT(I).

    And it only remains to pack the squares in M. Forthat purpose algorithm A needs at most

    (1 + 2i1) OPT(I) + 1 2 OPT(I) + 1

  • 8/3/2019 Jose R. Correa and Claire Kenyon- Approximation Schemes for Multidimensional Packing

    5/10

    new bins. It follows that the total number of binsused by A was no more than

    (1 + 3) OPT(I) + 1.

    (ii) After step (4), S is nonempty. In this case we

    derive a volume argument for the bins opened topack L. Consider a bin containing a subset L

    of squares in L, clearly |L| 1/(2i1)2. FromLemma 2.1 [0, 1]2 \ L can be decomposed into nomore than 3/(2

    i1)2 rectangles, these are filledin step (4) of the algorithm (by NFDH) withsquares from the set S. Lemma 2.2 tells us thatfor each rectangle in the partition we will covereverything but a volume of at most 22

    i+11 (sinceeach rectangle in the partition has sides lengthno more than 1). Adding over all rectangles, the

    total wasted space can be bounded by 22i+11

    3/(2i1)2

    6. This last bound implies that for

    each bin containing squares in L, at least a fraction(1 6) of its volume is filled with squares fromL S.To finish the proof note that A(I) is exactly the sumof the number of bins used up to step (4) and thenumber of bins used in step (5). The first quantitywas bounded in the last paragraph while the secondcan be bounded by Lemma 2.2. Thus,

    A(I) vol(L (S\ S))

    1 6+(1 + 2)vol(S M) + 1

    (1 + 12)vol(I) + 1 (1 + 12) OPT(I) + 1,

    proving Theorem 1.1 in the two dimensional case.

    The Higher Dimensional Analysis. The asymp-totic approximation scheme in the d dimensional caseis almost the same as the one described above. Theonly difference lies in the sequence in step (1) and theconsequent definition of L, M and S. In d dimensionssteps (1) and (2) should be replaced by:

    (1) Let I be the input list and > 0. Consider the

    sequence

    i = d2(i+1)

    1

    d21 for i 0,and let Mi = {j : aj [i+1, i)}.

    (2) Take M := Mi for some i such that vol(M) OPT(I). Define the set of large items as L = {j :aj > i and the set of small items as S = {j : aj i+1}.

    Clearly, the running time of the algorithm is againpolynomial in the input size ifd and are fixed constant.

    Finally, the analysis of the algorithm is exactly thesame in case (i) and very similar in case (ii). The onlydifference is that we will need to use the bounds fromthe all small and all large items in the d

    dimensional

    setting. Therefore, the actual numbers we obtain willdepend on d, which is a fixed constant.

    3 Packing Rectangles

    The approach taken above could also be attempted forrectangle packing. Unfortunately we run into troublewhen rounding the large rectangles. Instead, our ap-proach here consists in relaxing the constraints by al-lowing to enlarge the bins slightly. Here is the algorithmused to prove Theorem 1.2.

    3.1 The Algorithm.

    Input. Denote the input list by I. Assume thatthe ith rectangle has width ai and height bi, with0 ai, bi 1. Denote also by Sf(I) =

    ni=1 aibi, the

    total surface of the input.Partitioning the Input. For j {1, 2, . . . , 2/},

    let Mj denote those rectangles such that ai (2j+1, 2(j+1)+1] or bi (2j+1, 2(j+1)+1]. Let i0 besuch that the total surface area of the rectangles of Mi0is minimum. Let = 2i0+1, and define the partitionI = Mi0 L H V S, where:

    L = {i : ai > and bi > }

    S =

    {i : ai <

    2 and bi < 2

    } H = {i : ai > and bi < 2} V = {i : ai < 2 and bi > }

    Rounding the Input. We now round everycoordinate greater than up to the nearest multipleof . Denote by I the rounded instance.

    Let C denote the number of distinct rectangles inL: thus L contains i rectangles of type i, for 1 i C.

    Rounding and Partitioning the Output. Wedefine bin types by decomposing (1+ )(1+) squaresas follows:

    We consider all possible packings of (large) rectan-gles of type i, 1 i C, into a (1 + ) (1 + )square, such that the corners of the rectangles havecoordinates which are integer multiples of .

    For each possible packing into a (1 + ) (1 + )square, we consider the area of the bin which isstill uncovered as a union of small square cells ofside length (where each square is positioned at

  • 8/3/2019 Jose R. Correa and Claire Kenyon- Approximation Schemes for Multidimensional Packing

    6/10

    integer multiples of ), and label each cell eitherH or V.

    Together with this labeling of the uncovered area, thispacking of large rectangles defines a bin type. Let K bethe total number of bin types.

    Main Loop. For each (n1, . . . , nK) such thatj nj n, we attempt to construct a packing of I

    using nj bins of type j, such that the rectangles fromL are packed in the spaces reserved for them in the bintype, the cells labeled H are only used for rectanglesfrom H S and the cells labeled V are only used forrectangles from V S. This is done as follows.

    1. To decide whether the rectangles from L can beplaced, we check that for every rectangle type i,1 i C, the number i of type i rectangles in Iis less than or equal to the total space available forthem:

    i

    1jK

    nj

    number of type i rectanglespositioned in type j bins

    .

    2. We use the following algorithm for packing therectangles from H.

    (a) For each bin type j, consider the union U ofthe cells labeled H. Drawing horizontal linesat y-coordinates integer multiples of , wecan interpret U as a union of horizontal stripsof height and width multiple of . For

    each integer multiple of

    , let h(j)

    denotethe sum of the heights of the strips of width in a type j bin. Let h denote the total heightof the strips of width in the packing whichwe are currently constructing,

    h =

    1jK

    njh(j) .

    (b) To pack rectangles from H, we will solvethe following fractional strip-packing prob-lem. Consider all configurations (w1, w2, . . .)of widths which are multiples of and sum

    to at most 1 + . Let q be the number of suchconfigurations. Let Air denote the number ofoccurrences of the width i in configurationr. Let Bi denote the sum of all heights of therectangles of H whose width equals i. We

    define one variable x()r for each strip width

    and for each configuration r whose widths sumto at most . We find, in polynomial time, abasic feasible solution to the following system

    of linear constraints, if it exists.

    (i) Bi

    ,r x()r Air

    () r, x()r h(r, ) x()r 0

    (c) We place rectangles from H in the configu-rations thus defined, proceeding in a greedyfashion.

    (d) We cut back into strips of height and placethem back into the bins.

    Let M denote the set of rectangles which:either did not fit in the fractional packing after(c) or are cut in the process (d). Now, we nowset aside M. This defines a packing of therectangles of H\ M into the parts of the binslabeled H.

    3. Similarly, we pack the rectangles ofV \M into theparts of the bins labeled V.

    4. We pack the rectangles of S into the cellswhich have available space, using the Next FitDecreasing Height (NFDH) algorithm.

    5. We expand each bin by adding a thin vertical1 O() horizontal strip and a this O() 1vertical strip and use them to pack the rectanglesfrom Mi0 M M using an O(1)-approximationalgorithm such as NFDH in the horizontal stripsand FFDW (Width) in the vertical strips.

    Output. We output the best packing among allfeasible packings of L thus constructed.

    3.2 Analysis of the Running Time. The runningtime is relatively easy to analyze. i0 2/, thus 4/ = (1). The number C of large rectangle typesis at most (1/)2 = O(1). A bin type can be definedby labeling each cell by H, V, or i C, thus thenumber K of bin types is at most (C+2)1/(

    )2 = O(1),and so the number of iterations through the main loopis at most nK which is polynomial in n.

    The number of strip widths is at most 1/ = O(1).The number of configurations is at most 22/(

    ) =O(1). Multiplying, the number of variables in the linearprogram is O(1). The number of constraints is at most2/() = O(1). The coefficients Ai,r are bounded byO(1) and Bi are written on at most O(log n) bits, hencethe linear program can be solved efficiently.

    The First Fit Decreasing Height and First FitDecreasing Width algorithms are polynomial time.

    Overall, the algorithm thus runs in polynomial time.

  • 8/3/2019 Jose R. Correa and Claire Kenyon- Approximation Schemes for Multidimensional Packing

    7/10

    3.3 Analysis of Correctness.

    Lemma 3.1.

    Sf(Mi0) Sf(I).

    Proof. Each rectangle of I belongs to at most two

    sets Mj , thus

    1j2/ Sf(Mj) 2Sf(I). The mini-mum surface is less than the average surface, which isbounded by Sf(I).

    Lemma 3.2. Let I denote the rounded input. If I canbe packed into OPT unit size bins, thenI can be packedinto OPT(1+2)(1+2) bins in such a way that anyrectangle with ai is positioned at an x-coordinatewhich is an integer multiple of , and any rectanglewith bi is positioned at a y-coordinate which is aninteger multiple of .

    Proof. Consider the optimal packing of I. Define a

    partial order H on rectangles as the transitive closureof the relation: i is in relation with i if rectangle i, whentranslated horizontally to the right by 2, intersectsi. Note that any chain in H contains at most 1/rectangles with ai .

    Take a total order which extends H. We takethe rectangles one by one in that order and deal with ias follows: we extend i horizontally to the right so thatits width becomes ai, we translate it horizontally to theright to that it is positioned at an integer multiple of;then, for each i i in increasing order, if i intersectssome rectangle i i then we translate i to the rightby 2.

    It is easy to check that this constructs a feasiblepacking.

    Since the chains in H contain at most 1/ rect-angles of width ai , each rectangle is translated atmost 1/ times, hence in total by at most (2)/ = 2.Thus the final packing fits in (1 + 2) 1 bins.

    We then proceed similarly for rounding the bis intobi.

    Lemma 3.3. Consider a packing of I into (1 + 2) (1 + 2) bins, satisfying the condition of Lemma 3.2.Consider any cellC = [m, (m+1)][p, (p+1)]in any bin. Then either H C = or V C = .

    Proof. Assume, for a contradiction, that i H C = and i V C = . Since i has width and starting pointinteger multiples of, it must be that i spans the wholewidth of C. Similarly, i must span the whole height ofC, But then i and i must intersect, a contradiction.

    Lemma 3.4.

    Sf(M) = O()Sf(I)

    and

    Sf(M) = O()Sf(I).

    Proof. Let us only prove the first equation, the secondis analogous. Consider the sets Mc and Md denotingthe rectangles the were discarded in steps (c) and (d)respectively. Then Mc Md = M. We prove that bothSf(Mc) = O()Sf(I) and Sf(Md) = O()Sf(I).

    To see the first equality, we recall the strip packinganalysis by Kenyon and Remila [7]. Consider a frac-tional strip packing (i.e. a solution the to linear program

    in step (2)(b)) x()r for all r and . Clearly such solution

    has at most (2/) nonzero coordinates. Fix and let

    x()1 , . . . , x

    ()k be the nonzero variables corresponding to

    that . To constrict an integer strip packing we proceed

    as follows: Let x()j > 0 be the variable corresponding

    to the current configuration. This configuration will be

    used between levels lj = (x()1 +

    2) +

    + (x

    ()j1 +

    2)

    and lj+1 = lj + x

    ()j +

    2. For each i such that Aij = 0we draw Aij columns of width i

    going from level lj to

    level lj+1. After this is done for all and all configura-tions, we take all columns of width i and start fillingthem up with the corresponding rectangles of the samewidth in a greedy manner. It is not difficult to showthat all rectangles in fit. Now, we take all rectangleswhose top end belongs to the interval (lj 2, lj ], forany and j, and set them aside (they are put in Mc).The total surface of the removed rectangles is clearly nomore than

    2 ( number of constraints ) ( max item height )= 2 2

    2 = 4.

    This proves that a fractional strip packing where stripsof width are of height h (the linear program in step(2)(b) ), can be turned into an integer strip packingof almost all rectangles where strips of width are ofheight no more than h.

    Therefore, the total surface of rectangles in H thatmay not fit after step (2)(c) is bounded by 2(2/)2 =4. In other words Sf(Mc) = O()Sf(I).

    On the other hand, to see that Sf(Md) = O()Sf(I).

    Notice that the rectangles in H have height smaller than2 and the cut strips of step (2)(d) are of height ,the surface of the rectangles put aside in step (2)(d) isno more than a fraction of the surface of H.

    Hence, he total surface of M is no more than afraction O() of the total surface of the instance.

    Lemma 3.5. The rectangles in Mi0 M M fit intothe thin strips added along the bins in step (5).

  • 8/3/2019 Jose R. Correa and Claire Kenyon- Approximation Schemes for Multidimensional Packing

    8/10

    Proof. Clearly the whole surface of Mi0 M M isno more than O()Sf(I). Moreover, we can partitionMi0 M M into two sets A and B such that:

    A contains only rectangles with ai < 2 < 2 andSf(A) = O() OPT(I) (A contains M and part of

    Mi0).

    B contains only rectangles with bi < 2 < 2 andSf(B) = O() OPT(I) (B contains M and part ofMi0).

    Now, FFDW packs A into the OPT(I) added stripsof size O() 1 while NFDH does the work for therectangles in B.

    Lemma 3.6. Consider the two-dimensional NFDHheuristic applied to rectangles in S. When NFDH cannot place any other rectangle in a bin of size a b thenthe total unused space in that bin is no more than:

    O(2)(a + b)

    Proof. The result is very similar to Lemma 2.2 and toa result in [2].

    We are now ready to give the overall analysis of thealgorithm.

    Proof of Theorem 1.2. Consider an input list I andlet I be the rounded input. From Lemma 3.2 we knowthat there is a packing ofI into no more than OPT(I)bins of size (1 + O())

    (1 + O()). Consider then

    the optimal packing in such bins for I satisfying theconditions of Lemma 3.2. By Lemma 3.3 we know thatin such packing all cells as in Lemma 3.3 intersect eitheran rectangle in L, H or V but not two of them. Inother words in an optimal packing of I satisfying theconditions of Lemma 3.2 each cell is labeled either V,H, or i for i = 1, . . . , C (where C was the number ofdistinct large rectangles); or will have no label at all.

    Clearly, our algorithm will eventually guess a la-beling of the cells such that labeled cell in the optimalpacking have the same label. At that point the algo-rithm will find a feasible packing of all rectangles in Land almost all rectangles in H and V. By Lemmas 3.4and 3.5 the unpacked rectangles Mi0 , M and M are ofsmall surface and they can be packed in the extra spaceadded in step (5) of the algorithm.

    It only remains to see that the small rectangles Swill be successfully packed by NFDH. We prove thatis not possible that in step (4) a new bin is opened ifalready OPT(I) (1 + O()) (1 + O()) bins have beenused. We do this by a surface argument. Suppose, bycontradiction, that such new bin is opened in step (4).

    At this step we distinguish four types of cells:the ones completely filled with a rectangle in L, theones filled with only rectangles in S, the ones filled onlywith rectangles in H or V, and the ones partly filledwith rectangles in H or V and partly with rectanglesin S. By the arguments in Lemmas 3.4 and 3.6 all

    cells are almost filled Namely a fraction (1 O()) oftheir surface is filled. Overall this implies that a fraction(1 O()) of the first OPT(I) bins is filled, and thenthe total surface that has been filled in the first OPT(I)(1 + O()) (1 + O()) squares is at least

    (1 O()) OPT(I)(1 + O())2 > OPT(I).

    Where the inequality follows by choosing the rightconstants.

    4 Concluding Remarks and Related Problems

    Our algorithms are also related to the optimizationversion of the following interesting question posed byMoser [12]:

    Determine the smallest number x such that any systemof squares with total area 1 may be parallely packed

    into a rectangle of area x.

    Bounds for this problems have been obtained by Kleit-man and Krieger [8] and by Novotny [11]. Note that,although we do not obtain bounds for this problem. Ouralgorithm can easily be adapted to obtain a PTAS forthe following very related optimization problem. Thisproblem has many applications in computer science, for

    example in VLSI design:

    Given a system of n rectangles with total area 1,determine the smallest numberx such that all n

    rectangles may be parallely packed into a rectangle R ofarea x.

    Let us I denote the instance. For each rectangle, letai (0, 1] denote its width and bi (0, 1] its height;the total surface of the instance, denoted by Sf(I),equals 1. To solve this problem note first that thetechniques in the paper can be easily adapted to solvethe underlying decision problem: Given n rectangles

    with sides ai, bi (0, 1], given a rectangle R of size aband given > 0, determine if all n rectangles can bepacked in a rectangle of size [(1+ )a + ] [(1+ )b + ]or they cannot be packed in R.

    Consider a given > 0, and denote by =min{maxi=1,...,n ai, maxi=1,...,n bi}. We distinguish twocases:

    (i) > . In this case, we ensure that the sides of theminimum area rectangle in which all n items can be

  • 8/3/2019 Jose R. Correa and Claire Kenyon- Approximation Schemes for Multidimensional Packing

    9/10

    packed are at least . It is then enough to solve thedecision problem, taking = 2, for all rectanglesR such that:

    Their lower-left corner is (0, 0) and theirupper-right corner is on or below the curve

    xy = 4Sf(I) = 4 (since the NFDH shelf pack-ing heuristic can always pack I in a square ofarea 4Sf(I)).

    The coordinates of their upper-right cornerare at least .

    Their sides length are integer multiples of 2.

    The number of such rectangles can be evaluated as:

    Sf(I)/

    4Sf(I)

    xdx 1

    4=

    4Sf(I)

    4ln

    Sf(I)

    2

    =4

    4ln 1

    2

    1/3and max(ai, bi) > 1/2, that uses the minimum numberof unit squares. In this case our rounding techniques donot work. The following example illustrates this fact.Suppose we are given 4n rectangles: 2n of them withheight a little larger than 1/2 and width a little smallerthan 1/2, and 2n with width a little larger than 1/2 andheight a little smaller than 1/2. Can we decide in poly-nomial time if they all fit in n unit squares? Even more,Can we decide if they fit in, say, 1.1n unit squares? Thissecond question is related to finding hardness of approx-imation results for rectangle packing. As mentionedbefore, Bansal and Sviridenko [1] showed that unlessP = N P there is no APTAS for the classic two dimen-sional bin packing problem. Their work partially solvesthis question and gives good evidence that stronger in-approximability results can be obtained.

    Acknowledgments. The authors would like to thankDavid Johnson for many useful comments and sugges-tions regarding the presentation of the paper and forpointing out some minor errors.

    References

    [1] N. Bansal and M. Sviridenko (2004). New approxima-bility and inapproximability results for 2-dimensionalbin packing. These Proceedings.

    [2] E.G. Coffman, Jr., M. R. Garey, D. S. Johnson, andR. E. Tarjan (1980). Performance bounds for level-oriented two-dimensional packing algorithms. SIAMJournal on Computing 9, 808-826.

    [3] A. Caprara (2002). Packing 2-Dimensional Bins in Har-mony, In Proceeding of the 43rd Annual IEEE Sympo-sium on Foundations of Computer Science (FOCS02).

    [4] A. Caprara, A. Lodi, and M. Monaci (2003). FastApproximation Schemes for the Two-Stage, Two-Dimensional Bin Packing Problem. Research Report

    OR/03/6 DEIS.[5] W. Fernandez de la Vega and G.S. Lueker (1981). Bin

    packing can be solved within 1 + in polynomial time,Combinatorica 1, 349-355.

    [6] C.E. Ferreira, F.K. Miyazawa, and Y. Wakabayashi(1999). Packing squares into squares. Pesquisa Opera-cional 19, 349-355.

    [7] C. Kenyon and E. Remila (2000). A near optimalsolution to a two-dimensional cutting stock problem.Mathematics of Operations Research 25, 645-656.

  • 8/3/2019 Jose R. Correa and Claire Kenyon- Approximation Schemes for Multidimensional Packing

    10/10

    [8] D.J. Kleitman and M. Krieger (1975). An optimalbound for two dimensional packing. In Proceeding ofthe 16th Annual IEEE Symposium on Foundations ofComputer Science (FOCS75).

    [9] Y. Kohayakawa, F.K. Miyazawa, P. Raghavan, and Y.Wakabayashi (2001). Multidimensional Cube Packing,

    In Proceedings of the Brazilian Symposium on Graphs,Algorithms and Combinatorics (GRACO 2001).[10] J. Y-T. Leung, T.W. Tam, C.S. Wong, G.H. Young,

    and F.Y.L. Chin (1990). Packing squares into a square.Journal of Parallel and Distributed Computing10, 271-275

    [11] P. Novotny (1996). On packing of squares into arectangle. Archivum Mathematicum 32, 75-83.

    [12] L. Moser (1965). Poorly formulated unsolved problemsis combinatorial geometry. Mimeographed.

    [13] S.S. Seiden and R. van Stee (2003). New Bounds forMultidimensional Packing, Algorithmica 36, 261-293.

    [14] V. Vazirani (2001). Approximation Algorithms,Springer-Verlag, Berlin.