EUROPEAN JOURNAL OF OPERATIONAL RESEARCH ELSEVIER
European Journal of Operational Research 84 (1995) 599-617
An AND/OR-graph approach to the solution of two-dimensional non-guillotine cutting problems Marcos Arenales
a,*, R e i n a l d o
Morabito
b
a Departamento de Computaq~o e Estatfstica, Universidade de Sdo Paulo, e.p. 668, 13560.970 Sdo Carlos, S.P., Brazil b Departamento de Engenharia de Produq~o, UniversidadeFederal de Sdo Carlos, 13565.905 S&o Carlos, S.P., Brazil
Abstract
This work is concerned with unconstrained two-dimensional non-guillotine cutting problems, where a rectangular plate is cut into a number of rectangular pieces in such a way as to optimize an objective function. We reduce the state-space of the problem by considering non-guillotine cutting patterns which are combinations of guillotine and simple non-guillotine cuts. These cutting patterns are represented as complete paths in an AND/OR-graph and a branch and bound method is described. We provide rules and heuristics that reduce the graph search and present computational results from randomly generated examples as well as from the literature. Keywords: Cutting/packing problems; Graph search; Branch and bound method; AND/OR-graph
I. Introduction
The unconstrained two-dimensional cutting problem consists of cutting a rectangular plate (L, W), where L is the plate's length and W its width, in order to produce rectangular pieces (l i, wi), i = 1, 2 , . . . , m, which are called t h e d e m a n d e d pieces. If the 90°-rotation of a piece (li, Wi) is allowed, then the piece (wi, lg) is also included in the list of the d e m a n d e d pieces. To each type-i piece is associated a utility value v~ and there is no u p p e r bound on the quantity of such pieces (if there were a limit on the quantity of pieces, the problem would be called constrained). The problem is to determine a cutting pattern that maximizes the total sum of utility values. If v~ liwi, the problem is equivalent to minimizing the total waste (trim loss). In addition, the cuts made on the plate are always orthogonal to one side of the plate. This is a problem of type 2 / B / O / a c c o r d i n g to Dyckhoff's typology of cutting and packing problems (Dyckhoff, 1990). It is possible to add a n u m b e r of constraints to the cuts. For example, in several practical applications the cuts are guillotine-type (guillotine cutting problems). This is the most studied case in the literature. In particular, a branch and bound method and heuristics based on an A N D / O R - g r a p h problem =
* Corresponding author. 0377-2217/95/$09.50 © 1995 Elsevier Science B.V. All rights reserved SSD1 0377-2217(95)00026-7
600
M, A renales, R. Morabito /European Journal of Operational Research 84 (1995) 599-617
representation to solve guillotine cutting problems were proposed by Morabito et al. (1992) and Morabito and Arenales (1992, 1994). In this work we extend that approach to deal with non-guillotine cutting problems. Bischoff and Dowsland (1982) studied the problem we are focusing on in this paper for identical demanded pieces (the pallet loading problem). Their method produces a homogeneous cutting pattern that can be utilized as a lower bound to our branch and bound method. Beasley (1985) dealt with constrained non-guillotine two-dimensional cutting problems. He modelled the problem as a 0-1 linear program. It is interesting to note that (at least to our knowledge) there is no similar modelling to general guillotine problems, i.e., there is no equation/inequality system to represent guillotine cutting patterns. An exception is the two-staged guillotine cutting problem (see Gilmore and Gomory, 1965). Beasley proposed an exact tree-search method and used Lagrangean relaxation to provide bounds. There are other interesting approaches in Bir6 and Boros (1984) or Dowsland (1987). The approach used here is more related to Morabito and Arenales (1992, 1994) and Bischoff and Dowsland (1982). Excellent surveys of cutting and packing problems can be found e.g. in Dyckhoff (1990), Dyckhoff and Finke (1992), and Dowsland and Dowsland (1992).
2. Non-guillotine cutting In this section we define the cutting types which are used to determine cutting patterns. In all of our definitions orthogonal cuts are implicit. Definition 1 (guillotine cut and cutting pattern). A cut is guillotine-type if it produces two new rectangles. We call these new rectangles partners. A cutting pattern is guillotine-type if it is obtained by successive guillotine cuts. The rectangles P and Q in Fig. 1 are partners. Notice that the partner of rectangle O in Fig. lc was cut into P and Q. Definition 2 (Vt-order cut). A cut is first-order non-guillotine-type (or simply Vt-order) if it produces five new rectangles arranged in such a way so as not to form a guillotine cutting pattern. These new rectangles are also called partners. A lSt-order cut made on a rectangle (l, w) produces the following five partner rectangles (see Fig. 2): {(c t, c3), ( l - c t, c4), ( l - c 2, w - c 4 ) ,
(c 2, w - c 3 ) ,
( I c t - c 2 l , 1c3-c41)}
(1)
where c t and c 2 are the distances from the left edge of the rectangle (1, w) to the points where the vertical cuts are made; similarly c 3 and c a are the distances from the bottom edge of the rectangle to the points where the horizontal cuts are made, with c 1 :~ c2, 0 < c i < I, i = 1, 2, and c 3 :~ Ca, 0 < c i < w, i=3,4. A lSt-order cut is well defined by the 4-vector (ct, c2, c 3, c4), in the sense that when applied to a
P
Q (a)
P
Q
(b)
0 I
P Q
I
(c)
Fig. 1. (a) A vertical guillotine cut; (b) a horizontal guillotine cut; (c) a guillotine cutting pattern.
M. Arenales, R. Morabito / European Journal of Operational Research 84 (1995) 599-617 ~-c-)
<
2
c
C
~, E
c
>
2 D
C D
I" B
"1" 3,1,
¢
c
a)
)
1 c
>
1
c
E
c 4
<
601
3
A
13
fi"c ,1, 4
~-c -) 1 b)
2
c
1
<
c
2
Fig. 2. F i r s t - o r d e r cuts. (a) c I > cz; (b) c I ( c 2.
rectangle (l, w), it produces the set of rectangles in (1). Fig. 2 illustrates two possible lSt-order cuts, where the rectangles A, B, C, D and E are the partner ones in (1), respectively. Observe that the condition c 1 > c 2 implicates c 3
Definition 3 (1St-order cutting pattern). A cutting pattern is Vt-order-type if it is obtained by successive guillotine a n d / o r pt-order non-guillotine cuts. Fig. 3 depicts a pt-order cutting pattern where a pt-order non-guillotine cut is made (indicated by the bold lines) and then, the resulting rectangles are independently cut by different guillotine or lSt-order non-guillotine cuts. In the next section we propose a scheme to generate all possible pt-order cutting patterns. It is worth noting that there are non-guillotine cutting patterns which are not lSt-order type, such as the one illustrated in Fig. 4. Non-guillotine cutting patterns of superior orders are not considered in this work.
3. AND / OR-graph approach 3.1. The graph definition In order to produce demanded pieces (l i, wi), i = 1, 2 . . . . . m, we first cut the plate (L, W) to obtain new rectangles. Then, the intermediary rectangles produced are successively cut in order to obtain the demanded pieces. The cutting of each rectangle is restricted to guillotine or lSt-order cuts. Suppose that in a first stage the plate (L, W) (A in Fig. 5a) is cut by a vertical guillotine cut producing rectangles B and C. These are called successors or partner-successors of A. The two new rectangles are
c2
,
q
E L
•
Fig. 3. A lSt-order c u t t i n g p a t t e r n . Fig. 4. A s u p e r i o r o r d e r n o n - g u i l l o t i n e cutting.
602
M. Arenales, R. Morabito / European Journal of Operational Research 84 (1995) 599-617
(a)
(b) I
A
]
D
Fig. 5. A scheme to produce lSt-order cutting pattern.
then independently cut. Rectangle B is cut by a horizontal guillotine cut producing D and E, and rectangle C is cut by a l~t-order non-guillotine cut producing F, G, H, I and J. Fig. 5a depicts the sequence of cuts leading to the cutting pattern in Fig. 5b. T h e r e are different ways of cutting a rectangle leading to different cutting patterns. If we examine all possibilities of cutting, including the option of maintaining a rectangle intact, called O-cut, we generate all possible l~t-order cutting patterns.
Node definition For each new generated rectangle we have a subproblem similar to the original problem, which consists of determining all possible cutting patterns for that rectangle. Each rectangle is represented by a node in a graph, where the plate (L, W) corresponds to the initial node.
Arc definition The decision of cutting a rectangle (branching a node) is represented by an AND-arc which points to the successor nodes (partner-rectangles) generated. A guillotine cut is represented by an AND-arc pointing to two new nodes (Definition 1) whereas a lSt-order cut is represented by an AND-arc pointing to five new nodes according to (1). The 0-cut is represented as an ordinary arc pointing to a single successor node. This node represents the same rectangle as the node from which that arc emerges. Different options of branching a node are indicated by OR-arcs. The resulting set of nodes and arcs is called an AND / OR-graph.
3.2. Feasibility properties D e f i n i t i o n 4 (final node). Any node obtained from a 0-cut does not allow any extra arc emanating from it and is called a final node. D e f i n i t i o n 5 (complete path). Consider the following sequence of arcs in the A N D / O R - g r a p h : From the initial node choose one and only one arc (AND-arc or 0-cut arc), and from each successor node pointed to by this arc, choose again one and only one arc, and so on, until all successor nodes obtained are final nodes. This sequence is called a complete path.
We have defined a lSt-order cutting pattern (see Definition 3) as the successive application of guillotine or lSt-order non-guillotine cuts. In addition to these basic cuts, we also introduced the 0-cut in order to stop the cutting process. This corresponds to following a path in the A N D / O R - g r a p h .
M. Arenales, R. Morabito/ EuropeanJournalof OperationalResearch 84 (1995)599-617
603
Theorem 1. Every 1St-order cutting pattern can be represented as a complete path in the AND/OR-graph described above. And vice-versa, a complete path in the AND/OR-graph corresponds to a lSt-order cutting pattern. The correspondence in Theorem 1 is not a one-to-one correspondence, since different paths may correspond to the same cutting pattern. In the next section we discuss some rules to avoid duplications.
3.3. Optimality properties Definition 6 (solved node). A node is called solved if its optimal lSt-order cutting pattern is known. Theorem 2. If all successors of a node are solved, then this node is also solved and the optimal lSt-order cutting pattern is given by re-composing the partner-successors and choosing the most valuable one amongst them. To prove Theorem 2 it is enough to remember that, by Definition 3, a 1St-order cutting pattern (in particular the optimal one) is obtained from a sequence of guillotine a n d / o r lSt-order cuts. That is, there is no chance of obtaining a cutting pattern for a rectangle without handling its successors.
Definition 7 (final node value). If a final node represents a demanded rectangle (li, Wi) then its value is vi, otherwise it is zero. That is, if (1, w) is a final node, its value, denoted by Fo(l, w), is defined as
Fo( l, W)
=[vi' 0,
if (l, w) = (li, wi), otherwise.
Theorem 2 suggests the following recursive formula to solve the problem.
Recursive formula. Let F(I, w) be the optimal 1St-order cutting pattern to the rectangle (l, w). Then F(l, w) = max{F0(/, w), F ( x , w) + F ( l - x ,
w), F(l, y) + F(l, w - y ) ,
F(C1, C3) + F ( I - c 1 , c4) + F ( l - c 2 ,
w-c4) +F(c2, w -c3)
+ F ( I c , - c 21, ]c 3 - c 41)} where x, y and c~, c 2, c 3, c a assume proper values which are discussed in the next section. We do not emphasize this method in this work. Note that a node representing a rectangle (l, w) such that l < Ii or w < wi, for i = 1 , . . . , m, accepts only a 0-cut. Such a node corresponds to waste on the cutting pattern. It is worth saying that Definition 6 (solved node) and Definition 7 (final node value) are necessary in order to obtain an exact search. But, in the algorithm (which is heuristic), we associate with any final node (Definition 4) a value of a solution easy to be obtained (see lower bounds in Section 5). Furthermore, we work with the current best value attached to any node, which could never be the optimal since the heuristics of discarding successors (see heuristics in Section 5) are implemented in the algorithm.
Definition 8 (complete path value). The value of a complete path is the sum of the values of its final nodes. Corollary I. The problem of determining the optimal 1St-order cutting pattern consists of determining the most valuable complete path in the AND/OR-graph. This path is determined as soon as the initial node is solved.
M. Arenales, R. Morabito / European Journal of Operational Research 84 (1995) 599-617
604
A search strategy is a particular way of traversing the graph, or a way of enumerating its nodes that defines a method to solve the problem. The complete enumeration (or generation) of the nodes is, in general, computationaUy unfeasible. In practice it is enough to generate a few of them. Several rules can be designed in order to avoid unnecessary branchings, without loss of generality. The rules designed for guillotine cuttings (see Herz, 1972, Christofides and Whitlock, 1977, or Morabito and Arenales, 1992) can also be used here. In Section 4 we describe an additional rule to avoid symmetric l~t-order cuts. The search can also be reduced with the use of bounds to avoid non-promising paths, implicitly enumerating the nodes (a branch and bound method). The guillotine branch and bound method described in Morabito and Arenales (1992, 1994) can be straightforwardly extended to the non-guillotine case and the lower and upper bounds presented there, as well as the heuristics they provided are also valid here. Bischoff and Dowsland (1982) described a specific non-guillotine homogeneous cutting pattern which can also be used as a lower bound. Their work is reviewed in Section 8. In Section 6 we extend the search strategy described in Morabito et al. (1992) to deal with l~t-order non-guillotine cuts.
4. Avoiding equivalent patterns Definition 9 (equivalent cutting patterns). Different arrangements of the same set of demanded pieces in a rectangle produce equivalent cutting patterns. Herz (1972) showed that, without loss of generality, the guillotine cuts can be considered in the following discretization sets: vertical cut: m
X=
XlX----- E o t i l i ,
l 0 < x < L - l 0,
o/i > 0 and integer},
wo
/3i > 0 a n d i n t e g e r
i=1
horizontal cut: =
(
YlY=
m
~.,fliwi,
I
,
i=1
where l 0 = min{li, i = 1 , . . . , m} and w 0 --- min{wi, i = 1. . . . . m}. That is, if any guillotine cutting pattern has cuts taken out of the discretization sets, there is an equivalent guillotine cutting pattern with all cuts belonging to the discretization sets. For a rectangle (l, w) obtained during the cutting process, the vertical and horizontal cuts can be made at x ~ • and x _< !, y ~ ~ and y _
Theorem 3. Consider any lSt-order cutting pattern. There is an equivalent lSt-order cutting pattern so that all cuts belong to the discretization sets. Proof. First of all, remember that any 1St-order cutting pattern, by Definition 3, is obtained by a sequence of guillotine or lSt-order non-guillotine cuts made successively. Also, imagine the waste, in a given cutting pattern, as free space where the demanded pieces can be slided maintaining equivalent cutting patterns. Consider that the first cut made is a l~t-order cut with c I > c 2 (see Fig. 6a; if it were a guillotine cut, the
M. Arenales, R. Morabito / European Journal of Operational Research 84 (1995) 599-617 (
C
)
(
2
C
605
) 2
(a)
(b) Fig. 6. First cut in a given lSt-order cutting pattern.
proof would be similar), and assume that the northwest rectangle was successively cut in order to produce demanded pieces, i.e., there is a lSt-order cutting pattern defined on it (of course, the northwest rectangle can be just a demanded piece or a guillotine cutting pattern). Suppose there is a demanded piece R in contact with the vertical cut at c 2 (see Fig. 6a); otherwise we could move this cut to the left by maintaining an equivalent lSt-order cutting pattern (see Fig. 6b). That is, the situation in Fig. 6b can be straightforwardly reduced to the situation in Fig. 6a by maintaining an equivalent lSt-order cutting pattern, since the northeast and inner rectangles will be enlarged. Pull to the left the demanded piece R in Fig. 6a, by not overlaying any demanded piece and not destroying the inner l~t-order cutting pattern in the northwest rectangle. If this is possible (and repeating this for any demanded piece in contact with the vertical cut at c2), we are in the situation of Fig. 6b, which can be reduced to the situation of Fig. 6a, as discussed above. If it is not possible to pull the demanded piece R to the left, this is because: (i) the left edge of R is in contact with the left edge of the plate (Fig. 7a); (ii) the left edge of R is in contact with the right edge of another demanded piece (Fig. 7b); (iii) the left edge of R is in contact with a vertical cut of an inner l~t-order cut (Fig. 7c). In case (i), we have c 2 in X (c 2 is the length of R). In case (ii) or (iii), repeat the above procedure by trying to pull the demanded piece S to the left (see Fig. 7b and Fig. 7c). In case (iii) the demanded piece S is in contact with the vertical cut at c~ (if it were c~, similar arguments could be used, since when sliding c~ to the left c~ is a limit, for which we would have a guillotine cutting pattern). If there were not such a piece S touching the vertical cut, we could move the vertical cut at c~ to the left as well as the rectangle R and case (iii) would hold. Either we are able to slide the piece S or one of the three above cases must occur. Again, if case (i) occurs, we have c 2 in X (now c 2 is the sum of the lengths of S and R). If cases (ii) or (iii) occur we repeat this procedure of trying to slide to the left another piece that is blocking the sliding of S. As the cases (ii) and (iii) can only occur a finite number of times (since the plate is finite and the demanded pieces have non-null areas), case (i) must occur in a finite number of iterations of the above procedure and so we are able to produce c 2 in X.
C
C
2
C' 2
2
C
S
C ~
(a)
(b) Fig. 7. View of the northwest rectangle.
(c)
1
2
M. Arenales, R. Morabito /European Journal of Operational Research 84 (1995) 599-617
606
c2
II c c
4 3 c 1
>
III E D
IV
A
A E C
D
C
Fig. 8. Symmetric equivalent lSt-order cuts.
If we rotate the plate by 90 ° we will have ¢3 in the place o f ¢2. T h e n the above p r o c e d u r e will p r o d u c e c a in Y (since now we are dealing with widths of the d e m a n d e d pieces). Similarly for c 1 and c 4. []
Actually, this t h e o r e m is valid for any orthogonal non-guillotine cutting pattern. In o r d e r to avoid equivalent cutting patterns the discretization sets can be further reduced. H e r e we give a rule to avoid symmetric 1St-order cuts. Fig. 8 shows four symmetric equivalent non-guillotine cuttings on a rectangle (l, w). If the I-cut in Fig. 8 is characterized by (cl, c 2, c a, c4), then the II-cut is (l - Cl, l - c2, c4, Ca), the I I I - c u t is (c2, Cl, w - Ca, w - c 4) and the IV-cut is (l - c 2, l - c 1, w - c4, w - Ca). N o t e that if c 1 > c 2 then c[ I = l - c I < c 2n = l - c 2 , and c~It = c 2 < c ~ n = c l where c~I, c2n and c~n, c nI are the vertical cuts in the II-cut and I I I - c u t respectively. T h e n if we restrict vertical cuts such that c~ > c 2, II and I I I cuts are avoided. Let c~v = l - c 2 , c2I v = l - c 1 be the vertical cuts in the IV-cut. In o r d e r to avoid the duplication IV-cut, note that c~v + c ~ v = l -
c2+1-c
1= 2l-
(c 1 +c2).
Then, ¢1-b C2 < l if and only if c~V+ c I V > I. Therefore, by avoiding lSt-order cuts where the sum of vertical cuts is g r e a t e r than l we avoid the duplication in the IV-cut. However, if c 1 + c 2 = l (i.e., rectangles B and D in the I-cut have the same length), it implicates that c~v + c2TM= l. In this case, the duplication can be avoided by imposing c 3 + c 4 _< w. T h e s e rules can be summarised as follows:
l~t-order symmetry rule. Consider only lSt-order cuts (c~, c2, c3, C4) on (l, w) such that (i) (ii) (iii) From
cl, C2 E ~ ; C3, C4 E Y; cl > c2 (then c 3 < c4); (c~ + c2 < l) or (c t + c 2 = l and c 3 + c 4 < w). the above remarks and T h e o r e m 3, it follows:
Theorem 4. The lStorder symmetry rule does not lose generality. This rule avoids a n u m b e r of equivalent patterns and is included in the g r a p h search.
M. Arenales, R. Morabito / European Journal of Operational Research 84 (1995) 599-617
607
5. Bounds, a branch and bound method and heuristics Definition 10 (homogeneous guillotine cutting). A guillotine cutting pattern that produces the maximum
number of one type of piece, without rotating it, is called a homogeneous guillotine cutting. The homogeneous guillotine cutting for a rectangle (1, w) using type i pieces (l i,
Wi)
produces
[l/liJ[w/w ij of such pieces, where [x] is the largest integer less than or equal to x (Fig. 9). Homogeneous cutting produces feasible solutions to the problem which are easy to be computed and therefore, are lower bounds. Consider a node N representing the rectangle (l, w) and let
~ ( U ) = {irli < l and wi < w , i = 1 . . . . . m} be the set of pieces that can be produced at node N. Of course, if ~ ( N ) = O then the only possible cut on (l, w) is the 0-cut, yielding a final node whose value is zero (waste).
Lower bounds based on homogeneous guillotine cutting A homogeneous guillotine cutting using the piece (l i, wi) provides the lower bound (vi is the utility value of the piece i):
_~i( N ) = ui[ l//li J[ w / w i ]. Thus, we can define an improved lower bound as 2°(N)
= Max {_~/(N)} i~(N)
Consider an AND-arc from node N pointing to nodes P and Q, representing a guillotine cut. The composition of homogeneous guillotine cuttings of P and Q provides S'~°(P) +.~0(Q) which is also a lower bound to node N. Similarly, consider an AND-arc from node N to A, B, C, D, E, representing a Ft-order cut. Another lower bound to node N is given by -W°(A) +Sa°(B) +-~°(C) +.Z~°(D) +S'~°(E).
Upper bounds based on area A simple upper bound used by Beasley (1985b) and Morabito and Arenales (1992, 1994) can also be useful here. Consider again a node N representing a rectangle (1, w). Consider a relaxation by taking only the constraint involving area utilization. So, we have an upper bound: ~(N)=maximum
~
via i
i~(N)
subject to
~
(liwi)a i <_ (lw),
iE~(N)
ai>O,
i~M(N).
Fig. 9. A homogeneous guillotine cutting.
608
M. Arenales, R. Morabito/European Journal of OperationalResearch 84 (1995) 599-617
The solution of the above problem is trivially given by ~ ( N ) = max{vi( l / l i ) ( w / w i ) , i ~ M(N)}
with ~'(N) = 0 if M(N) = ¢. A branch and bound method
The previous lower and upper bounds can be used to implicitly enumerate a number of nodes in the graph. Let W(N) be the current best value attached to node N, given by a lower bound or by a known complete path emanating from N. It is updated when a better solution is obtained from the successors of N. For example, consider an AND-arc from N, representing a guillotine cut, pointing to P, Q. If: 7~(N)
g/(A) + ~'(B) + ~'(C) + ~'(D) + ~Z(E), then A, B, C, D, E need not also be considered in the search. In addition, observe that if W'(N) = ~'(N), then ~/(N) provides the best value to node N. Then node N is solved. As the initial node is solved, it follows that an optimum cutting pattern to the plate (L, W) has been found. Heuristics
The bounds described above can also be used to define heuristics that reduce the search space. These heuristics bet that some branchings do not lead to an optimal solution and so, they should be discarded. Heuristic 1 (H1) Consider a node N and the partner-successors P, Q (or analogously A, B, C, D, E). We expect ~'(P) + ~'(Q) (or ~'(A) + ~'(B) + ~(C) + ~/(D) + ~Z(E)) to be 'substantially' larger than ~ ( N ) . Otherwise, it might be a sign that W'(N) will not be overcome on the branching leading to P and Q (or to A, B, C, D, E). Let A1 >_ 0 be a fraction previously defined. Assuming that a guillotine cut is made on the rectangle represented in node N (similarly for a 1St-order cut) we define heuristic H1 as:
If: Then:
(1 + A1)~"(N) > X/(P) + ~(Q), abandon the branching leading to P and Q.
Note that if /~1 = 0, then H1 is not a heuristic anymore. Heuristic 2 (H2) Consider a node N and the partner-successors P, Q (or A, B, C, D, E). Let S '~ be any lower bound to node N. Observe that - ~ ( N ) can be greater, smaller or equal to Sa(P) +.~(Q) (or .~(A) +Sa(B) +.2a(C) +.~(D) +.~(E)). However, if . ~ ( N ) is 'substantially' greater than .~(P) +.~(Q), it might be a sign that this branching will not produce better values.
M. Arenales, R. Morabito / European Journal of Operational Research 84 (1995) 599-617
609
Let A2 _ 0 be a fraction previously defined. Assuming that a guillotine cut is made on the rectangle represented on node N (similarly for a lSt-order cut) the heuristic H2 is defined as: If: Then:
A 2 . ~ ( N ) >_.C~(P) + . ~ ( Q ) , abandon the branching leading to P and Q.
Note that if A2 = 0, then H2 is not a heuristic anymore. If the n u m b e r of elements in X and Y is large, then the size of the graph is still computationally untreatable. Two m o r e heuristics are provided. Heuristic 3, suggested by Beasley (1985a), discards a n u m b e r of elements in the discretization sets before the search begins. Heuristic 4 imposes a kind of symmetry in the lSt-order cutting pattern.
Heuristic 3 (1-I3) This heuristic redefines X and Y until IX [ < M and [Y [ _
Step 1. Let ~ = {1. . . . , m} be the set of the pieces to be used in determining X. Build the set X: X = {x such that x = E i e N a i l i -~ 0 and integer} Step 2. While ( I X J > M ) do: 1. Determine lt = min{li, i e N} 2. Redefine N ~ ~ - {j} 3. Rebuild X with the new t~. The above procedure removes from ~ the pieces with the smallest length, until set X reaches the desired size. However, with X and Y reduced in this way, we cannot assure optimality, since the optimal solution may depend on the discarded cuts.
Heuristic 4 (H4) Definition 11 (a-symmetric cut). A 1St-order cut made on a rectangle (l, w) is called a-symmetric if the external rectangles (i.e. A, B, C and D in Fig. 10a) have their length and width limited by a fraction a of 1 and w respectively. That is,
Cl>al,
c2<(1-a)l,
c3<(1-a)w,
C4>___aW,
with O_
<
~ C
T
2
C
D
US~
i
>
E B
C3
A
C 4
C I (a)
Fig. 10. Symmetric and non-symmetric 1s t -order cuttings.
(b)
M. Arenales, R. Morabito / European Journal of Operational Research 84 (1995) 599-617
610
In rough words, this definition implies that A and C are not so disparate (compare Fig. 10a and Fig. 10b). Note that a 0-symmetric cut may keep no symmetry. Another heuristic (H4) to reduce the state-space consists of avoiding patterns like the one in Fig. 10b, restricting the search to a-symmetric 1St-order cutting patterns, where a is previously given. Of course if a = 0 then H4 is not a heuristic anymore. 6. A search strategy In this section we present the search strategy used to traverse the graph described in Section 3. It is a hybrid strategy combining two basic strategies: backtracking and hillclimbing. BackTracking (BT) is an important implementation of depth-first search. It always chooses to explore the newly non-final generated node. HiUClimbing (HC) is a strategy based upon local optimization which after expanding a node (i.e. generating all its successors) chooses the best successor to be further expanded and discards the remaining ones. If a depth bound is imposed to BT, both strategies can be combined by firstly generating all nodes up to the depth bound (using the backtracking strategy), and then choosing the best path so far (hillclimbing strategy). Each non-final node in this path is again expanded up to the depth bound and so on, until the path contains only final nodes. This same hybrid strategy was also implemented by Morabito et al. (1992) and Morabito and Arenales (1992, 1994) and produced good results for two and three dimensional guillotine cutting/packing problems. Algorithm BT-HC Step 1. Let ROOT be a list which contains initially only the initial node. A node in ROOT is called root-node. Define DB as the depth bound for each expansion from a root node. Step 2. While ROOT is not empty, do: Step 3. Let s be the first node in ROOT. Generate all successors of root-node s, using the backtracking strategy and respecting DB. Take s out of ROOT. Step 4. Choose the most valuable path from s and discard the remaining paths (hillclimbing strategy). If there are nodes in this path whose depth is equal to DB and are non-final, put them in ROOT. Remarks.
(i)
In Step 3 the generation of successors from a root-node s should take into account the rules discussed in Section 4, as well as the branch and bound method and heuristics discussed in Section 5. The discretization sets X and ~/ (reduced or not by H3) are computed before the search begins. (ii) For simplicity an AND/OR-tree was implemented instead of an AND/OR-graph, that is, there is no checking to test whether a newly generated node has been generated before. Indeed, only the most valuable path is kept in memory. This makes the BT-HC algorithm almost independent of memory limitation which is very convenient for microcomputers, quite the opposite of dynamic programming. Note also that, in this implementation, Step 4 is actually implicitly considered in Step 3. It was specified to make clear the use of the hillclimbing strategy. (iii) In Step 4 each chosen path from s corresponds to a section of the complete path with depth at most equal to DB. Observe that the HC strategy, based upon local optimization in each section, does not ensure that the most valuable path (i.e., the optimum cutting pattern to the problem) is obtained, even in the absence of the heuristics presented in Section 5. That is, the algorithm BT-HC is a heuristic search itself.
611
M. Arenales, R. Morabito / European Journal of Operational Research 84 (1995) 599-617
7. Computational results The algorithm was implemented in t u r b o - P A S C A L 5.5 and executed on an IBM-PC 486 compatible, 33 M H z clock, 640 Kbytes, RAM, D O S 5.0.~ Firstly we present the results obtained in a number of examples taken from Dowsland (1984). She studied the Pallet Loading Problem where non-guillotine cutting patterns are generated for just one type of piece, with rotation allowed. To consider piece rotation, we make m = 2 d e m a n d e d pieces with dimensions (ll, w 1) and (wl, 11). As the objective is to minimize waste, we define u i l i w i / ( L W ) . Since ~'~ = L'2, the objective is equivalent to maximizing the n u m b e r of pieces in the plate. Table 1 summarizes the input data for 8 examples. Experiments with constrained guillotine cutting problems (see Morabito and Arenales, 1992) suggest we should take A1 = 0.01, A2 = 0.9 and DB = 3. Here, these values proved not to be a good choice. In fact, DB = 3 makes the size of the graph unbearably large. Thus, we used DB = 2 for all examples that were run. Table 2 shows the algorithm performance for the examples of Table 1. In Table 2 the p a r a m e t e r s A1 and A2 of heuristics H1 and H2 were initially taken as 0.01 and 0.9 respectively. The p a r a m e t e r M in heuristic H3 was chosen to be large enough to consider all discretization points. The p a r a m e t e r a in heuristic H4 was assumed equal to 0.5. Finally, the parameters AI and '~2 w e r e chosen depending on data in the following way: A~ = ~'1 and A 2 ----- 1 - 0.5v I (in this case, t) 1 = U2 -----/IW1/(LW)). Example 1 (D1) was the only one for which the algorithm with the p a r a m e t e r s as described above failed to find the optimal solution. In this case, a pattern with 23 pieces (an optimal solution) was obtained by the algorithm only with a = 0, that is, H4 was switched off. Assuming a = 0, the generated graph from D1 with A1 = 0.01 and A2 = 0.9 had 46519 nodes and the running time was 116 seconds; on the other hand, with )t 1 = U1 and A2 = 1 - 0.5 u 1 the graph had 4201 nodes generated and the running time was 22 seconds. Just to illustrate the effect of the heuristics, we switched off H1, H2, H3 and H4, that is, we took A 1 = A 2 = 0, a = 0 and M large. Then, the example D1 generated a graph with 167063 nodes in 175 seconds. These are also summarized in Table 2. It is worth noting that the cutting pattern presented by Dowsland (1984, p. 899) for example D8 is not a 1St-order cutting pattern. However, there is another one which is of U - o r d e r type and also produces 42 pieces. Fig. l l a shows the path in the A N D / O R - g r a p h corresponding to the l~t-order non-guillotine cutting pattern in Fig. l l b . Neither the 0-cuts nor the homogeneous guillotine cuttings were indicated in the figure. In addition, 20 randomly generated examples with different pieces were run for different values of A~ and A2. For these examples, rotation is not allowed. These examples were generated with the following parameters: m = 5, L = 100, W = 100, and l i and w i, i = 1,..,m, randomly generated assuming that l i / L and w i / W are uniformly distributed in [0.2, 0.5]. The utility values were defined as L'i = l i w i / ( L W ) , i = 1,...,m. Heuristics H3 and H4 had their p a r a m e t e r s fixed as M = 50 (large enough to generate all the discretization points) and a = 0.5 ( a = 0 makes the algorithm computationally too expensive). The =
Table 1 Dowsland's examples for the Pallet Loading Problem Example Piece Plate DI: (5, 3) (22, 16) D2: (7, 4) (30, 22) D3: (11, 6) (46, 34) D4: (11, 7) (50, 36)
Example D5: D6: D7: D8:
Piece (9, 7) (11, 8) (13, 10) (15, 11)
Plate (53, 51) (63. 60) (76, 73) (86, 82)
M. A renales, R. Morabito / European Journal of Operational Research 84 (1995) 599-617
612
Table 2 Algorithm performance on Dowsland's examples a = 0.5 A1 = 0.01 and A2 = 0.9 Example
Objective a
Time (sec)
D1 D2 D3 D4 D5 D6 D7 D8
22 b 23 23 23 42 42 42 42
3 3 3 3 208 197 203 198
Al = v I and A2 = 1 - 0 . 5 v 1 Number of nodes
Objective a
Time (sec)
N umbe r of nodes
3543 3855 3875 3759 155701 152895 153957 154305
22 b 23 23 23 42 42 42 42
1 1 1 1 9 11 9 59
1031 907 701 905 5625 6221 5479 42955
Al = 0.01, h 2 = 0.9, a = 0 D1
23
h I = vl, h 2 = 1 - 0 . 5 v l , a = 0
116
46519
175
167063
23
22
4201
Al = 0, A2 = 0 , a = 0 D1
23
N u m b e r of pieces in the cutting pattern. b The p a r a m e t e r a = 0.5 has limited the algorithm to this solution. a
combination a = 0 and lower values of M produced poor heuristic solutions, most of them worse than guillotine solutions. Table 3 summarizes the average values for the 20 random examples. Column VALUE presents the objective function values, and column TIME presents the running times (in seconds) for guillotine (row G) and non-guillotine (row NG) cutting patterns. The upper row corresponds to A~ values whereas the left column corresponds to A2 values. The algorithm used to produce guillotine cutting was exactly the
~C2=22~
I 82x86]
C4
c,,I
=
75
I I I -
-
C
I
=
Fig. 11. (left) Path in the A N D / O R - g r a p h which produces a solution to example D8; (right) the corresponding l~t-order cutting pattern.
M. Arenales, R. Morabito / European Journal of Operational Research 84 (1995) 599-617
613
Table 3 Average values for 20 random examples for guillotine (G) and non-guillotine (NG) cutting 0.01
0.95 0.96 0.97 0.98 0.99 1.0
G: NG: G: NG: G: NG: G: NG: G: NG: G: NG:
0.03
0.05
0.07
0.09
0.11
Value
Time
Value
Time
Value
Time
Value
Time
Value
Time
Value
Time
0.9484 0.9554 0.9483 0.9554 0.9483 0.9554 0.9483 0.9554 0.9483 0.9548 0.9473 0.9519
0.01 4.4 0.05 4.3 0.1 3.6 0.3 3.6 0.1 3.5 0.1 2.3
0.9484 0.9553 0.9483 0.9553 0.9483 0.9553 0.9483 0.9553 0.9483 0.9548 0.9472 0.9519
0.05 2.1 0.01 1.9 0.1 1.7 0.1 1.5 0.2 1.5 0.1 1.1
0.9471 0.9527 0.9471 0.9531 0.9471 0.9531 0.9471 0.9531 0.9471 0.9531 0.9459 0.9503
0.2 1.6 0.01 1.6 0.01 1.4 0.1 1.3 0.01 1.4 0.01 1.1
0.9457 0.9425 0.9456 0.9425 0.9456 0.9425 0.9456 0.9430 0.9456 0.9427 0.9433 0.94ll
0.01 1.1 0.05 1.0 0.01 0.9 0.01 0.9 0.05 0.9 0.01 0.7
0.9407 0.9387 0.9407 0.9387 0.9407 0.9387 0.9433 0.9396 0.9433 0.9394 0.9401 0.9394
0.01 0.8 0.05 0.8 0.01 0.6 0.05 0.7 0.05 0.6 0.05 0.5
0.9396 0.9358 0.9396 0.9358 0.9396 0.9358 0.9422 0.9458 0.9422 0.9358 0.9394 0.9358
0.01 0.5 0.05 0.5 0.01 0.4 0.05 0.4 0.01 0.4 0.05 0.2
same as described in Section 6, except that the successor nodes in Step 3 were only due to guillotine cuttings. Table 3 confirms the expected results, namely; if different piece dimensions are available to be combined, then (i) simpler cutting patterns (e.g. guillotine) provide good solutions and (ii) sometimes the
r 0,08 ~97
Fig. 12. Variation in the n u m b e r of nodes.
614
M. Arenales, R. Morabito /European Journal of Operational Research 84 (1995) 599-617
heuristics (unavoidable) prune those simpler patterns, yielding worse solutions. A similar remark was made in Morabito and Arenales (1995) where large unconstrained two dimensional guillotine cutting problems were focused on. There, 2-staged guillotine cutting patterns proved to be better, in the sense of objective function value and running time, than heuristic solutions for multi-staged guillotine cuttings when the discretization sets were large. Fig. 12 shows the variation in the number of nodes for different values of ,~ and "~2- Each colunm in the graphic gives the average number of generated nodes in the graph for the 20 randomly generated examples.
8. Extensions
In this section we give different lower bounds which can be used in the branch and bound method or heuristic H2 of Section 5 in order to prune branchings. In addition, we briefly point out how to extend the ideas in this paper to three-dimensional non-guillotine cutting problems. We assume that piece rotation is allowed but, for simplicity of notation, we do not consider the rotated pieces in the list of demanded pieces as before. Let N be a node representing the rectangle (1, w). The homogeneous guillotine cutting (Definition 10) using the piece i, (li, Wi) , and its rotated version, (wi, li) , provide the lower bounds given by
.~i ( N ) = vi[l/li][w/wi],
.~-~ ( N ) = q [ l / w i ] t w / l i ] ,
where ui is the utility value of piece i. Then, as defined in Section 5, 2°(N)
=
max {.9~/+(N), . ~ / ( N ) } i~(N)
where ~ ( N ) is the set of pieces that can be cut from (l, w).
Lower bounds based on homogeneous PCorder cutting Definition 12 (homogeneous lSt-order cutting). Consider a 1St-order cut and its five partner rectangles in the order according to (1) and Fig. 2a. Fill up rectangles A, B, C, D with type-i pieces using homogeneous guillotine cuttings .~-/(A), .9~/(B), .9~/(C) and S'~--/(D) (see Fig. 13). Then fill up rectangle E with type-i pieces choosing the best possibility between _9~-~(E) and .o-w~-(E). The result is a homogeneous 1St-order cutting illustrated in Fig. 13.
m
4t
'I I
Fig. 13. A homogeneous lSt-order cutting.
M. Arenales, R. Morabito/ European Journal of Operational Research 84 (1995) 599-617
615
C3C4 C2
C1 (o)
(Io)
(c)
Fig. 14. (a) A front lSt-order cut; (b) a side lSt-order cut; (c) a top l~t-order cut.
Definition 12 produces patterns used by Bischoff and Dowsland. The value of the homogeneous lSt-order cutting using piece i is given by -~X(N) =
max
{.Y~/(A) +.2~/(B) + . ~ / ( C ) +.2"7-~(D) +max{S~/(E), -~-, (E)},
(C1,C2,C3,C4)
.~/(A) +-~/+(B) +-~i (C) +.~i (D) + max{.~//(E), .~,. (E)}}. The lowerbound .~il(N) is the methodin Bischoffand Dowsland(1982)wherejust one type of piece is considered. Improved lowerbounds can also be definedas .9~'(N) =
max {.9~'(N)} i ~ [~A(N)
or
.9~2(N) =
max
{_~°(A)+2°(B) +.~°(C) +_~a°(D) +.~°(E)}.
(£1 ,C2,C3,C4)
(Note that .~2 can produce a non-homogeneous 1St-order cutting pattern.)
Three-dimensional non-guillotine cutting/packing problems The main application of the three-dimensional cutting problem is the container loading problem, which can be thought as to cutting a large box (container) into smaller ordered boxes. The cutting pattern describes how to pack the smaller boxes into the container. Morabito and Arenales (1994) extended the AND/OR-graph approach to deal with the container loading problem. This extension is straighforwardly obtained by applying the guillotine cut (Definition 1) to a box of dimensions (1, w, h). A guillotine cut at x on the length 1 produces two new partner-boxes: (x, w, h) and (1 - x , w, h) (similarly for guillotine cuts on the width and heigh). The graph nodes represent boxes and any complete path corresponds to a three-dimensional guillotine cutting/packing pattern. Similarly, the lSt-order non-guillotine cut in Definition 2 can also be straightforwardly extended to deal with boxes. Definition 13 (box lSt-order cut). A cut on a box is first-order non-guillotine type if it produces five new boxes arranged in such a way so as not to form a guillotine cutting pattern.
Now the five boxes in definition 13 depend on the face where the non-guillotine cut has been drawn (see Fig. 14). We call them front, side and top lSt-order cuts. The following sets give the boxes obtained by each of them, assuming that they are made on the box (l, w, h).
Front 1St-order cut: {(c,, w, c3), ( l - c 1, w , c4) , ( 1 - c 2 ,
w, h -c4)
, ( c 2 , w, h - c 3 ) , ( I c I - c 2 l , w, Ic 3 - Cal)}.
616
M. Arenales, R. Morabito/ European Journal of Operational Research 84 (1995) 599-617
Side lSt-order cut:
{(/, C1, C3) , (l,
W--Cl, C4), (I, W--C 2, h - c 4 ) , (l, c2, h - c a ) , (1, Ic I - c 2 l , [c 3 - c4 I)}.
Top 1St-order cut: {(C1, C3, h ) , ( l - c 1 ,
c4, h ) , ( l - c 2 ,
w-c4,
h), (c2, w-c3,
h ) , ( [ c I - c 21, I c 3 - c 4l, h ) ) .
Sections 3 to 6 can be extended with minor alterations to deal with boxes. However, additional constraints could be necessary, such as the stability of the cargo loading. In this case, the front and side cuts (see Figs. 14a and 14b) should be carefully used to avoid branchings that lead to unstable loadings (Morabito and Arenales, 1994).
9. Conclusions In this paper we presented a new approach to solve unconstrained two-dimensional non-guillotine cutting problems, where a rectangular-shaped plate must be cut into rectangular-shaped pieces and all cuts are orthogonal to one side of the plate. We restricted the generated solutions to lSt-order cutting patterns, that is, a combination of guillotine cuts and the simplest non-guillotine cuts. An AND/OR-graph was proposed to represent the solution-space, where the nodes correspond to rectangles and the AND-arcs, pointing to two or five nodes, correspond to the possible cuts on the rectangles. Each complete path in that graph corresponds to a lSt-order non-guillotine cutting pattern. In order to search the graph, backtracking and hillclimbing strategies were combined. A specific rule, based on lSt-order non-guillotine cuttings, was developed to eliminate symmetric cutting patterns. Simple lower and upper bounds were defined and a branch and bound method was described to solve the problem. These bounds were used to design heuristics in order to reduce the state-space. The algorithm, implemented in a micro-computer, was able to find the optimal solutions for a number of known examples from the literature.
Acknowledgments The authors wish to thank the anonymous referees for their useful suggestions, also Silvely Salom~o and Maxwell Orlandi for their collaboration in the initial phase of this work. The work of Reinaldo Morabito was supported in part by CNPq.
References Beasley, J. (1985a), "Algorithms for unconstrained two-dimensional guillotine cutting", Journal of the Operational Research Society 4, 297-306. Beasley, J. (1985b), "An exact two-dimensional non-guillotine cutting tree search procedure", Operations Research 33, 49-64. Bir6, M., and Boros, E. (1984), "Network flows and non-guillotine cutting patterns", European Journal of Operational Research 16, 215-221. Bischoff, E., and Dowsland, W. (1982), "An application of the micro to product design and distribution", Journal of the Operational Research Society 33, 271-280. Christofides, N., and Whitlock, C. (1977), "An algorithm for two-dimensional cutting problems", Operations Research 25, 30-44. Dowsland, K. (1984), "The three-dimensional pallet chart: An analysis of the factors affecting the set of feasible layouts for a class of two-dimensional packing problems", Journal of the Operational Research Society 35, 895-905. Dowsland, K. (1987), "An exact algorithm for the pallet loading problem", European Journal of Operational Research 31, 78-84. Dowsland, K. (1990), "Efficient automated pallet loading", European Journal of Operational Research 44, 232-238.
M. Arenales, R. Morabito / European Journal of Operational Research 84 (1995) 599-617
617
Dowsland, K., and Dowsland, W. (1992), "Packing problems", European Journal of Operational Research 56, 2-14. Dyckhoff, H. (1990), "A typology of cutting and packing problems", European Journal of Operational Research 44, 145-159. Dyckhoff, H., and Finke, U. (1992), Cutting and Packing in Production and Distribution: Typology and Bibliography, Springer-Verlag, Heidelberg. Gilmore, P., and Gomory, R. (1965), "Multistage cutting stock problems of two and more dimensions", Operations Research 14, 1045-1074. Herz, J. (1972), "Recursive computational procedure for two-dimensional stock cutting", IBM Journal of Research and Development 16, 462-469. Morabito, R., and Arenales, M. (1992), "Staged and constrained two-dimensional guillotine cutting problems: A new approach", Technical Report: Notas do ICMSC 126, Universidade de S~o Paulo, S~o Carlos, S.P., Brazil. Morabito, R., and Arenales, M. (1994), "An AND/OR-graph approach to the container packing problem", International Transactions in Operational Research 1, 59-73. Morabito, R., and Arenales, M. (1995), "Performance of two heuristics to solve large scale two-dimensional guillotine cutting problems", INFOR 32/2, May. Morabito, R., Arenales, M., and Arcaro, V. (1992), "An AND/OR-graph approach for two-dimensional cutting problems", European Journal of Operational Research 58 2, 263-271.