You are on page 1of 17

Two- and Three-dimensional Parametric Packing

July 28, 2005


F. K. Miyazawa

Y. Wakabayashi

Abstract We present approximation algorithms for the two- and three-dimensional bin packing problems and the three-dimensional strip packing problem. We consider the special case of these problems in which a parameter (a positive integer) is given, indicating that each of the dimensions of the items to be packed is at most of the corresponding dimension of the recipient. We analyze the asymptotic performance of these algorithms and exhibit bounds that, to our knowledge, are the best known for this special case. Key Words: Approximation algorithms, asymptotic performance, packing.

1 Introduction
We present fast asymptotic approximation algorithms for special packing problems, parameterized by a positive integer . This parameter indicates that the input list consists of items (rectangles, boxes) whose each of its dimension is at most of the respective dimension of the recipient. These problems have many applications, specially in job scheduling. We consider the following problems:
$#!"  

1. Two-dimensional Bin Packing ( ) problem: given a list dimensions at most , and rectangles of unit dimensions of into a minimum number of bins.
$54"2"1 3 ! !  & ('%

of rectangles, each rectangle with , called bins, pack the rectangles

3. Three-dimensional Bin Packing ( ) problem: given a list of boxes with dimensions at most , , and boxes of dimensions , also called bins, pack the boxes of into a minimum number of bins.
This research was partially supported by CNPq (Proc. 478818/03-3, 306526/04-2, 308138/04-0 and 490333/04-4), and ProNExFAPESP/CNPq (Proc. 2003/09925-5). Instituto de Computacao Universidade Estadual de Campinas, Caixa Postal 6176 13084971 CampinasSP Brazil. Corresponding author. fkm@ic.unicamp.br. Fax Number: +55 19 3788-5847. Instituto de Matem tica e Estatstica Universidade de S o Paulo Rua do Mat o, 1010 05508090 S o Paulo, a a a a SP Brazil.

2. Three-dimensional Strip Packing ( at most , and a box packing is minimized.


0 ) 

) problem: given a list of boxes, with bottom dimensions , pack the boxes of into such that the height of the

$ ! !  0 2"2"198)

  "%

  



 76

We denote by , respectively , the One-dimensional Bin Packing and the Two-dimensional Strip Packing problems, both parameterized by and dened analogously to the above problems. Given an algorithm for one of the previous problems and a list of items for the respective problem, we denote by the height or the number of recipients (depending on which problem is considered) of the packing generated by the algorithm applied to the list . We denote by the corresponding value of an optimum packing. We say that an algorithm has asymptotic performance bound if there exists a constant such that for any instance we have . When , we say that has performance bound . Although it seems easier to deal with packing of small items (that is, the case is large), Li and Cheng [11] showed that: for any , there is no polynomial time algorithm for the problem with performance bound , unless P=NP. This result shows that, unless we consider the asymptotic case, performance bounds close to 1 are not achievable under the hypothesis that P NP. We show that, as most of the parametric approximation algorithms for packing problems, the algorithms for the problems we focus here have asymptotic performance bounds that tend to 1 as increases. Parametric packing problems have been investigated by many authors. For the problem, Johnson et al. [9] proved that the asymptotic performance bound of the First Fit (FF) algorithm is , . Johnson [7, 8] also presented other algorithms with asymptotic performance bound . Csirik [5] proved that the First Fit Decreasing (FFD) algorithm has asymptotic performance bound , when is odd, and , when is even, . For the problem, Coffman et al. [4] obtained an algorithm with asymptotic performance bound . For the problem, Frenk and Galambos [6] analyzed the parametric behavior of the HNF (Hybrid Next Fit) algorithm (they did not give an explicit formula). For this problem, we presented in [19] an on-line algorithm with asymptotic performance bound that can be made as close to , as desired. For the problem, Li and Cheng [10] designed an algorithm with asymptotic performance bound , , and in [19], we presented an on-line algorithm with asymptotic performance bound close to . In the same paper, we also presented an on-line algorithm for the problem with asymptotic performance bound close to . In this paper, we present approximation algorithms for the , and problems. The algorithms we describe for the rst two problems have asymptotic performance bound . For the problem, we show an algorithm with asymptotic performance bound . Both and are decreasing functions of . These results improve the bound obtained by Li and Cheng [10] and our previous results in [19]. The ideas presented in this paper are general in the sense that they can be extended to other problems or dimensions. In fact, they can be applied to the and problems, but they do not lead to bounds that are better than those given by the specic algorithms that have been designed for these two problems. For a survey on approximation algorithms for packing problems and some classic algorithms we mention here, the reader is referred to Coffman, Garey and Johnson [2, 3]. Other recent surveys on twodimensional packing problems have been presented by Lodi, Martello and Monaci [12] and also Lodi, Martello and Vigo [13]. Exact algorithms for the strip packing problem and the two-dimensional bin packing problem have been proposed by Martello, Monaci and Vigo [14] and Martello and Vigo [16], respectively. Martello, Pisinger and Vigo [15] also showed lower bounds for the three-dimensional bin packing problem. For a recent improved typology of cutting and packing problems, the reader is referred to W scher, Hauner and Schumann [21]. a 2
V  & D"   C x $ $  d  $ d    $  d  $ % d w"f7v#Gv"Y"iGDw'a7v dfGDw'fG  $ % d $ d wf`v V h 0 igW      % $tddvtd`$"d`G q6 $8GDwG  $ d  & D"% w T X x i flvt i rDflh~ f i hgkf e r f pl r f1}lhyhzn1lhy nf l{nkjh1ehf p ~ f| m f z fi o fe y w T i lvu f t   s k C"% r f Dj f i Df e khf eho nf lhkjhf e r rq p m f g fi g e      "% $  Q  UTSRPI u0 W d $  Q  I V X $  feHGcRba`YUTFE   & ('%   C  E      & D" E 7vd "f7'fiG $ d   d $ % d 6 qp fvw"FfG $ d  d $  d $ ivw$"dG d   y6x (&" $w$"f7v#dGvS$"cdvw$"cG  d $   % d $ "  6 yx V  r tsV E   C $  HGFE W E X V

