Proceedings of the 13th IFAC Symposium on Information Control Problems in Manufacturing Moscow, Russia, June 3-5, 2009
Lower Bounds for the 2D Strip Packing Problem: Linear and 1D Contiguous Relaxation K.M. Kartak ∗,∗∗ M.A. Mesyagutov ∗,∗∗∗ R.S. Valeev ∗,∗∗∗∗ ∗
Numerical Mathematics Department, Ufa State Aviation Technical University. ∗∗ e-mail:
[email protected]. ∗∗∗ e-mail:
[email protected]. ∗∗∗∗ e-mail: aida
[email protected]. Abstract: The two-dimensional strip packing problem is under consideration. Two lower bounds for the problem are proposed, an improved Linear Programming-based lower bound and an exact solution of the contiguous relaxation of the problem, which is solved by Branch and Bound algorithm. The computational study shows the efficiency of the bounds and the good performance of the exact algorithm. Keywords: Branch and Bound, Integer Linear Programming, Dynamic Programming 1. INTRODUCTION
2. BEASLEY MODEL OF 2SP
Given a set of indexes I = {1, ..., m} of m rectangular items, each having width wi and height hi (i ∈ I), and a strip of width W and infinite height, the two-dimensional strip-packing problem (2SP) consists of orthogonally packing all the items, without overlapping, into the strip by minimizing the overall height of the packing.
To solve the 2SP problem we consider the following model, which generalizes the one of Beasley (1985): H −→ min, (1) s.t. H−h Xi +1 x zis = 1, i ∈ I, (2) s=1 W −w Xi +1
The problem has many real-world applications in cardboard, paper, glass, and metal industries whenever the stock to be cut comes in large rolls, which can be considered to have infinite height. In some applications the items cannot be rotated. For instance, cutting items from wooden boards has to take into account the wood grain. In other applications, for instance cutting items from steel, rotation is allowed. In our case, it is assumed that the items have fixed orientation, i.e., they cannot be rotated. The 2SP problem belongs to the class of N P-hard in a strong sense problems. Branch and Bound method is the most successful exact approach for problems of this class. Branch and bound uses methodology of so-called, lower and upper bounds, which exert influence on the efficiency. Thus, the stronger a lower and an upper bound is applied so, fewer the number of nodes is created and processed. A lot of lower bounds are known. Simple bounds, derived from immediate geometric consideration, e.g., volume bounds, Lagrangian and/or continuous relaxation of Integer Linear Programming (ILP) models by Padberg (2002), and dual-feasible functions (DFF) by Fekete and Schepers (2004). There are more complicated lower bounds, see Alvarez-Valdes et al. (2008). In this paper two types of lower bounds are proposed, namely an improved Linear Programming-based lower bound and an exact solution of the one-dimensional contiguous bin packing problem.
978-3-902661-43-2/09/$20.00 © 2009 IFAC
y zis = 1, i ∈ I,
(3)
s=1
P i∈I
wi
s P
x zit ≤ W, with
t = max{s− hi + 1, 1}
1 ≤ s ≤ H − min hi + 1, (4) i
P i∈I
hi
s P
y zit ≤ H, with
t = max{s− wi + 1, 1}
1 ≤ s ≤ W − min wi + 1, (5) i
where H is a height of the strip. For each possible position s ∈ Z+ of item i ∈ I and each dimension x and y in the container we define boolean y x variables zis and zis : x zis ∈ {0, 1}, i ∈ I, 1 ≤ s ≤ H − hi + 1, (6) y zis ∈ {0, 1}, i ∈ I, 1 ≤ s ≤ W − wi + 1. (7) Equations (2) and (3) state that each item is packed exactly once. The knapsack conditions (4) and (5) are onedimensional. y x Let us introduce boolean variables δij and δij indicating whether the projections of items i and j onto the x and y y x axes intersect. So, ∀i, j : 1 ≤ i < j ≤ m, δij and δij are:
2007
10.3182/20090603-3-RU-2001.0518
13th IFAC INCOM (INCOM'09) Moscow, Russia, June 3-5, 2009
min{s + hi − 1, H − hj + 1} x δij = max
1≤s≤H
n x zis +
X
o x , zjt
(8)
o y zjt ,
(9)
t=max{s−hj +1, 1} min{s + wi − 1, W − wj + 1}
n y y δij = max zis + 1≤s≤W
X t=max{s−wj +1, 1}
By combining equations (1)–(9) and applying: y x ≤ 3, 1 ≤ i < j ≤ m, δij + δij
(10)
we obtain a valid ILP model of 2SP. Note that in the model (1)–(10) we can compute the coordinates of the items in dimension x and y as: xi =
H−h Xi +1
x s · zis ,
i ∈ I,
Proposition. The system (2)–(9) is feasible and lby ≤ W .
The number lbx is a lower bound for 2SP, which can be improved by applying inequality (10). The non-overlapping condition (10) means that in a feasible packing, every two items (p, q) are disjunct along at least one axis. If we relax this packing to a set of x, y relaxations, items p and q can be in the same patterns only in one relaxation and must not occur together in patterns in other dimensions. The question is whether such dimension can be fixed for a given (p, q). Let (p, q) : 1 ≤ p < q ≤ m be item pairs. We can forbid all patterns containing pair (p, q). Similar to (14), define the improved LP lower bound with forbidden pairs (p, q): nX X 1CSP z(p,q) = min yj : cij · yj = bi , i ∈ I;
(11)
j∈J
yi =
y s · zis ,
i ∈ I.
(12)
s=1
The pseudo-polynomial number of variables makes its exact solution difficult. We have implemented the model using the concept of reduced raster points of Terno et al. (1987) to reduce the set of possible coordinates. But for problems even with only 10 items, CPLEX 9.1 needs a very long time. Especially, if the container is a bit larger than the optimal size, the solver needs much more time to find a feasible solution than for the optimal size.
An instance of the one-dimensional cutting stock problem (1CSP) is defined by (W, w, b) where we produce bi copies of item wi , i ∈ I, from the minimal number of bars of length W . Let columns of matrix C = (cij )j∈J i∈I represent all possible binary cutting patterns, which are defined by the binary knapsack condition: X wi · cij ≤ W, cij ∈ {0, 1}, i ∈ I, j ∈ J. (13)
and relaxations with forbidden pair (p, q): 1CSP W, w, h , lbx(p,q) = z(p,q) 1CSP H, h, w . lby(p,q) = z(p,q) Thus, for any feasible packing, any pair (p, q) can be in solution of the bar relaxation only in one dimension. Then, the 2SP is infeasible if there exists pair (p, q) that has to be in a solution of two dimensions: lbx(p,q) ≥ H, and lby(p,q) ≥ W.
Procedure Probing for 2SP Set H = lbx is a lower bound for 2SP. While ∃(p, q) : lbx(p,q) > H and lby(p,q) > W do set H = H + 1. The improved lbx(p,q) is used as a lower bound for 2SP problem. 4. EXACT APPROACH FOR THE 1CBP PROBLEM
i∈I
Here, we restrict the product of each type to be once in a pattern (cij ∈ {0, 1}) because in the case of 2D problems we can obtain only such patterns. In fact, this is a small difference to the standard 1CSP. The set-partitioning formulation of 1CSP by Gilmore and Gomory (1961) is as follows: nX z 1CSP (W, w, b) = min yj : j∈J o X (14) cij · yj = bi , i ∈ I, yj ∈ Z+ , j ∈ J . j∈J
lbx = z 1CSP W, w, h
(15)
the optimal value of the x integer relaxation and denote: lby = z 1CSP H, h, w (16) the optimal value of the y integer relaxation.
(17)
This can be made by the following procedure:
3. CONTINUOUS RELAXATION & PROBING
Let denote:
j∈J
o yj ∈ R+ , yj = 0, ∀j : cpj · cqj = 1
s=1 W −w Xi +1
⇒ lbx ≤ H,
Let us consider a problem, which is closely related to the 2SP. Given an instance of 2SP we formulate the following problem. Consider, for each i ∈ I, hi items of size wi × 1 and unlimited number of bins W × 1. For each i ∈ I all items wi ×1 have to be packed contiguously into the bins in order to find a set of packed bins with a minimal size. Each item can be packed only once into a bin. This problem is called the one-dimensional contiguous bin packing problem (1CBP). The problem in another formulation of the onedimensional contiguous cutting stock problem (1CCS) firstly was studied by Martello et al. (2003). The problem 1CBP can also be considered as a relaxation of 2SP (contiguous relaxation). Therefore, each feasible packing of 2SP is a feasible packing of corresponding 1CBP problem, but not vice versa. And an optimum of 2SP is not necessary an optimum of corresponding 1CBP problem. According to the definition of 1CBP, the number of bins in an optimal solution (or lower bound for this value) of 1CBP is also a lower bound of the corresponding 2SP.
2008
13th IFAC INCOM (INCOM'09) Moscow, Russia, June 3-5, 2009
The domination of the contiguous relaxation over material lower bound for 2SP is showed by Martello et al. (2003); Monachi (2001).
3
λ1 λ2
4
We have taken a branching schema of an exact approach of Martello et al. (2003); Monachi (2001). The main idea is to separate all solutions into subproblems by fixed items. In comparison to Martello et al. a Linear Programmingbased lower bound were applied instead of combinatorial ones.
λ3
2
λ4
3 1
u1
3
u2
u3
4.1 Problem statements
Fig. 1. Partial packing
Packings, which are under consideration, are some kind of normal patterns firstly used by Herz (1972) and Christofides & Whitlock (1977). The principle of normal patterns is based on the observation that, in a given feasible packing pattern, any cut piece can be moved to the left and/or downward as much as possible until its left edge and bottom edge are both adjacent to the other pieces or to the edges of the container. Thus, there is no item, which is packed apart.
fixed. Beginning from the slice Sj(u) this unused areas have sizes: X (λ1 , u1 ) = (W − wi , χj(u) ),
A packing of 1D bin is described by the following packingvector : b = (b1 , . . . , bm ) ∈ {0, 1}m , where component bi = 1, i ∈ I means that item i is packed into the bin. It is obvious, that for the packing-vector’s feasibility inequality (13) must be hold. The real packing of items I according to a packing-vector b is described by a packing-pattern: p = p(b) = {(i, yi ) : bi = 1}, where yi is the y-position of item i ∈ I. Definition. Two packing-patterns p = p (b ) and p = p2 (b2 ) are equivalent, if their packing-vectors are equal, i.e., b1 = b2 . 1
1
1
2
Definition. A maximal set of consecutive equivalent packing-patterns p1 , . . . , pχ with a packing-vector b is called slice and denoted S = (b, χ), where χ is called height of the slice. Definition. An ordered set of slices S1 = (b , χ1 ), . . . , Sσ = (bσ , χσ ) is called slice-structure of a packing: 1
i∈I(bj(u) )
··· (λq−1 , uq−1 ) = (W −
4.2 A linear programming-based lower bound Let us consider a partial packing in Fig. 4.2. There is a slice-structure SS(u) = NF(u) were items u = {i1 , . . . , id } are already fixed so, that item id was fixed in slice (bj(u) , χj(u) ). NF(u) means that the packing is obtained by applying Next Fit algorithm for 1CSP problem to item order u = hi1 , . . . , id i (see, Kartak et al. (2008)). These items create unused areas in the partial packing SS(u), ¯ where remaining items I(u) = I\{i1 , . . . , id } should be
wi , χσ(u) ),
(18)
i∈I(bσ(u) )
(λq , uq ) = (W, ∞), where q = σ(u) − j(u). Based on the supposition of the problem discreteness the unused area with width λk , and height uk can be considered as a set of uk stock materials of width λk and height 1. Thus, each stock type λk is available in quantity uk except the last one λq , whose availability is unlimited. The remaining set of hi items ¯ wi ×1, i ∈ I(u) with a unit height can be cut from this suit of stock materials complying to the following rules. Each item wi × 1 is cut only once from a stock. The availability of each type of stocks should not be exceeded. Any feasible cutting pattern can be described by the following binary vector: X ajk = (a1jk , ..., amjk )T ∈ {0, 1}m with wi · aijk ≤ λk , i∈I
(19) where aijk = 0, for i ∈ I(u), and j ∈ Jk , where Jk is a set of patterns for each stock type k = 1, . . . , q(u). Let us formulate the following optimization problem for SS(u): X z= xjq −→ min, (20) j
SS = h(b1 , χ1 ), . . . , (bσ , χσ )i. Each 1CBP packing can be identified with its slicestructure but not vice versa. The set of whole slicestructures is larger than the set of all slice-structures with contiguous condition. Hereby, in this work all mentioned slice-structures satisfies the contiguous condition, so that the notions 1CBP packing and slice-structure here are synonyms.
X
X X ¯ aijk · xjk = hi , i ∈ I(u) (21) kXj s.t. xjk ≤ uk , k = 1, . . . , q(u) − 1 (22) j xjk ∈ Z+ , ∀(k, j) (23) This problem is known as the one-dimensional cuttingstock problem with multiple stock lengths (CSPM). The optimal value z ∗ of the objective function of the problem CSPM(u) is the minimal number of stocks, which are needed to cut all remaining items from the suit of obtained stocks. Thus, the value z ∗ can be used as a lower bound ¯ for packing of the remaining items from I(u). In practice the linear programming relaxation of CSPM(u) model is used. Instead of integrality condition for variables (23), which is dropped, real numbers are under consideration: xjk ∈ R+ , ∀(k, j) (24)
2009
13th IFAC INCOM (INCOM'09) Moscow, Russia, June 3-5, 2009
So, the model LP(u): (20) - (22), (24) is the continuous relaxation of the problem CSPM(u). Let zLP (u) be a value of an optimal solution of LP(u). Thus, the number lb(u)LP (25) is a lower bound for the subproblem defined by u 1CBP: σ(u) X lbLP (u) = χj + dzLP (u)e (25) j=1
5. NUMERICAL EXPERIMENTS
The width of the strip W = 100 for each class. Each class has 20, 40, 60, 80, and 100 items. For each class and number of items 10 instances are generated. In column 1CBP (C) the average height of solution of 1CBP is given. For each instance and algorithm, 3 min. time constraint was imposed on. Column opt shows the number of instances for each class, which were solved to optimality. For instances, which were not optimally solved, the minimal value of lower bound over all opened subproblems is given. Table 1. Average lower bound for Bortfeld instances
Numerical experiment was made on 2D instances of Bortfeld (2006) library. Since Bortfeld has given a lower bound Bortfeld (B) for each problem, we can compare it with Probing (P) and contiguous relaxation 1CBP (C). We also compare the former with the continuous relaxation of the cutting stock problem rounded up LP, see Table 1.
Class cl01 cl02 cl03 cl04 cl05 cl06 cl07 cl08 cl09 cl10
The software was realized in C++ and compiled with gcc 4.1.2. The experiments were made on AMD Opteron 250 (2,4 GHz). The library of Bortfeld problems consist of 500 instances. These instances were randomly generated and divided into 10 classes. The instances of first 6 classes were given by Berkey and Wang: cl01: cl02: cl03: cl04: cl05: cl06:
cl08: cl09: cl10:
type 1 4 with type 2 4 with type 3 4 with type 4 3 with
with probability 10%; with probability 10%; with probability 10%; with probability 10%;
LP 187,68 60,52 507,62 193,50 1630,66 506,40 1588,76 1399,58 3344,56 917,58 1033,69
P 187,70 60,52 507,88 193,62 1631,68 506,98 1590,40 1399,90 3346,04 917,64 1034,25
C 187,74 60,52 507,84 193,50 1631,72 506,40 1591,24 1399,84 3346,16 917,70 1034,27
opt 36 32 15 0 29 0 48 0 50 7 217
Table 2. Comparison of lower bounds Class cl01 cl02 cl03 cl04 cl05 cl06 cl07 cl08 cl09 cl10
In each class the sizes of items are generated on equal segments. Martello and Vigo have proposed the following nearly real classes. Items are qualified into 4 types:
cl07:
B 187,18 60,52 504,12 193,50 1613,16 506,40 1577,82 1397,92 3343,10 909,16 1029,29
In Table 2 it is shown the number of instances where a lower bound is greater than the other ones.
wi , hi uniformly distributed over [1, 10], W = 10; wi , hi uniformly distributed over [1, 10], W = 30; wi , hi uniformly distributed over [1, 35], W = 40; wi , hi uniformly distributed over [1, 35], W = 100; wi , hi uniformly distributed over [1, 100], W = 100; wi , hi uniformly distributed over [1, 100], W = 300;
(1) wi uniformly distributed over [ 23 W, W ], hi distributed over [1, 21 W ]; (2) wi uniformly distributed over [1, 21 W ], hi distributed over [ 32 W, W ]; (3) wi uniformly distributed over [ 12 W, W ], hi distributed over [ 21 W, W ]; (4) wi uniformly distributed over [1, 21 W ], hi distributed over [1, 21 W ];
N 50 50 50 50 50 50 50 50 50 50 500
uniformly uniformly uniformly uniformly
LP>B 15 0 33 0 44 0 27 15 5 39 178
P>B 15 0 36 5 45 8 27 17 5 39 197
P>LP 1 0 7 5 6 8 7 5 2 2 43
P>C 0 0 6 5 1 8 1 2 0 2 25
C>B 16 0 36 0 45 0 27 16 5 39 184
C>LP 3 0 6 0 10 0 16 6 4 1 46
C>P 2 0 4 0 6 0 10 4 2 1 29
From Table 1 one can see that for classes cl02, cl04, cl06 the LP-based lower bound and contiguous relaxation are not better than the Borfeld lower bound, although the Probing gives better results on cl04, cl06 classes by 5 and 8 instances correspondingly. The total sum of improved lower bounds by Probing is 197 and by contiguous relaxation is 184. Despite of this, the contiguous relaxation was in 4 instances greater than the Probing. 6. CONCLUSION
70%; type 2, 3,
In this paper were proposed two types of lower bounds with and without branchings. This lower bounds are accepted to be used in 2D exact methods to prune the enumeration. They can be used also for estimation of the quality of heuristics.
70%; type 1, 3,
REFERENCES
70%; type 1, 2,
Alvarez-Valdes, R., Parre˜ no, F., and Tamarit, J. (2008). A branch and bound algorithm for the strip packing problem. OR Spectrum. doi:10.1007/s00291-008-01285.
70%; type 1, 2,
2010
13th IFAC INCOM (INCOM'09) Moscow, Russia, June 3-5, 2009
Beasley, J.E. (1985). Bounds for two-dimensional cutting. Journal of the Operational Research Society, 36(1), 71– 74. Bortfeld, A. (2006). A genetic algorithm for the twodimensional strip packing problem with rectangular prices. European Journal of Operational Research, 172, 814–837. Fekete, S. and Schepers, J. (2004). A general framework for bounds for higher-dimensional orthogonal packing problems. Mathematical Methods of Operations Research, 60, 311–329. Gilmore, P. and Gomory, R. (1961). A linear programming approach to the cutting-stock problem. Operations Research, 9, 849–859. Herz, J. (1972). Recursive computational procedure for two-dimensional stock cutting. IBM Journal of Research and Development, 16, 462–469. Kartak, V., Mesyagutov, M., Mukhacheva, E., and Philippova, A. (2008). Local search of rectangular packings with usage of lower bounds (in russian). Automation and Remote Control. Martello, S., Monachi, M., and Vigo, D. (2003). An exact approach to the strip-packing problem. INFORMS Journal on Computing, 15(3), 310–319. Monachi, M. (2001). Algorithms for packing and scheduling problems. Ph.D. thesis, PhD Thesis. Universit`a di Bologna. Padberg, M. (2002). Packing small boxes into a big box. Mathematical Methods of Operations Research, 52, 1–21. Terno, J., Lindemann, R., and Scheithauer, G. (1987). Cutting problems and their solution in practice. Verlag Harri Deutsch, Thun und Frankfurt/Main. In German.
2011