3
Volume 11, number 1 INFORMATION PROCESSING LETTERS 29 August 1980 ANIMPROVEDBLLOWERBOUND Donna J. BROWN* Coordinated Science Laboratory, University of Illinois, Urbana,IL 61801, U.S.A. Received 20 November 1979 Bin packing, algorithm, lower bound Two-dimensional bin packing is ubed to model such problems as allocating shared storage to parallel processes, cutting stock, etc. The problem, an exten- sion of the NP-hard one-dimensional bin packing prob- lem [7,8], was first proposed by Baker, Coffman and Rivest [2]. Given a finite list L of rectangles, pack each into a rectangular bin of finite width but un- bounded height so as to minimize t!le maximum height used. The size of each rectangle, denoted by the ordered pair (width, height), is known, and the packed rectangles can neither overlap nor can they be rotated. Various algorithms have been examined (see [ l-3,5,6]). In addition, lower bounds have been studied for classes of algorithms (see [4,9]>. This paper presents an improvement of a lower bound result in [2]. Baker, Coffman and Rivest [2] proposed the Bottom-up Left-justified (or simply BL) algurithm, which packs pieces in the order specified by a list L. Each piece is first placed in the lowest possible bin location, and it is then left-justified at this vertical height. The performance of the BL algorithm was measured by examining the ratio BL(L)/OPT(L), where BL(L) denotes the height used by the BL algo- rithm to pack list L, and OPT(L) denotes the height used by an optimal packing. It was shown that, in gen- eral, the ratio BL(L)/OPT(L) can be arbitrarily large. On the other hand, if the list is preordered by decreasing width, then BL(L)/OPT(L) < 3 in all cases. This leads to the question as to whether the BL algo- * This work was supported by the Joint Services Electronics Program (U.S. Army, U.S. Navy, and U.S. Air Force) under Contract DAAG29-78-C-0016. rithm may produce a non-optimal packing for any ordering used; this question was answered in the affir- mative by showing that there is a set of squares such that BL(L)/OPT(L) Z 12/( 11 + 2~) no matter what the ordering of L. We give here an improvement of this result for rectangles: there is a list L for which BL(L)/OPT(L) 2 5 for every ordering of L. Theorem. There exists a set of rectangles such that the ratio of the bin height used by the best BL packing to that of an optimal packing is at least 3. Proof. Consider a collection of eight rectangles, with sizes as follows: (3,2), (3,1), (3,1), (2,3), (2,2), (1,3), (I,2), (131). F or a bin of width 7, an optimal packing has height 4, as shown in Fig. 1. We first show that this is the only optimal packing (except for the ob- vious left-right and top-bottom symmetries illustrated in Fig. 3), aqd we then modify the example slightly in order to obtain the desired result. Consider the four disjoint (7,l) horizontal rows in any optimal packing. Let. the type of a row be a multi- 3- 2- 1 1 1 I 1 1234567 Fig. 1. An optimal packing.

An improved BL lower bound

Embed Size (px)

Citation preview

Page 1: An improved BL lower bound

Volume 11, number 1 INFORMATION PROCESSING LETTERS 29 August 1980

ANIMPROVEDBLLOWERBOUND

Donna J. BROWN * Coordinated Science Laboratory, University of Illinois, Urbana, IL 61801, U.S.A.

Received 20 November 1979

Bin packing, algorithm, lower bound

Two-dimensional bin packing is ubed to model such problems as allocating shared storage to parallel processes, cutting stock, etc. The problem, an exten- sion of the NP-hard one-dimensional bin packing prob- lem [7,8], was first proposed by Baker, Coffman and Rivest [2]. Given a finite list L of rectangles, pack each into a rectangular bin of finite width but un- bounded height so as to minimize t!le maximum height used. The size of each rectangle, denoted by the ordered pair (width, height), is known, and the packed rectangles can neither overlap nor can they be rotated. Various algorithms have been examined (see [ l-3,5,6]). In addition, lower bounds have been studied for classes of algorithms (see [4,9]>. This paper presents an improvement of a lower bound result in [2].

Baker, Coffman and Rivest [2] proposed the Bottom-up Left-justified (or simply BL) algurithm, which packs pieces in the order specified by a list L. Each piece is first placed in the lowest possible bin location, and it is then left-justified at this vertical height. The performance of the BL algorithm was measured by examining the ratio BL(L)/OPT(L), where BL(L) denotes the height used by the BL algo- rithm to pack list L, and OPT(L) denotes the height used by an optimal packing. It was shown that, in gen- eral, the ratio BL(L)/OPT(L) can be arbitrarily large. On the other hand, if the list is preordered by decreasing width, then BL(L)/OPT(L) < 3 in all cases. This leads to the question as to whether the BL algo-

* This work was supported by the Joint Services Electronics Program (U.S. Army, U.S. Navy, and U.S. Air Force) under Contract DAAG29-78-C-0016.

rithm may produce a non-optimal packing for any ordering used; this question was answered in the affir- mative by showing that there is a set of squares such that BL(L)/OPT(L) Z 12/( 11 + 2~) no matter what the ordering of L. We give here an improvement of this result for rectangles: there is a list L for which BL(L)/OPT(L) 2 5 for every ordering of L.

Theorem. There exists a set of rectangles such that the ratio of the bin height used by the best BL packing to that of an optimal packing is at least 3.

Proof. Consider a collection of eight rectangles, with sizes as follows: (3,2), (3,1), (3,1), (2,3), (2,2), (1,3), (I,2), (131). F or a bin of width 7, an optimal packing has height 4, as shown in Fig. 1. We first show that this is the only optimal packing (except for the ob- vious left-right and top-bottom symmetries illustrated in Fig. 3), aqd we then modify the example slightly in order to obtain the desired result.

Consider the four disjoint (7,l) horizontal rows in any optimal packing. Let. the type of a row be a multi-

3-

2-

1

1 1 I 1 1234567

Fig. 1. An optimal packing.

Page 2: An improved BL lower bound

Volume 11, number 1 INFORMATION PROCESSING LE’M’ERS 29 August 1980

=I containing the widths of the rectangles that the row intersects (i.e., the widths of the slices in that row). The only possible itypes are:

(a) (3,3,13, (b) 1392923, w I3,2,1,13, W 12,2,LL 1). Let a denote the number of rows of type (a). b the

number of rows of type (b), etc. There is a total of four rows, and so

a+b+c+d=4. (1)

Since there are three rectangles of width 3, of which one has height 2 and two have height 1, there must be four horizontal slices of width 3: two in each type (a) row, one in each type (b) row, one in each type (c) row. This gives us the equation

2a+b+c=4. (2)

Counting the number of width 2 slices and the number of width 1 slices gives equations (3) and (4), respec- tively: I

2btct2d=S, (3)

a+2c+3d=6. (4)

There are two sets of Integer solutions to(l)-(4): (i)a=O,b= l,c=3,d=O;

(iiJa= l,b= l,c= l,d= 1. We shall prove that (ii) corresponds to the only opti- mal packings.

We are guaranteed that there is a single (b) row in any optimal packing. Indeed, in order to be able to pack the (1,3) rectangle, there must be three consecu- tive rows with a 1 slice. Thus the type (b) row, which contains no 1 slice, is necessarily on the top or on the bottom. Without loss of generality assume (b) is the top row. Since (b) intersects two pieces of width 2, IX& the (2,3) and the (2,2) rectangles are in the top VW. Thus, the row next to the top must also intersect the (2.3) and (2,2) rectangles. Since there is only one (b) row, the rgw next to the top must be a (d) row. This eliminates solution (i) as a possibl I arrangement, and so we must have solution (ii). Because the (2,3) rectangle occu; ier; the top three row?, we conclude that the ro ~5 ? *z9 in order from top t;> bottom, (b), (d), (c), (a). Fr Jrn th is i is not difficult to determine , t the rows in wl-.ch each other piece is located (see Fig. 2).

38

{32,2} {22JJJ}

(3.2,1,1}

{3,3,1)

(b)j,

(d)

(cl

(a)

Fig. 2. Row locations of pieces, assuming the (b) row on top.

Examining Fig. 2, there are only two possible arrangements of the given pieces into a bin of width 7, and these are mirror images of each other (see Figs.

3(a) and 3(b)). B ecause we could have initially made (b) the bottom rather than the top row, we conclude that there are two additional symmetric packings, illustrated in Figs. 3(c) and 3(d).

We now modify the example slightly to prove the theorem. Suppose that we have the previous set of rectangles but with a ( 1 + e, 1) ret tangle replacing the (1 ,l) rectangle, and with a (1 + e, 2) rectangle replacing the (1,2) rectangle. Suppose also that the bin width is increased to 7 + 2~. Then we have the same four optimal arrangements as in Fig. 3, but in each case it is necessary to leave a gap somewhere in the bottom row: for the arrangement in Fig. 3(a), there must be a gap of width E between the (3,l) and the (1,3) pieces; for the packing in Fig. 3(b), a gap of width E between the (3,2) and (1,3) pieces; in Fig. 3(c), a gap of width 2~ between the (3,l) and (2,2) pieces; in Fig. 3(d), a gap of width 2e between the (3,l) and (2,3) pieces. (The locations of the needed gaps are indicated in the diagrams by 1.) No BL algo- rithm will leave such gaps; the best that a BL algo-

E iii (a) lb)

(d)

Fig. 3. All four (symmetric) optimal packings.

Page 3: An improved BL lower bound

Volume 11, number 1 INFORMATION PROCESSING LETTERS 29 August 1980

Fig, 4. An optimal BL packing of the modified example.

rithm could do is a height 5 packing such as that in Fig. 4. Therefore, we have BL(L)/OPT(L) >, 5.

Most work which has been done on two-dimen- sional bin packing analyzes the performance of an algorithm with a specified preordering. The result pre- sented here is of interest not just in the context of an analysis of the BL algorithm but because it gives a lower bound for performance even if the rectangles in the list can be ordered in the best possible way. Hopefully similar results will be obtained for other algorithms.

References

[l] B.S. Baker, D.J. Brown and H.P. Katseff, A i algorithm for two-dimensional bin packing, in preparation.

[2] B.S. Baker, E.G. Coffman and R.L. Rivest, Orthogonal packings in two dimensions, SIAM J. Cornput.., to appear.

[3] B.S. Baker and J.S. Schwartz, Shelf algorithms for two- dimensional packing problems, Proc. 1979 CISS, Johns Hopkins University, Baltimore, MD.

[4] D.J. Brown, B.S. Baker and H.P. Katseff, Lower bounds for on-line two-dimensional packing algorithms, Techni- cal Report, Coordinated Science Laboratory, University of Illinois ( 1980).

[S] E.G. Coffman, M.R. Garey, D.S. Johnson and R.E. Tarjan, Performance bounds for level-oriented two dimensional packing algorithms, draft (1979).

[6] I. Golan, Orthogonal oriented algorithms for packing in two dimensions, draft (1978).

[ 71 M.R. Carey and D.S. Johnson, Computers and Intracta- bility: A Guide to the Theory of NP-Completeness (Free- man, San Francisco, CA, 1979).

[8] D.S. Johnson, A. Demers, J.D. Ullman, M.R. Garey and R.L. Graham, Worst-case performance bounds for simple onedimensional packing algorithms, SIAM J. Comput. 3 (1974) 299-325.

[9] J.A. Storer, An improved lower bound for on-!ine packing with decreasing width, draft (1979).

39