An extended abstract mentioning the results of this paper has appeared in [20].

2 Notation
All packings considered here are orthogonal and oriented. This means that the items are packed in such a way that the edges of the items are orthogonal or parallel to the edges of the recipient; furthermore, each coordinates and the packing into the recipient agrees with this item is oriented with respect to the orientation. We denote by (respectively , ) the length (respectively width, height) of the item . Since the packings are orthogonal and oriented, we assume, without loss of generality, that the limited dimensions of the recipients have value 1. For the problem, we assume that all items have height not greater than a constant . If is a list of items consisting of rectangles (respectively boxes), given as an input for one of the problems, then we denote by the total area of the rectangles (respectively the total bottom area of the boxes) in . If is a packing, then we denote by the number of recipients used by . Given two packings and for the problem, we denote by the concatenation of the packings and . We denote by (respectively and ) the set of items with (respectively and ). We also use the following notation.
S X $   r dYGe ! T ! ! ! n c{  & ('% $  Tn G $  u  0 0 0 ! ! $  ! n ! !  X$Tntr X $  r CT n !  & S D'% $  UT $  Ge   S

3 Two-dimensional bin packing problem


In this section we describe an algorithm, which we call , for the two-dimensional bin packing problem. Before that, we present three other algorithms used as subroutines: , and . Let us consider rst the algorithm (Combine items in a rectangle). This algorithm is called with two parameters: a list and a list . The list consists of rectangles in and is a list that can be partitioned into two lists and , dened as follows: contains rectangles in , and contains rectangles in , where , are such that (i) , (ii) . See Figure 1 ( and correspond to and ). The algorithm rst generates a packing combining items of and of . At each iteration, packs items into a new bin. The packing in each bin is obtained by dividing it the algorithm into two smaller bins, and , the rst with dimensions and the second with dimensions . The algorithm packs up to items of into the bin . Then, it packs the items of in the bin using the algorithm (Next Fit Decreasing), that packs the items side by side in the -direction in decreasing order of width, until an item cannot be packed anymore. The packing of the lists and continues until all items of one of these lists are totally packed (see Figure 2). When this happens, the algorithm starts packing the remaining items of (if any) and the in an analogous way. In this case, a bin is partitioned into bins and , the rst with items of 3
2 R !   Y f l S) ! U R  f l    b) g H {! hq ! hq ) $ 2! yG   Y u  Yj    U    s0 Y)  j u R ) $ 2! ytP  Y)       f r tr l ! hq {! hq U U j

f

$ !  0 Dvc

X 5

$!7b 0

We use the symbol the set of rectangles

to denote the set of rectangles such that .

! h ! h ! h T2D#D42D

! T ! F( ! ! ! ! h ! h {#D42D

 0 ! n ! D ! 2"

such that

, and the symbol

for

and the second with dimensions . The items of are packed in the dimensions bin by the algorithm (the items are packed side by side in the -direction in decreasing order of length). When all items of or all items of have been totally packed, the algorithm returns a pair , where is the packing produced and the list is the set of items packed in . Before we present a result concerning the area occupied by the packing generated by the algorithm , we mention a result that will be useful in what follows. Lemma 3.1 Let be a packing of a list for the problem, such that in each bin, except perhaps in bins, the rectangles have total area at least . Then .
   R U  $ #"  ! j R   C  U j $  ! RRv $ y"1 ! S) D   

We call the value , in the lemma above an area guarantee of the packing to prove the next result.
f $  X $  j 'SeDRTyCv u Ryu 

. Using this lemma, it is easy , applied to the

Proof. We consider separately the area occupied by the items of and the items of , in each bin. In the packing , each of the bins that were used, contains at least items of , except perhaps the last bin. Thus, we can guarantee an area occupation of at least in these bins. Now consider the area occupied by the items of in one bin of type . Since the algorithm sorts by non-increasing order of width, the items of width in are packed before the items with width in . The

Another subroutine used by the algorithm is the algorithm (Hybrid Next Fit). Given an input list , the algorithm sorts the items in in non-increasing order of width. Then, it applies the algorithm (Next Fit) for the problem, to pack each item of into bins of unit length, considering only the length dimension. Each bin generated by the algorithm is considered as a . Then, the algorithm uses the algorithm to level of width 4
Pj     Y ) ) $  0 $ ) gTT   2 e 

