Anda di halaman 1dari 7

Electronic Notes in Discrete Mathematics 19 (2005) 381387 www.elsevier.


Two aspects of the pallet loading problem

Walter F. Mascarenhas
Instituto de Matem atica e Estat stica, Universidade de S ao Paulo Rua do Mat ao, 1010, 05508-090, S ao Paulo SP, Brazil

Abstract We present two new ideas about the Pallet Loading Problem. One idea uses elementary number theory to analyze the structure of the lled parts of optimal solutions. The other uses duality bounds to constrain the empty regions of the pallet in optimal solutions. Using these ideas, we propose a new exact algorithm to solve the Pallet Loading Problem. Keywords: packing, combinatorial optimization, 1991 MSC: 90C27

How eciently can we ll a pallet P with dimensions L and W using rectangular boxes with sides of length a and b, assuming that the boxes are laid either horizontally or vertically?

This work is about the classical combinatorial optimization problem:

We call it the Pallet Loading Problem, or PLP, and represent its instances by the parameters (L, W, a, b). The PLP models several problems of practical

1571-0653/2005 Published by Elsevier B.V. doi:10.1016/j.endm.2005.05.051


W.F. Mascarenhas / Electronic Notes in Discrete Mathematics 19 (2005) 381387

interest. Its study goes back to [2] and we recommend [5] as a survey on this subject. In this work we focus on two aspects of the Pallet Loading Problem and explain how they can be combined in a new exact algorithm to solve it. Our rst contribution, discussed in section 2, is the concept of lane. A lane is a rectangle which is completely lled in a solution and such that at most one of its sides crosses boxes. We claim that lane is a fundamental concept about the PLP. We present two theorems to illustrate its importance. Our second contribution is a new way to look at upper bounds for the Pallet Loading Problem. The study of such upper bounds started with [1] and [2]. They are discussed in detail in [4] and [5]. The article [1] did not get the attention it deserves from the PLP community. The bound it suggests, called Barnes bound, usually gets low ratings in experimental comparisons [5]. In this work, instead of bounding the overall number of boxes, we constrain the regions that can be left empty on the Pallet in an optimal solution. The Barnes bound is quite eective for this task: with a slight adaptation it shows that specic parts of the Pallet must be lled in optimal solutions. We explain how in section 3. These two contributions t together nicely: lanes provide information about parts of the optimal solution which are lled and our version of the Barnes bound helps us to locate the empty parts. They can be combined in a new exact algorithm for the Pallet Loading Problem. We sketch such an algorithm in the nal section of this work.


In this section we dene the concept of lane and state two theorems about it. In order to dene what a lane is, we need these preliminary concepts: Denition 1 Given an instance (L, W, a, b) of the PLP, we say that a set H [0, L) [0, W ) of the form H = H (x, y ) = {(u, v ) R2 such that x u < x + a and y v < y + b} is an horizontal box with lower left corner (x, y ). Analogously, a vertical box with lower left corner is a set V [0, L) [0, W ) of the form V = V (x, y ) = {(u, v ) R2 such that x u < x + b and y v < y + a}. A rectangle R that is either an horizontal box or a vertical box is called a box.

W.F. Mascarenhas / Electronic Notes in Discrete Mathematics 19 (2005) 381387


Denition 2 A solution of an instance of the PLP is a family of disjoint boxes. Denition 3 Let S = {R1 , . . . , Rk } be a solution of an instance of the PLP. We say that a set A is covered by S if A k i=1 Ri . On the other hand, we say that the set A is exposed by S if A interior of (k i=1 Ri ) = . Finally, we say that a line L crosses a box R if L interior of(Ri ) = . We are now ready to dene the concept of lane: Denition 4 Let S be a solution of an instance of the PLP. A rectangle is a lane of S if its covered by S and at most one of its sides crosses boxes in S .

Fig. 1. The hatched rectangle A is not a lane because it is not covered by boxes. The rectangle B is not a lane because its top and right sides cross boxes. The rectangle L is a lane because it is covered and only its right side crosses some boxes.

There are four kinds of lanes, depending on which side crosses boxes (a lane in which no side crosses boxes could be considered to be of any of the four kinds.) Denition 5 If the left (L), top (T) and bottom (B) sides of the lane L do not cross boxes in a solution S then we say that L is a R-lane of S (R stands for right). A R-lane is maximal if there is no R-lane which contains it properly. The denition of L-lane, T-lane and B-lane and their maximality is analogous.

Fig. 2. A R-lane (hatched, at left) and a maximal R-lane (hatched, at right)

Lanes can be dened for any instance and solution of the PLP. However, it is easier to extract information from them if the instance is normalized: Denition 6 We say that an instance (L, W, a, b) of the PLP is normalized if W L < ab and gcd(a, b) = 1.


W.F. Mascarenhas / Electronic Notes in Discrete Mathematics 19 (2005) 381387

We emphasize that instance normalization is not a serious restriction. In particular, by considering only normalized instances we do not limit ourselves to small problems. In fact, given any instance of the PLP, the arguments presented in [3] show how to nd a normalized instance equivalent to it (see [3] for a discussion of equivalence among instances.) The main result about lanes is the following theorem: Theorem 2.1 Let (L, W, a, b) be a normalized instance of the PLP with a solution S and let L be a R-lane of S . If S contains a box B with left bottom corner (x, y ) L and horizontal side with length {a, b} then S contains all boxes B with the same horizontal side length and left bottom corner (x + k, y ), for k Z, such that (x + k, y ) interior of (L). In particular, this theorem implies that the rst column of a R-lane denes the layout of the boxes inside it completely, as described in the next gure.

Fig. 3. The position of the boxes within a R-lane is determined by the rst column

Theorem 2.1 is a consequence of Bezouts theorem from elementary number theory. This section ends with theorem 2.2, which restricts the maximal lanes: Theorem 2.2 Let (L, W, a, b) be a normalized instance of the PLP, with a solution S . The length of any maximal L-lane or R-lane of S or the height of any B-lane or T-lane of S is a multiple of a or b. Theorem 2.2 is powerful when used in combination with the duality bounds from the next section. In this circumstance, it restricts the number and location of neighboring lanes of the same kind.

Duality constrains on the location of exposed sets

The location of exposed rectangles in optimal solutions of the PLP can be constrained by solving explicitly the dual of a linear program that relax the Swiss Pallet Loading Problem (SPLP), that is, the packing problem obtained when we decide that some rectangles are exposed. Exposed rectangles are holes in the Swiss pallet and holes that lead to an optimal solution of the SPLP with few boxes can be ruled out.

W.F. Mascarenhas / Electronic Notes in Discrete Mathematics 19 (2005) 381387


Fig. 4. A Swiss pallet is a rectangle with rectangular holes (which are in black.)

The instances of the SPLP are represented by (L, W, a, b, R1 , . . . , Rn ), where L, W, a, b are as in the regular PLP and the Ri are rectangles contained in [0, L) [0, W ). In order to obtain the duality bounds discussed in this section we look at hatches for (L, W, a, b, R1 , . . . , Rn ), which are dened as follows: Denition 7 The hatch H (d, , ), for d, R and {1, 1}, is the set H (d, , ) = kZ {(x, y ) R2 such that x + y = d + k }. A hatch H (d, , ) is compatible with the instance (L, W, a, b, R1 , . . . , Rn ) of the SPLP if {a, b}, i.e. if the distance between consecutive lines of H (d, , ) is a/ 2 or b/ 2.

Fig. 5. A hatch compatible with an instance (Boxes are white and holes are black.)

Each compatible hatch H (d, , ) is related to a solution of the dual of a relaxation of a linear programming formulation of the Swiss Pallet Loading Problem via the following measure on the rectangles R: H (d, , )(R) = 2
length of(R {(x, y ) R2 | x + y = d + k }). (1)

In words, H (R) is / 2 times the length of the intersection of H and R. We end this section with theorem 3.1 and lemma 3.2. Theorem 3.1 is an adaptation of results in [1]. It bounds the number of boxes in the solutions of the SPLP. Lemma 3.2 explains how to evaluate this bound.
Theorem 3.1 Let I = (L, W, a, b, R1 , . . . Rn ) be an instance of the SPLS with