C

each bin is at least , except perhaps in two bins. The analysis for bins with items of and items of is analogous. The proof follows from Lemma 3.1.
w T

fjtwq w T

d f t jwq

 fl f l # hq

at least

in each bin of type

(except possibly one). So, the area occupation in

f ! l Dh

of type

(except perhaps one). The packing of the items with width in

, occupies an area of

w T

f t jwq

f l hq

f j

packing of the items with width in

occupies an area of at least

in each bin

f ! l Dh

  

U

R

ad

f j C

w wT

f t lv'q

fj

R

U

Lemma 3.2 If sublists and


R

is a packing of , then

generated by the algorithm .

j

U

d $  X $  aC"HGyv

R

j

u

Figure 1: Sets

and

Figure 2: Combining items in

n D

and

pack the levels into bins of unit width, now considering only the width dimension. We denote by ( ) the algorithm which generates the application of the algorithm in the length (width) dimension and the application of the algorithm in the width (length) dimension. The following result holds for the algorithm .
 6 ! y 

Lemma 3.3 For any list of rectangles

, where

, we have

Proof. Consider the algorithm . The analysis for the algorithm is analogous. Let be the levels generated by the application of the algorithm, where . Since the length of an item is at least , each level has a length occupation of at least , except perhaps the last. Therefore,
 ! u2#2!  a $  6 $  f jT8GRT j k$ TalvjT  $  $ 5  $#RTw$t dyd$ Gwt $ Gw5  $  d  $  d d RTfy$ Gf$ T  d  $ l 6 $  HG

. Since each level has width at The levels are packed into two-dimensional bins using the algorithm most , each bin (except perhaps the last) has a width occupation of at least . Therefore,
t cj $  jT X $ $  C5lHG G#5   $ 

From inequalities (1) and (2), we have


d $  UG $tYv#5 $ n X $  UGe