W.F. Mascarenhas / Electronic Notes in Discrete Mathematics 19 (2005) 381387

a compatible hatch H = H (d, , ). Any solution of I contains at most 1 ab


LW (L mod )(W mod ) + H (R)


H (Ri )

boxes, for R = {(x, y ) R2 | 0 x < (L mod ) and 0 y < (W mod )}. Lemma 3.2 Let H (d, , 1) be a hatch and let R be a rectangle with lower left corner (x, y ) with sides of length h and v , such that h < and v < . If we dene r, s and t as s = min{h, v }, t = max{h, v } and r = (d x y ) mod ,

then we have the following possibilities r [0, s + t ) H (R) = (s + t ), r [s + t , s) H (R) = r, r [s, t) H (R) = s, r [t, s + t) H (R) = (s + t r), r [s + t, ) H (R) = 0. Moreover, if R is a rectangle with sides of arbitrary lengths h and v and lower left corner (x, y ) and we dene and v = v mod , r = h mod 2 R = {(u, v ) R such that x u < x + r and y v < y + v } then H (R) = hv h v + H (R ). Finally, H (d,,1) (R) = H (d,,1) (R), where R is the reection of R along the horizontal axis.

The algorithm

Lanes and the duality bounds above can be combined in an exact algorithm for the PLP that could be sketched as follows: (i) Find an heuristic solution for the problem. Test if the heuristic solution is optimal. If the test is not conclusive, then save the heuristic solution, let m be the maximum number of boxes packed by this initial solution and do the next steps. (ii) Find an equivalent normalized instance I0 = (L0 , W0 , a0 , b0 ). Generate also another few equivalent instances Ik = (Lk , Wk , ak , bk ). (iii) Split the pallet of I0 into cells using the partitions of L and W from [3] and compute the corresponding cells for the equivalent instances Ik .

W.F. Mascarenhas / Electronic Notes in Discrete Mathematics 19 (2005) 381387


(iv) Create one list for each kind of lane for I0 . The degenerate lane formed by the left side of the pallet is inserted into the list of R-lanes and so on. (v) Try to expand the lanes for I0 . For example, to expand a R-lane L: (a) Check if the continuation of the bottom and top sides of L are exposed. If the current information is not enough to decide this, then branch on continuation is exposed continuation is not exposed. (b) Check if any cell c on the right border of L can be exposed, by comparing the duality bounds obtained by declaring c exposed in the instances I0 , . . . Ik and the lower bound m from the best solution found so far. If a cell c can be exposed then branch on c is exposed c is covered. (c) If there are no exposed cells on the right border of L and the continuation of the top and bottom sides of L are exposed then L should be expanded up to a maximal R-lane, which has length multiple of a or b by lemma 2.2. If this expansion causes L to overlap incompatible lanes, then the current solution is inconsistent and we backtrack. If the whole pallet is covered after this expansion then update the lower bound m, save the best solution, and backtrack. Otherwise, go to (v). (vi) If no lane can be expanded then try to identify a new one. If no new lane is found then we are done (this is a lemma). Otherwise, include the new lane on the appropriate list and go back to (v).

[1] F. W. Barnes: Packing the maximum number of m x n tiles in a p x q rectangle, Discrete Math. 26, 1979, pp. 93100 [2] S. Barnett and G. Kynch: Exact solution of a simple cutting problem, Ops. Res. 15, 1967, pp. 1051-1056. [3] Downsland, K.A.; The threedimensional pallet chart: An analysis of the factors aecting the set of feasible layouts for a class of twodimensional packing problems, J. Oper. Res. Soc. 35, 1984, pp. 895905 [4] Letchford, A. and Amaral, A.; Analysis of upper bounds for the Pallet Loading Problem. European Journal of Operational Research, 132, (2001), 582-593. [5] Nelissen J.; New approaches to the Pallet Loading Problem (1993), manuscript available via ftp as /pub/reports/others/, at (