In what follows, we present an algorithm which leads to packings with better area guarantee for the problem. It uses list partition and the algorithm . A LGORITHM Input: List of items . Output: Packing of into unit bins. 1. Partition the list into sublists
f ! !(h f Dh !  !  f Dh f  f ! !Dh ! f   ! f f 2"      P  2

  P

We are now ready to describe the algorithm

r #2l

$   q Te q $ Ge ! 0 "de $  GjTC

2. 3. 4. Return


for ;

yd

 d $  (fUT

5Y

$5G5 $ n

r 

2'

X $  UT

q 

(1)

(2)

  

d $  (fUT

n $ d  $ d yv#

2'

n e

} i p e

y 2#l 1 $  g T hq P   g ! !  0 y  hq Dh Dh f ! j ! j f  0 r  f ! j f ! l  0 

1   $ y T hq P    D y ! ! 0 ! $  GjG  222"`l ! !  0 g  (h hq Dh f f !  0 q  ! l j f f  0  ! j ! l

q   

 f   $ q G j Y  $ G l Y f    $ G

1 q f !  y0 l !Dh (h  y0 ! F !Dh fj (h  y0 ! f l ! f l

  uuG $  !  Du {! hq ! hq ! hq f ! l w f s hq jk f i vu t hq j Dl f i Df e i r f r

rq fp kh1lho m  

A LGORITHM Input: List of items Output: Packing of

  P

1.

$  0 Fvyb

$  0 FG

2.

 DRR   $  ! RjDv  t U {! hq f j  u !

6. 7. Return

5. else

3. 4. If

then

. into unit bins.

Figure 3: List subdivision when

Figure 4: List subdivision when

 DugH

 Duu

Lemma 3.4 For any list of rectangles

, we have

6
X $  HG 2   P 

The next result will be useful in this section and in the others (see [19]).
r r r h h 5 !  ! ! wu

Lemma 3.5 Suppose

are real numbers such that

and

Proof. First, note that the packing is an asymptotic optimum packing for the list . It sufces to note that in all bins of , except perhaps in bins, there are at least rectangles of in each bin. Moreover, we cannot have more than rectangles of this type in each bin. That is,
 d $  Q  I X UTSRPy$  v D ! f j ! f l 

From Lemma 3.2, we have that the following inequality holds.


d

Now we analyse two cases, according to steps 4 and 5 in the description of the algorithm. Case 1: (all rectangles of have been packed in ). We analyze each of the packings and . The packing is generated by applying the algorithm to the list . Since each bin of has rectangles, except perhaps the last, and the area of each rectangle is at least , the occupied area is at least . Thus, by Lemma 3.1 we can conclude that (5)
f t lvwq d X

Since

, from (4) and (5) we have


d (f$  RT d yi X C$  v w T

Therefore,

% !  0 D(e

h d Dy$ 1RT 

! d $  GjT

 d f

 d

X $ v 

X $  v

For the packings and From Lemma 3.4, we have


, the analysis is also based on the area guarantee obtained in each packing. for

F  R v U 0 $ G{'aifd #ad $ d   $ d h 

$ d  7v"

$ydvn% 

d "$

 T

d7 eDRTyCF  $  X $ 

d yi

% "ad

! q w!

X C$

$ d  yiG

 v

u

d  d f7fd d

fl

 DuyR

 {0

f l i l

where

!  d $  Q  (yUTcRPI

V X $    UT P

 

Theorem 3.6 For any list

, we have

  Y

The following result holds for the algorithm


! ! 0 #2#2"p

U

Proof. The proof follows easily from the fact that for each sublist guarantee of at least .
$ d  $ d  yv#n

) we have an area

. Then

d HX

dd  !  d 
q

(3)

(4)

(6)

(7)

% d Dy$ 1RT 

X $ v  X

w T w T f lt lhq t f i hq

! d $  "vjT !D%!(0e   fd$ uG d 7 4   d 7 d $

. where Case 2: (all rectangles of have been packed in ). In this case, the proof is analogous to the previous case. Thus we omit the details and simply mention the inequalities that can be obtained.

! d $  Q  (HGSuPI

 d d ! "  f7 d  7 !  5UTSRPI  6 $  Q 

 d f d yi 6  d  $ RG$ RTuUT  d  0 $  6 $  Q  HGSuPI   h 5l$ 1vv  0  al$ vv  0 

From (8) and using the denition of

Let and Since

$UTy6$UTSRPI  Q 

As

be dened as and , from (6), (7) and the denition of

in (3) we obtain

, we have

for

and

for

1 ! 0 D(e

d $  fvjT

% $ d  $ d % yiG#yiT

X $  GF X $  GF X $ X $  v  v

 G

U  R u )0 f f  l d  l ! ('w$ $d %70 V  &   i V X $  F d $

 $d #iu$ v$ FHv  0  d  0 $ 

Dening have

Now using Lemma 3.5 we can obtain bounds for and , and conclude that both are at most . This completes the proof of the theorem. We observe that the values of and were dened in such a way that in both cases (1 and 2) we obtain the same asymptotic bound.

!  d $  Q  DyUTcRPI C V X $

Since

and

as

, from (13) and (14) we obtain

and

% 

$ vv  0 

 0 vv

where

7  " 6d  l ! 54w$ $d %70 V f  3  

8 . , and proceeding as in case 1, we . , we have (14) (13) (16) (12) (11) (10) (15) (9) (8) (17)

4 Three-dimensional strip packing problem


In this section we use basically the same list subdivisions used in the algorithm to obtain an algoproblem with the same asymptotic performance bound. rithm for the We rst present the subroutines used by the main algorithm. One of the subroutines is the well-known algorithm (Next Fit Decreasing Height), described in [11]. We denote by the version of the that packs the boxes side by side in the -direction, and by the version that generates strips in the -direction. Now, let us describe the subroutine to pack lists , which we call . This algorithm sorts the list in decreasing order of height and partition it into lists , such that and , for and , for . Then it packs each list into only one level, using the algorithm . Finally, it returns a packing that is the concatenation of all the levels that were generated. In what follows we shall use the next result, that holds for level-oriented packings (see [17, 18]).
  P 2  & D'% f j

. Then

The value in the above lemma is called volume guarantee of the packing . We are now interested in the volume guarantee of the packing produced by the algorithm . To obtain this, we need the next result, that is an extension of the result presented in [10]. We leave the proof to the reader.
0 $  uUT X $  r UT5h 

Lemma 4.2 If Lemma 4.3 If

is a list with

, then

We describe now an algorithm, called , that produces an asymptotic optimum packing for items in a list . This algorithm generates a packing consisting of columns. Initially, all these columns are empty. The items are then considered in the order given by and packed in a column of smallest height. The following holds for this algorithm.
! f l ! f j 

Lemma 4.4 If

then
d $  Q  I X $  a I fUGcuPyUTH'

and


& % '

We describe now the algorithm

to pack lists

Proof. Since the packing is level-oriented, each level with area occupation of at least the result follows by applying Lemma 4.1.

C

d $  UTX

2"

sYn n

 & D'%

is an instance for the


X $  UT 2

problem, then

P I! 4F2#2! I

6cV $ I 

8 `

d $  X X $ CwUTYCv W ! ! 0 tSF##22"dl  6 I 2 $  SQ f cIUe$TnhcUFlTnTR  &  ('%

Lemma 4.1 Let such that

be an instance of

and

be a packing of , and

consisting of levels for a given constant

2#2"e @! ! 0  R22e s  0

Pj

$  G E C A d $  7$ f jTHFDBavRG  ! u#22#!  y

8 9

Pj

d $  UT

a I '

  X $  a I bUTU' d y7

@! ! 0 2#2"e

8 `

f l !

R

2"

2"

Pj

X $  qvjG 

Pj j

$ 3 ! 54 2"1i0 c54"170 S) !  ) ! $ 3 ! !  ! $ 3 ! !  5"2s1i0 c54"#(v70 S) ) ! $ 3 ! !  ) S) ) ) )

$ 3 ! !  0 54"2 7)

Proof. It sufces to note that the packing of each sublist has a volume guarantee of at least The additive term comes from the additive terms of the inequalities obtained for the lists

 ! y 222!  $ $ d  $ d  yv# "

'1d$HGX T w w T f t4 f t

2"

y   r 

f f ! !

!Dh f (h !  !  f f (h !  f (h f

f (h ! f !

 f ! f !(h ! f   ! f 

A LGORITHM Input: List of items Output: Packing of

2"

 

1. Partition the list

& % "Y

2. 3. 4. 5. 6. Return

Figure 5: Partition of the input list performed by algorithm

& % 'Y

kd e }

i 1d | p i

into sublists (see Figure 5):

for for .

! % 0 4(e !  ! 0 w(4"e

y 22e  $ 8 y T f f ` $  GjG"Pj $  vjTPj

. into a box with unit bottom.

i Gc Gc

Lemma 4.5 If

The equivalent result for Lemma 3.2 can be obtained using a similar algorithm for , which we denote by . To generate a combined packing, the bin is divided into smaller bins. In one case the bin is divided into bins and and in the other case, the bin is divided in bins and . The dimensions of these bins are the following

  

then

10
& % ' '1

. .

X $  UG

& % '

y  

g  q  

, where and . The algorithm rst generates a packing combining items of and and then, a packing combining remaining items of and items of . The nal packing is the concatenation of and . The packing is produced as follows: Start empty packings into boxes and . Note that and are parts of the same bin . The packing in the bin is performed by the algorithm . To generate the packing in the bin , the list is rst divided into two sublists and . The list contains the items with width in and the list contains the items with width in . Both lists are sorted in decreasing order of height. The list is packed by the algorithm , for the problem, considering only the width dimension. In this case, each bin leads to a level of the packing in the bin . At each iteration the algorithm choose the packing with smallest height. If it is the packing in the box , it packs the next box of into the bin using the algorithm . If the chosen packing is in the box , the algorithm packs a new level of items in using the algorithm . The algorithm stops when the list or the list is totally packed. Then, it continues to pack the remaining items of and the items in in analogous way, in this case with bins and .
i g p n he f i $ n  'aRT d $  u RsDU  XC$lDv D

Lemma 4.6 Let and . Then


u u

be a packing of

generated by algorithm .
 & D'%

applied to sublists

We are now ready to describe the algorithm for the problem. It uses the same list subdivision performed by the algorithm , generates partial packings for each sublist, and produces a nal packing that is the concatenation of these partial packings. A LGORITHM Input: List of boxes Output: Packing of 1. 2. 3.
& % '   Y

4. If

then (see the subdivision in Figure 3).


q  f ! l !Dh (h ! ! F Dh fj (h ! ! ! ! f l ! f l  y0

11

 f & % $ q G j ' q  $ G l ' f & % u  a I $ GC'

$  0 Fvyb

 DRR  uDR  $  !  & % $  ! RjDv uuG ' ! hq {! hq t U {! hq ! hq f f  u ! l ! j w f s hq jk f i vu t $  0 FG hq i Dl f i Df e kh1lho m r f r rq fp

$ 3 ! !  0 54"#" i)

. into a bin

0 u

f ! h l D

a I '

a I '

S)

R

S)

& % ' )

) S D D t T! hq ! hq u U  S) 0 

f l !

f l

e fU
) 

R

u

j  

u

! j

f ! hq {! hq R U f j ) ) ) )

1  y0 q 

 y0

  $  UT "Y & %

j

DS

u

DS

& % ' 

The algorithm
  S)

receives as input two sublists: a list

and a list

  

R

R

  

x yq E

% "

'1

  P

& % "Y

, we can use basically the inequalities presented in the To prove the next result on the algorithm proof of Theorem 3.6 with the additive term multiplied by . The only difference is for the two packings obtained with the algorithm . In this case, the additive constant is (see Lemma 4.5). The corresponding additive constant for the algorithm is 5 (see Lemma 3.4). We leave to the reader the proof of the next result.

& % '

| p

i n

n e

s t

u 5
} e i n n

wvvvvvvvvvvvvvvw w w w w w w w w w w w w w w vvvvvvvvvvvvvvvv s wwwwwwwwwwwwwwv 5 wwwvwvwvwvwvwvwvwvwvwvwvwvwvwvw vwwwwwwwwwwwwwwv wvvvvvvvvvvvvvvwvw vvvvvvvvvvvvvvvv wwwwwwwwwwwwwwv wwwvwvwvwvwvwvwvwvwvwvwvwvwvwvw vwwwwwwwwwwwwwwv wvvvvvvvvvvvvvvvw wwvw vvwwwwwwwwwwwwww wwwwwwwwwwwwwww vwwwwwwwwwwwwwwv vv p vv vv vv vv } vv vv vv vv vv vv vv vv vv wvw n wwvwvwvwvwvwvwvwvwvwvwvwvwvwvvw vvv v v v v i v v v v v v v v v wwwwwwwwwwwwwww vwvvvvvvvvvvvvvvv e wvvvvvvvvvvvvvvwvw wwwwwwwwwwwwww vwvvwvwvwvwvwvwvwvwvwvwvwvwvwvwv wwwwwwwwwwwwwwww vvvvvvvvvvvvvvv vwv

qrqr qr rr q qrq i

y  y  r  

y #2l  & % $ y T hq 'Y % !  0 ! $  vjGPl w!D(l ! !  0 hq Dh Dh f ! f  0 l ! l f ! j f ! l  0

1   $  g T hq "Y & % g U  a I $ TU' ! !  0 g  (h hq Dh f f !  0 q  ! l j f f  0  ! j ! l

6. 7. Return

5. else (see the subdivison in Figure 4)

n e

Figure 6: List subdivision when

Figure 7: List subdivision when

 DugH

 Duu

Theorem 4.7 For any list

We describe in this section the algorithm for the problem. This algorithm uses two other algorithms as subroutines: and . The algorithm is basically the algorithm (Hybrid 3D), described in [19], that uses the same strategy used by the algorithm HFF (Hybrid First Fit) presented by Chung, Garey and Johnson [1]. The algorithm calls two other algorithms: and . The algorithm can be any levelproblem and can be any algorithm for the problem. First, it oriented algorithm for the
x yq E % "   "%  % "  % " 2  % " 2  % "

  e 

! h  d $  Q  UUTcRPI

V X $  & % UT "Y 

where

yiGc $ d  

d h  7d 2d q

5 Three-dimensional bin packing problem

of boxes,

we have

12

 & ('%

% "fd r

d  d d d

 0

generates a packing of divided into levels using the algorithm ; then it uses the algorithm to pack into bins the levels that were generated. For each choice of the algorithms and , we obtain a different algorithm. The algorithm corresponds to the algorithm , where and . The following result can be proved using arguments based on minimum area occupation in each level guaranteed by the algorithm and volume guarantee of the algorithm .


Lemma 5.1 If

then
d $  2UGX  $ d  $ d  $ d yGyv# X $  UT 2  % "

combines two lists, say and . The list consists of items in the . The list contains boxes such that set , where . The list contains the boxes with . The list contains the boxes with , and the list is the list . The algorithm generates combined packings, each one with items of and items of one of the sublists of . To pack items of and , the algorithm subdivides each bin into two smaller bins: and . At each iteration, it packs boxes of into a bin and uses the algorithm to pack items of into a bin . In this case, it considers each item of and the bin as a two-dimensional item with - and -dimensions. This step is repeated until all items of or all items of are totally packed. The algorithm performs analogous steps to combine the remaining items of (if any) with items in and in . The algorithm halts when all items of or of are packed. It returns a pair , where is the packing produced and the list is the set of items packed in . The following result holds for this algorithm.
 % " flvwq t q u fl 'c RGUCv $  X X $  R Du D

Proof. Consider the packing obtained by combining items of and (into bins of type and ). has volume guarantee of at least (considering only the From Lemma 3.4, each bin of type and -dimension), except perhaps 5 of these bins. Thus, each bin of the combined packing (of and ) , except perhaps 6 of them. The same analysis has a volume guarantee of at least holds for the packing that combines items of with items in and in , and this gives us the desired inequality.
j S)  ) # fl  R  C i w T flwq t U f l 0 ) hq

2. 3. 4.

w q hf i Df t i {z i {z e Djh~ f i hkf e r f e r kjhhnf ehy m r f g~ p f} yz | $ ! !  0 22" i) 

into bins

$  !  ulRT  % $  ! RRv "  s4GnG4TeTRtr hq  X $  ! $  ! $   SQ u f f f ! l ! j F! l  R

e 

A LGORITHM Input: List of boxes Output: Packing of 1. Let


$  0 Fvc $  0 Fva  % Y

13

 ad

w T i

U

Lemma 5.2 If sublists and


R

is a packing of , then

generated by the algorithm .

applied to the

hq

H

U

u

 8

 % "

q $ ! !  0 2"2 8)

u

X $  qG R

U   r 8r j R j 8U   0 u U

$  ! DRRv 

  P $#!"2!5b  0 )  u U

f j

 % "

R

$ j jTU   X $  Te X $  ! $  ! $   SQ 94TT4Gep fl ! j w! j f f  % "

The algorithm

& % "Y0

x yq E E


& % '

x yq E

% "

x yq E

jj

 % "

u

2"

$ ! ! 2"2v

U

jl0 u

Du R

E
) R

! d $ w T i

f l

 Q  I X RTSRPyC$

fl "

Proof. Let us consider the two possibilities corresponding to steps 6 and 7 of the algorithm. Case 1: In this case, the packings and have volume guarantee of at least . Note that has boxes in each bin (each box with a volume of at least , except perhaps the last). From Lemma 5.2

f j

fjtwq d q w T f i jt e

w T f i jt i r f Djh~ f i hkf e r 1e r f lhhn1ehy m f j{nklh1lhf p g~ fp } yz f| f z fi o fe y ! h d $  Q  DUGRPI x X $   % 5UT "

$  Fv

$  FG

The proof of the next result is analogous to the proof for the algorithm . Therefore, we omit the details and present the inequalities with which we can prove the desired result. We note that and that the values of and in step 1 are chosen so as to obtain the same asymptotic performance bound for both the cases 1 and 2 analysed in the proof (corresponding to steps 6 and 7 of the algorithm).

f l

  P

s  G $ ! 0 !222e  o

1 k #2l k Uk D  G hq "  % $ s  %  $ o G hq " hq "  % o s k ! $ jT     0  $ o GS hq s  0   0 o  hq hq f ! f ! f !  j j F j 0 ~  f !  f f ! ! l j F j 0 z  f ! f f !  l ! l F j 0 y  f ! f ! f  l l F( ! l 0 g  f f  ! fl ! j F( ! l 0 r  f f ! f  ! j l F( ! l 0 q  f f f !  ! j ! l F j 0  f f f ! ! l ! j ! l  0  1 r !  f l ! r   % % 0   0

r 2#l !U$ r T l  f $ T l f $  Tc j f j f

 $ q T  f j !

  % f j " q R $ G   0 q  fl f l  0 

Theorem 5.3 For any list

5. 6. If

 DRR  Du 

8. Let 9. Return

7. else

. then

of boxes, where

e 

we can conclude that the packing

f l

r $  FG

where

has a volume guarantee of

14
4  v

, we have

. Thus,

 DuyR 0

and

The other packings ( , and ) have volume guarantee of at least inequality can be proved for the packing :
$ d 7v $  d $ d "7G yiG 1 X $ 1v  r q

Proceeding as in the proof of Theorem 3.6, we can show that (18) . . That is,
! 1 d $  Q  (UTSRPI 5F x X $ 

For the remaining packings, we obtain a volume guarantee of


X $ 

Analogously to the previous case, we can prove that (19) . . Using


x x ex w T w T 7 f f  Tiw lvt d  e jt !  3  $d   e f jt i ! 1 d $  Q  eDUGRPI 5 x X $ 

Using Lemma 3.5, we can obtain bounds for and and conclude that both are at most this, the result follows from the inequalities (18) and (19).

6 Final Remarks
Table 1 shows the asymptotic performance bounds (correspondly or ) of each algorithm, for . The algorithms presented in this paper are marked with a . As a nal remark we observe that all ideas applied for the problems presented here can be extended for packing problems of higher dimensions.
0 x V

References
[1] F. R. K. Chung, M. R. Garey, and D. S. Johnson. On packing two-dimensional bins. SIAM Journal on Algebraic and Discrete Methods, 3:6676, 1982.

15

0 x

where

w T f w Ti lt f t i lvl y$ d

$ d vyv d $ RTX  $ d 1yiG

 RTX

and
q $ d 7v X C$ 4  v

. Therefore,

!d$ RTSRPyC$ v  Q  I X  4 w T e lvt f e

Case 2: . In this case, we have a volume guarantee of at least


 R u

w 7"  w lvt i T jt f Tfw

0 x

where

for the packing

w w T f wf Tlvt i jt f t i jj

 d "a$ 1RTX 

d y$

f lt i

 RGX

q 7v $ d

T w f  i lvt U! 54R $d  3   e e

X C$

 v

. Hence, the following

! ! 222"

[19]

[19]

3.383 3.250 3.050 3.250 3.050 6.25 6.023

2.847 2.112 2.028 2.112 2.028 3.112 3.016

1.954 1.730 1.684 1.730 1.684 2.285 2.233

1.646 1.540 1.512 1.540 1.512 1.915 1.883

1.489 1.428 1.409 1.428 1.409 1.708 1.686

1.394 1.354 1.340 1.354 1.340 1.576 1.560

1.329 1.302 1.291 1.302 1.291 1.486 1.473

1.283 1.263 1.254 1.263 1.254 1.419 1.409

1.248 1.233 1.226 1.233 1.226 1.369 1.361

[2] E. G. Coffman, Jr., M. R. Garey, and D. S. Johnson. Approximation algorithms for bin packing - an updated survey. In G. Ausiello, M. Lucertini, and P. Serani, editors, Algorithms design for computer system design, pages 49106. Springer-Verlag, New York, 1984. [3] E. G. Coffman, Jr., M. R. Garey, and D. S. Johnson. Approximation algorithms for bin packing: a survey. In D. Hochbaum, editor, Approximation Algorithms for NP-hard Problems, chapter 2, pages 4693. PWS, 1997. [4] E. G. Coffman, Jr., M. R. Garey, D. S. Johnson, and R. E. Tarjan. Performance bounds for level oriented two-dimensional packing algorithms. SIAM Journal on Computing, 9:808826, 1980. [5] J. Csirik. The parametric behavior of the rst-t decreasing bin packing algorithm. Journal of Algorithms, 15:128, 1993. [6] J. B. Frenk and G. Galambos. Hybrid next t algorithm for the two-dimensional rectangle bin packing problem. Computing, 39:201217, 1987. [7] D. S. Johnson. Near-optimal bin packing algorithms. PhD thesis, Massachusetts Institute of Technology, Cambridge, Mass., 1973. [8] D. S. Johnson. Fast algorithms for bin packing. Journal of Computer and System Sciences, 8:272314, 1974. [9] D. S. Johnson, A. Demers, J. D. Ullman, M. R. Garey, and R. L. Graham. Worst-case performance bounds for simple one-dimensional packing algorithms. SIAM Journal on Computing, 3:299325, 1974. [10] K. Li and K-H. Cheng. On three-dimensional packing. SIAM Journal on Computing, 19:847867, 1990. [11] K. Li and K-H. Cheng. Static job scheduling in partitionable mesh connected systems. Journal of Parallel and Distributed Computing, 10:152159, 1990. [12] Andrea Lodi, Silvano Martello, and Michele Monaci. Two-dimensional packing problems: a survey. European J. Operational Research, 141(2):241252, 2002. [13] Andrea Lodi, Silvano Martello, and Daniele Vigo. Recent advances on two-dimensional bin packing problems. Discrete and Applied Mathematics, 123:379396, 2002. [14] Silvano Martello, Michele Monaci, and Daniele Vigo. An exact approach to the strip-packing problem. INFORMS Journal on Computing, 15(3):310319, 2003. [15] Silvano Martello, David Pisinger, and Daniele Vigo. The three-dimensional bin packing problem. Oper. Res., 48(2):256267, 2000.

16

! ! 0 22#"

Table 1: Asymptotic performance bounds of the algorithms for

 Y0

1 Y0

% 0

 0

0 d

Prob.
     "%  & D'%

Algorithm [6] [19]

$  %  "GV $ TV % $ & %  'GV $ GV  Q $ YGV    $ {V  $  RTV

[16] Silvano Martello and Daniele Vigo. Exact solution of the nite two-dimensional bin packing problem. Management Science, 44(2):388399, 1998. [17] F. K. Miyazawa and Y. Wakabayashi. An algorithm for the three-dimensional packing problem with asymptotic performance analysis. Algorithmica, 18(1):122144, 1997. [18] F. K. Miyazawa and Y. Wakabayashi. Approximation algorithms for the orthogonal -oriented 3-D packing problem. SIAM Journal on Computing, 29(3):10081029, 2000. [19] F. K. Miyazawa and Y. Wakabayashi. Parametric on-line algorithms for packing rectangles and boxes. European J. Operational Research, 150:281292, 2003. [20] F. K. Miyazawa and Y. Wakabayashi. Two- and three-dimensional parametric packing problems. Electronic Notes in Discrete Mathematics, 19:313319, 2005. Proceedings of GRACO: Brazilian Symposium on Graphs, Algorithms and Combinatorics. [21] G. W scher, H. Hauner, and H. Schumann. An improved typology of cutting and packing problems. Technical a Report Working Paper 24, Otto von Guericke University Magdeburg, 2005.

17

You might also like