Published online ahead of print July 2, 2010

INFORMS Journal on Computing informs ® Articles in Advance, pp. 1–11 issn 1091-9856 eissn 1526-5528 doi 10.1287/ijoc.1100.0394 © 2010 INFORMS

A Parallel Branch-and-Bound Approach to the Rectangular Guillotine Strip Cutting Problem

Sławomir Bak,˛ Jacek Bła˙zewicz,Grzegorz Pawlak, Maciej Płaza Institute of Computing Science, Pozna´nUniversity of Technology, 60-965 Pozna´n,Poland {[email protected], [email protected], [email protected], [email protected]} Edmund K. Burke, Graham Kendall School of Computer Science, University of Nottingham, Nottingham NG8 1BB, United Kingdom {[email protected], [email protected]}

his paper presents a parallel branch-and-bound method to address the two-dimensional rectangular guil- Tlotine strip cutting problem. Our paper focuses on a parallel branching schema. We present a series of computational experiments to evaluate the strength of the approach. Optimal solutions have been found for some benchmark instances that had unknown solutions until now. For many other instances, we demonstrate that the proposed approach is time effective. The efficiency of the parallel version of the algorithm is compared and the speedup, when increasing the number of processors, is clearly demonstrated with an upper bound calculated by a specialised heuristic procedure. Key words: production scheduling; cutting stock; material handling; parallel branch-and-bound method; analysis of algorithms History: Accepted by Michel Gendreau, former Area Editor for Heuristic Search and Learning; received November 2007; revised August 2008, May 2009, January 2010; accepted February 2010. Published online in Articles in Advance. version, which is made available to institutional subscribers. The file may

1. Introduction complexity of the problem is increased by different The cutting and packing family of problems affects constraints within various manufacturing industries, several different industries and motivates many areas including paper, wood, glass, and metal cutting. For of research. Research going back at least 50 years has example, paper cutting is generally concerned with led to the development of many models and math- guillotine cutting (where only vertical or horizontal ematical tools. The diversity of this type of prob- straight cuts, across the entire sheet, are allowed) of Articles in Advance lem has made it necessary to introduce a consistent rectangular items from a stock roll of fixed width, typology that was proposed by Dyckhoff (1990) and whereas applications in metal and shipbuilding are further developed by Wäscher et al. (2007). The earli- often concerned with the cutting of irregular shapes est work in this area was conducted by Gilmore and from a stock sheet (see, for example, Bła˙zewiczet al. Gomory (1961), where they solved one-dimensional 1993). Despite their industrial relevance, irregular cut- problems to optimality using . An ting problems have not been widely researched, but example of a one-dimensional problem is the divi- the area has gained popularity in recent years (see, for sion of steel bars or rods into smaller lengths for example, Bennell and Oliveira 2006). In some applica- fabrication or resale. However, only small problem tions the pieces cannot be rotated—for instance, cut- instances could be solved in reasonable time. Gilmore ting pieces from wooden boards that have to take the and Gomory (1966) characterised knapsack functions wood grain into account—but in other applications, and used them to develop more efficient methods. such as cutting pieces from steel sheets, rotation is INFORMS holds copyright to this Generalisations of these methods were also applied to often allowed. two-dimensional problems. The two-dimensional is a Two-dimensional problems can be modelled as a generalisation of the one-dimensional knapsack prob- set of pieces that must be arranged on a predefined lem. In two dimensions, a large stock rectangle S of dimensions L × W and n types of smaller rectangular Copyright: not be posted on any other website, including the author’s site. Pleasestock send any questions regarding this policy to [email protected]. sheet so that each piece does not overlap with another, and of course, each piece must fit within the pieces are presented. Each smaller piece has an asso- bounds of the sheet. The main objective is to maximise ciated profit. The problem is to cut from S a set of space utilisation and therefore minimise wastage. The small rectangles so that the overall profit is maximised.

1 Bak˛ et al.: A Parallel Branch-and-Bound Approach to the Rectangular Guillotine Strip Cutting Problem 2 INFORMS Journal on Computing, Articles in Advance, pp. 1–11, © 2010 INFORMS

This problem can be classified as 2/B/O/M accord- routine (called the “difference process algorithm”), ing to Dyckhoff’s typology (Dyckhoff 1990) and as which can access enclosed areas in the partial layout. a two-dimensional placement problem in Wäscher’s Every insertion of a new item in the layout creates typology (Wäscher et al. 2007). A variety of solution two empty rectangular spaces. The algorithm keeps methods, both exact and approximate, have been pre- track of the newly generated spaces, selecting the one sented and discussed over the years. Gilmore and that is closest to the bottom-left corner of the object Gomory (1966) proposed a recursive exact algorithm and that is sufficiently large for the allocation of the based on to solve the uncon- next rectangle. This method outperforms the algo- strained guillotine version. Wang (1983) proposed a rithms of Jakobs (1996) and Liu and Teng (1999). Dagli bottom-up approach that generates all of the feasible and Poshyanonda (1997) used a placement method cutting patterns by horizontally or vertically combin- that is based on a sliding technique combined with an ing two patterns that may be constructed from two artificial neural network. During the packing process, other patterns. Viswanathan and Bagchi (1993) used a the generated scrap areas are recorded. The neural net- bottom-up approach, together with the Gilmore and work selects the best match between the item and the Gomory procedure, to develop a best-first branch- empty areas. and-bound algorithm for the constrained version of Genetic algorithms have also been considered the problem. Hifi (1997) improved their algorithm by for guillotineable packing problems. Kröger (1995) exploiting dynamic programming properties. proposed a slicing representation. A guillotine Another well-studied cutting and packing problem, constraint is directly reflected by the encoding mech- proposed by Baker et al. (1980), is the strip packing anism. The rectangles are stored in the leaf nodes. problem. In strip packing, we have to pack (or cut) a The nodes are connected by the use of one of two set of small rectangular pieces of different sizes into a operators indicating a horizontal or a vertical combi- single rectangle (strip) of fixed width W . The length L nation. The tree is represented by a string over the is unlimited. The objective is to minimise the length to alphabet 1 2 3nhv, where h and v repre- sent a horizontal and vertical combination, respec- which the strip is filled. The problem has been shown tively. The string has the length of 2n − 1, where n to be NP-hard in Hochbaum and Maass (1985) and is the number of rectangles to be packed. A special Leung et al. (1990). There have been many different crossover operator was used with only subtrees with approaches for producing solutions for the strip pack-

version, which is made available to institutional subscribers. The file may a certain structure able to be inherited. The size of ing problem. It should be noted that to deal with large- each subtree should include at most four rectangles. scale problems, most of these approaches are heuristic After crossover, the insertion of single rectangles that in nature (Burke et al. 2004, Hopper and Turton 2001, are missing from the complete set is carried out. Muta- Lodi et al. 2002). tion is carried out by the application of an operator, Several papers have approached the nonguillotine- randomly chosen from a set of five, to a randomly able strip packing problem with genetic algorithms selected substring. A hill-climbing strategy is applied in combination with heuristic placement routines. to improve the fitness of a recently mutated or recom- Articles in Advance In this two-stage approach, a genetic algorithm is bined string. Kröger also proposes the concept of used to determine the sequence in which items are metarectangles. Each metarectangle describes a group to be packed. A second algorithm is then utilised, of densely packed rectangles that are subsequently which decides how this sequence is allocated onto treated as one large rectangle, thus reducing the prob- the strip. One of the first researchers to implement lem complexity. Kröger empirically demonstrated that this approach is Smith (1985). Jakobs (1996) used the solution produced by the genetic algorithm was a bottom-left heuristic to hybridise an order-based superior to other approaches such as random search genetic algorithm. To reduce computational complex- or simulated annealing. ity, the heuristic does not necessarily search for the Hwang et al. (1994) proposed two methods for solv- lowest available position in the layout but preserves ing the strip packing problem. One approach is based bottom-left stability. Liu and Teng (1999) improved on a directed that combines two rectangles the bottom-left (BL) routine by using a sliding princi- into a larger one by either placing them horizontally ple and giving priority to the downward movement or vertically next to each other. The second approach is INFORMS holds copyright to this of the rectangle. Hopper and Turton (1999, 2000) also order based and applies a level-oriented packing pro- developed a BL algorithm that can access enclosed cedure, where a level is defined as a horizontal line areas in the partial layout and places the new item in drawn through the top of the tallest rectangle on the the first BL position with sufficient area. This pack- previous level. The order-based method gave better Copyright: not be posted on any other website, including the author’s site. Pleaseing send any questions regarding this policyroutine to [email protected]. was combined with genetic algorithms and results. Recently, Bortfeldt (2006) suggested a genetic simulated annealing. Simulated annealing generally algorithm where fully defined layouts are manipu- achieved better results but required longer run times. lated by means of specific genetic operators instead of Leung et al. (2001) also proposed a BL-placement encoded solutions. Bak˛ et al.: A Parallel Branch-and-Bound Approach to the Rectangular Guillotine Strip Cutting Problem INFORMS Journal on Computing, Articles in Advance, pp. 1–11, © 2010 INFORMS 3

Of course, researchers have used search methods solve some small problem instances within reasonable other than genetic algorithms. Faina (1999) proposed time. a hybrid simulated annealing algorithm for both Despite the extensive research that has been car- the guillotineable and nonguillotineable stock cutting ried out on cutting and packing problems, not many problems. Although the algorithm was formulated exact algorithms for the guillotine strip packing prob- for a stock cutting problem, the evaluation assumes lem have been formulated. Furthermore, existing algo- only one object of unlimited height (i.e., strip pack- rithms are capable of solving only small problem ing). The set of items is represented as a permuta- instances. In this paper we propose a new algorithm. tion, indicating the order of packing. Two heuristic The algorithm has been formulated with the idea methods are used to pack the items onto the stock of taking advantage of parallel computation to solve sheet. Leung et al. (2001) also applied an order-based the instances for which no optimal solution has been approach using simulated annealing. However, this found so far. method was shown to be less efficient than genetic algorithm approaches. 2. Problem Description Burke et al. (2004) proposed a different approach to The focus of this paper is the rectangular guillotine the nonguillotineable packing, the best-fit (BF) algo- strip packing problem. It can be formally stated as fol- rithm. Usually, a placement algorithm takes a list of lows: m small rectangular items are to be cut from shapes sorted by some property and allocates these a plate, where any cut that is made is restricted to items on the strip in the order presented. The method be an orthogonal guillotine cut, and the small items proposed in Burke et al. (2004) searches for the best have to be laid out orthogonally on the plate. Some fitting rectangle from a candidate list. Later, Burke of the parts can be identical, but there are n num- et al. (2009) improved this heuristic by adding a ber of different types of the parts. The guillotine cut metaheuristic phase. Alvarez-Valdes et al. (2008) also means a horizontal or a vertical cut on a (sub)rectangle investigated several strategies for the constructive and being cut from one edge of the (sub)rectangle to the improvement phases. They presented a greedy ran- opposite edge, parallel to the two remaining edges. × domised adaptive search procedure (GRASP) where The ith item has a fixed size li wi (length li and = the selection of the next element is not deterministic. width wi), i 1m, and items may not be rotated. Zhang et al. (2006) presented a recursive heuristic The plate width W is fixed. The length is variable and version, which is made available to institutional subscribers. The file may algorithm for the guillotineable strip packing problem. has to be minimised. This problem has been assigned Their algorithm is fast and outperforms other known as 2/V /D/M in Dyckhoff’s (1990) typology, whereas metaheuristics, especially for larger test problems. Cui Wäscher (2007) classifies it as a two-dimensional open et al. (2008) also used a recursive heuristic algorithm dimension problem. for the guillotineable strip packing problem and com- bined it with . 3. Approaches to the Problem Martello et al. (2003) recently considered the 3.1. Sequential Branch-and-Bound Algorithm

Articles in Advance nonguillotineable strip packing problem using an exact approach. They proposed a new relaxation that It has already been shown that every guillotine cut- produces good lower bounds (LB) that allow effec- ting pattern can be represented by a binary tree (see tive heuristic algorithms to be used. These results were Kröger 1995). Each leaf node of the tree represents a used in a branch-and-bound algorithm that was able single small item, and all other nodes represent either to solve instances of up to 200 items. Hifi (1998) pre- a horizontal or vertical cut. The cut separates items sented two exact algorithms for the guillotine strip contained in the subtrees of the node. Such trees are packing problem using branch-and-bound techniques. called slicing trees. An example of a tree is shown in n The first algorithm made use of the two-dimensional Figure 1. It can be seen that each of the nodes i, repre- senting the cuts, may also be interpreted as a metarect- cutting stock algorithm introduced by Hifi (1997) angle. The metarectangle is composed by joining the called MVB (a modified version of Viswanathan and two metarectangles represented by its children nodes, Bagchi 1993) by reducing the strip cutting problem n and n . The dimensions of these metarectangles to a series of two-dimensional problems. The second li ri

INFORMS holds copyright to this are approach is based on the best-first search strategy  combined with MVB. It heuristically constructs the ini- l + l if n is a horizontal cut l = nli nri i (1) tial larger rectangle with the length of L and then ni max maxln ln if ni is a vertical cut; to reduce the length. If a feasible reduced rect- li ri and Copyright: not be posted on any other website, including the author’s site. Pleaseangle send any questions regarding this policy to [email protected]. exists, then Lmax is updated and another itera-  tion of the algorithm attempts to construct a smaller maxwn wn if ni is a horizontal cut rectangle containing all items. Computational results w = li ri (2) ni w +w if n is a vertical cut showed that the proposed algorithms are only able to nli nri i Bak˛ et al.: A Parallel Branch-and-Bound Approach to the Rectangular Guillotine Strip Cutting Problem 4 INFORMS Journal on Computing, Articles in Advance, pp. 1–11, © 2010 INFORMS

representation results in a significant number of iso- morphic solutions. In this case, there are two possible types of isomor- phism. The first type is a property of the considered problem. It is defined as the possibility of exchang- v ing the positions of two adjacent metarectangles with- out affecting the positions of any others. The simplest example is the possibility of swapping the order of any child nodes where neither node changes its dimen- sions nor the rectangles used in its subtree. Thus, it does not affect any other nodes. In general, any set of n metarectangles separated consecutively by only one type of cut can be rearranged in n! ways without changing the overall result. The second type of isomorphism is a result of the representation method used; i.e., we are represent- ing the same cutting pattern by a number of differ- v h ent trees. An example of such a situation is shown in Figure 2. If the algorithms take into account all isomorphic slicing trees, then the solution space radi- cally increases. These redundancies cause an unnecessary increase of the overall computational complexity. It suggests that avoiding isomorphic trees by limiting the number of feasible trees is worthwhile. In this paper, we remove the possibility of creat- ing different trees representing the same cutting pat- v

version, which is made available to institutional subscribers. The file may tern that cause the second type of isomorphism. It can h be achieved by adding an additional condition stating 2 that no node can represent the same type of cut as its right-hand child. This limitation leaves only the sec- ond tree from Figure 2, making the others infeasible. 1 Such created trees are called skewed slicing trees. This does not limit the possibility of obtaining any solu- tion, as any series of the same type of cuts can still be Articles in Advance represented as a list consisting of left-hand children. We have applied two constraints to prevent the possibility of rearranging the order of metarectangles without affecting the result, therefore removing the 6 first type of isomorphism. Both depend on the lexico- 3 4 graphical ordering of trees represented as a string over the alphabet − 1 2 3 n, where “” and “−” rep- resent vertical and horizontal cuts and 1 n are the 5 types of items to be placed, obtained by a preorder traversal of the tree. The first condition requires, for each inner node, that its right-hand subtree does not precede the left-hand subtree in the proposed order- INFORMS holds copyright to this ing. This deals with the possibility of reordering two Figure 1 Tree Representation of a Cutting Pattern metarectangles separated by a single cut. If a series of the same type of cuts exists in a solution, the first of the introduced limitations requires them to be repre- 3.1.1. Metarectangle Tree Isomorphism, Skewed sented as a list consisting of left-hand children nodes. Copyright: not be posted on any other website, including the author’s site. Please send any questions regarding this policy to [email protected]. Slicing Tree. It should be noted that although this This means that it is sufficient to require for each inner tree is capable of representing any feasible solution, node that its right-hand subtree does not lexicographi- the symmetrical nature of both the problem and the cally precede the right-hand subtree of the considered Bak˛ et al.: A Parallel Branch-and-Bound Approach to the Rectangular Guillotine Strip Cutting Problem INFORMS Journal on Computing, Articles in Advance, pp. 1–11, © 2010 INFORMS 5

4 – – – – –

3 – – – –

2 – – – – – –

1 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4

Figure 2 Redundant Representations of the Same Pattern

node’s left hand child, if both the considered node and considered has been found, so the ordering is the same its left-hand child represent the same type of cut. It as in the alphabet used to represent the tree. For each ensures that exactly one ordering is feasible for that of the created patterns it is then checked to see if it cutting pattern. All of the necessary comparisons for represents a full solution, i.e., contains all of the avail- a sample tree are shown in Figure 3. When the sym- able pieces. Otherwise, the same bottom-up method is metry feature is employed, each correctly generated applied to the newly created metarectangle. slicing tree could be transformed to the one that is iso- 3.1.2. The Lower Bound Calculations. We used morphic. This isomorphic tree can start from the first two methods for calculating lower bounds to reduce element. Moreover, the condition for the elimination the computational complexity. The first one is calcu- of the isomorphic slicing trees are fulfilled when the lated whenever both subtrees of any particular node slicing trees are constructed from the first element. are set. When this happens, no other item may be This tree representation is the basis of the branch- placed inside the metarectangle represented by the and-bound algorithm that we propose in this paper. node (we call that rectangle closed), so any unused The tree is constructed by a bottom-up approach (see space inside it will be wasted. The lower bound on the Algorithm 1). The algorithm starts by placing a single pattern’s length is calculated as   item in the bottom-left corner of the sheet. Then it con- m ∈ WSR + = w l structs the tree by introducing a horizontal or vertical = R closed rectangles i 1 i i LBc (3) cut along its edge, thus finding all feasible ways to fill W version, which is made available to institutional subscribers. The file may the unused part of the sheet. In terms of the tree repre- with WSR representing the wasted space inside the sentation, this can be described as adding a new node rectangle R and m denoting the number of available as the root of the tree. The previous root is set as its items. This lower bound has been further enhanced by left-hand child and then finding all feasible right-hand noticing that the length must be a linear combination subtrees. These patterns are constructed using a top- of the individual item’s lengths, so a minimal of those

down approach (see Algorithm 2); i.e., for each of the linear combinations, not smaller than LBc, is used as considered nodes it is first decided what it represents the lower bound. (horizontal or vertical cut, or a single item). Then if a The second lower bound is used during the top- Articles in Advance cut is chosen, the subtrees of that node are processed down construction of the pattern, filling the part of in the same way. No satisfactory method of determin- the sheet created after the initial cut in the branching ing the order in which the possible choices should be method. As the pattern is constructed in a top-down man- ner, information about the cuts surrounding the con- | sidered metarectangle is available. This means that it

1 expandTree(Tree tree) 2 begin | 3 check lower bound 4 Node root ← new Node 5 root.left ← tree.root 6 root.right ← new Node INFORMS holds copyright to this 7 tree.root ← root – – 8 for root.content in − 9 begin 10 fillTree(tree, root.right, root) 11 end Copyright: not be posted on any other website, including the author’s site. Please send any questions regarding this policy to [email protected]. 12 end

Figure 3 Comparisons Preventing Tree Isomorphisms Algorithm 1 The Bottom-Up Tree Building Method Bak˛ et al.: A Parallel Branch-and-Bound Approach to the Rectangular Guillotine Strip Cutting Problem 6 INFORMS Journal on Computing, Articles in Advance, pp. 1–11, © 2010 INFORMS

1 fillTree(Tree tree, Node node, Node previous) 2 begin 3 if previous=node.right //both subtrees of the node are filled 4 begin 5 check lower bound 6 if node=tree.root 7 begin 8 if tree contains all available items 9 tree is a feasible solution 10 else 11 expandTree(tree) 12 end 13 else 14 begin 15 fillTree(tree, node.parent, node) 16 end 17 end 18 else if previous=node.left //only left subtree is filled 19 begin 20 fillTree(tree, node.right, node) 21 end 22 else 23 begin 24 check lower bound 25 minContent ← minimal feasible node content according to tree redundancy preventing methods 26 for node.content in minContent..n 27 begin 28 if no item of type node.content is available 29 continue 30 if node.content is an operator 31 begin 32 node.left ← new Node 33 node.right ← new Node

version, which is made available to institutional subscribers. The file may 34 fillTree(tree, node.left, node) 35 end 36 else 37 begin 38 fillTree(tree, node.parent, node) 39 end 40 end 41 end 42 end Articles in Advance

Algorithm 2 The Top-Down Tree Filling Method

is possible to calculate the minimal number of items The heights of x and z are used to evaluate the lower that will be placed on top of it and to its right. This bound function. enables us to use information about the items unused When the minimal element is chosen from the so far to calculate the minimal width and length of remaining rectangles, then LB can be calculated. The the current pattern that can be compared to the sheet’s LB width is compared to the width of the available width and the known upper bound for the solution, space and the height is compared to the best-known respectively. solution. In Figure 4, we show an example of the lower bound 3.2. Branch-and-Bound Parallelisation calculation. Looking at item 8 (see Figure 4) and the The proposed algorithm has been developed with INFORMS holds copyright to this presented pattern, we can see that at least two unused parallelisation in mind. Therefore, not many modi- items (items x and z) will be on top of item 8, and fications are necessary to make it run on multiple at least one unused item (item y) will be on the right processors. The bottom-up approach is based on creat- side of item 8; y is the item with minimal width (of the ing subsequent intermediate metarectangles that can unused items), and x and z are the items with mini- Copyright: not be posted on any other website, including the author’s site. Please send any questions regarding this policy to [email protected]. be processed independently of each other. Therefore, mal height (among the unused items). Considering the the idea of parallelising the algorithm is based on width of y, the pattern width is compared with the giving each of the available processors a separate fixed width of the strip to restrict the solution space. metarectangle to work on. Bak˛ et al.: A Parallel Branch-and-Bound Approach to the Rectangular Guillotine Strip Cutting Problem INFORMS Journal on Computing, Articles in Advance, pp. 1–11, © 2010 INFORMS 7

|

––

| | | z

– – ––7 y

1 2 3 4 5 6 8 x

z 6 5 7 x

4 y 2 8 1 3

Figure 4 The Lower Bound Calculation Example

We do this by selecting one process to act as a server subtrees used has been slightly modified at this step that is responsible for distributing the work, and the so that the alphabet is + 1 2 3 n, with + repre- other processes (which are running on different pro- senting both types of cuts. This has been done to avoid cessors) are assigned to act as “workers” that perform a situation when the root of the tree built from the first the computations assigned by the server. The server two items used is a vertical cut. Following the previ- initiates the computation by finding an initial upper ous alphabet definition (see §3.1.1), every tree having bound, broadcasting it to all of the workers, and then a horizontal cut as the root node would lexicograph- sending each of them a single work unit. The work unit ically succeed it. This would lead to the creation of a

version, which is made available to institutional subscribers. The file may represents the slicing subtree that the worker treats as very large number of work units in the second itera- the starting point for the bottom-up algorithm. When- tion of the bottom-up algorithm. As all the work units ever a worker finishes processing an assigned unit of need to be created before being sent to the workers, work, it asks the server for another job and receives this situation could result in the server spending too either a new work unit or the instruction to finish much time on sequential calculations without using work if all the necessary computations have been com- the workers, thus decreasing the potential for paral- pleted. Whenever a worker finds a solution better than lelisation. Furthermore, the existence of many small the current upper bound, it sends the solution to the work units might cause the workers to spend more Articles in Advance server, which then broadcasts the new upper bound to time on communication with the server than on the all the other workers. computations, which would also be a waste of the We have defined the work units that need to be pro- available processing power. With the new alphabet, cessed as all the metarectangles obtained by apply- the work items are limited to all feasible subtrees with ing two steps of the bottom-up creation algorithm to a height of two. All patterns of feasible work units each of the available rectangles. The ordering of the are shown in Figure 5. For clarity, the sample is lim-

| —

— — | |

1 2 3 4 1 2 3 4 INFORMS holds copyright to this

| | — —

| 3 — 3 | 3 — 3 Copyright: not be posted on any other website, including the author’s site. Please send any questions regarding this policy to [email protected]. 1 2 1 2 1 2 1 2

Figure 5 Feasible Work Unit Patterns Bak˛ et al.: A Parallel Branch-and-Bound Approach to the Rectangular Guillotine Strip Cutting Problem 8 INFORMS Journal on Computing, Articles in Advance, pp. 1–11, © 2010 INFORMS

ited to a single tree for each feasible pattern. In prac- area and its length. We also used two methods for tice all feasible combinations of items placed in the selecting the type of cut that is performed. The selec- leaves of these trees are used. The generated work tion is based on the difference between the areas of units are assigned to workers in the order of nonde- the resulting spaces. The difference can either be min- creasing lower bounds. imised or maximised. We used all of the possible combinations of these methods, which led to eight 3.3. Upper Bound different variants of the algorithm. We use a heuristic algorithm to obtain the initial upper bound to reduce the computational complexity. The algorithm is a slight modification of the one pro- 4. Results posed by Zhang et al. (2006). It is based on placing This section is divided into two parts and presents subsequent items in the bottom left corner of the con- the computational results of applying our approach sidered strip area and limiting further possibilities by to the test problems. Firstly, the proposed sequential carrying out cuts resulting from the selected place- method is tested and compared against the algorithm ment. Whenever an item is placed on the strip, it needs proposed by Hifi (1998). Secondly, the parallel algo- to be accompanied by either a horizontal or a verti- rithm is tested and compared with its sequential ver- cal cut spanning the entire available area. In the algo- sion. The instances used in the computational experi- rithm, the placement of an item (the black rectangle) in ment are all represented as integer values. The appli- an unbounded space S (see Figure 6) is always accom- cation of the algorithms could easily be extended to panied by a horizontal cut, whereas both types of cuts rational values.

can occur inside bounded spaces S2 (see Figure 7). The same method is then applied recursively to both of the 4.1. The Sequential Algorithm newly created areas. We implemented the sequential version of the pro- Many orderings in which the items are to be placed posed algorithm in the C language and tested it on a can be used. We chose to use four, i.e., both nonde- computer with a 2.2 GHz AMD Opteron 248 processor creasing and nonincreasing orders of both the item and 2 GB of RAM. We used the 25 problem instances of various sizes introduced in Hifi (1998). The compu- tational results are shown in Table 1, where the follow- version, which is made available to institutional subscribers. The file may ing information is included for all of the instances:

S Table 1 Performance of Different Approaches on 25 Problem 1 Instances S Instance Hifi Branch and bound

Short Best-first S2 Incremental interval search Without

Articles in Advance WnmLopt UB MVB MVB MVB UB With UB

SCP1 5 5 10 13 13 <01 <01 <01 <001 <001 Figure 6 Division of an Unbounded Space SCP2 4 5 11 40 40 343412 <001 <001 SCP3 6 5 15 14 15 6868194004 001 SCP4 6 6 11 20 22 78678641 <001 <001 SCP5 20582020 <01 <0101 <001 <001 SCP6 30773838 5469534 <001 <001 S 3 SCP7 15581415 181814 <001 <001 S4 SCP8 15 5 12 17 20 040423 <001 <001 SCP9 27 6 12 68 77 070701001 <001 SCP10 50488080 <01 <0105 <001 <001 SCP11 27 10 10 48 52 2215 389607 <001 <001 SCP12 81 6 18 34 38 131327001 <001 SCP13 70775051 395196168 <001 <001 S2 SCP14 100 4 10 69 83 417305487 <001 <001 SCP15 45 10 14 34 38 0707 1657402 316 INFORMS holds copyright to this SCP16 6 7 14 33 34 6548 6548 1814005 003 SCP17 429939402273 2335 3236 <001 <001 SCP18 70 5 10 101 104 3215 2178 3278 <001 <001 S3 SCP19 5 6 12 26 27 1794317943 473 001 <001 SCP20 15 10 10 21 22 8743 5711 6739002 002 SCP21 30 7 11 145 145 175761757620018001 001 Copyright: not be posted on any other website, including the author’s site. Please send any questions regarding this policy to [email protected]. SCP22 90 10 22 34 43 606606 757828247 S4 SCP23 15 5 12 35 38 6919 312710319006 006 SCP24 50 10 10 114 118 6265 5129255857003 002 SCP25 25 15 15 36 41 373583800326629765 754 Figure 7 Division of a Bounded Space Bak˛ et al.: A Parallel Branch-and-Bound Approach to the Rectangular Guillotine Strip Cutting Problem INFORMS Journal on Computing, Articles in Advance, pp. 1–11, © 2010 INFORMS 9

• The width W of the initial strip, the number Table 2 Computation Times (in Seconds) of types of items to cut n, and the total number of Parallel number of processors items m; Instances Sequential 2 4 6 8 10 12 14 16 18 20 • The optimal length Lopt; • The upper bound UB produced by the heuristic SCP1 <0016144444615155 recursive algorithm; SCP2 <00150554454146 • The execution times (measured in seconds) SCP3 00153551441415144 obtained in Hifi (1998); and SCP4 <0015445445446 • The execution times (measured in seconds) for SCP5 <0014454444445 SCP6 <001435544415412 our algorithms, with and without using the heuristic SCP7 <00144514444544 recursive algorithm to find the initial upper bound. SCP8 <0014444514441412 Hifi’s approaches were also coded in C, but they SCP9 <0014445414144512 were tested on a Sparc-Server20 (module 712 MP) SCP10 <0013444444444 computer. Therefore, it is very difficult to compare the SCP11 <0014354554455 SCP12 <0014556655667 speed of processors and execution times. Great speed SCP13 <0014344444444 improvement can be seen, but it is impossible to state SCP14 <0015354445445 how much of this is the result of the algorithm’s per- SCP15 3164455444455 formance and how much is generated by the com- SCP16 0034344454454 SCP17 0014454444455 puter speed difference. Our algorithm outperforms all SCP18 0014445454455 of Hifi’s approaches for all instances except for SCP15. SCP19 <00153544441444 We present our results both with and without the ini- SCP20 0024355444445 tial upper bound found by the heuristic algorithm. SCP21 0014344444456 We see that the algorithm requires less time when SCP22 2474561711111089988 SCP23 00654544541445 the upper bound is used. The difference is not large SCP24 0024355454555 because of the small size of the instances. It can be SCP25 7 54 7465655667 expected that for larger instances, the upper bound would significantly influence the execution time. required by the sequential algorithm. This is the result version, which is made available to institutional subscribers. The file may 4.2. The Parallel Algorithm of the modifications made to the definition of feasi- We performed the first set of tests of the parallel algo- ble trees, which gives worse performance on that par- rithm on the same instances that were used for the ticular instance. This can, however, be compensated purpose of testing the sequential version. The tests by increasing the number of processors, which greatly have been performed on a cluster of computers, each decreases the overall computation time. having two 2.2 GHz AMD Opteron 248 central pro- The fact that these instances proved to be too small cessing units (CPUs) and 2 GB of physical memory. to notice any performance gain resulting from the par-

Articles in Advance The results, together with the times obtained by the sequential algorithm, are shown in Table 2. The num- allelisation led us to perform tests on a set of instances ber of processors shown in the table represents all of containing more items. We used classes C1–C3 from the used CPUs, including the one employed for the Hopeer and Turton (2000). The number of items used server process. That means that there is one processor in these instances ranges from 16 to 29. Although exact less doing actual computations than the number in the solutions of these instances are known for the nonguil- table. lotinable problem version, so far they have not been It can be seen that on most of the instances, the solved when only guillotine cuts are allowed. The parallel algorithm performs noticeably worse than the time needed to solve these instances using a differ- sequential version. Similar times obtained for almost ent number of processors is shown in Table 3. The all of the instances and the number of CPUs used point table also contains the comparison of the optimal solu- to the fact that most of this time is spent on setting up tion lengths for the guillotinable (LG) and nonguil- the parallel processing environment and this overhead lotinable (LNG) problem versions. For the upper bound INFORMS holds copyright to this is unavoidable. There are only two exceptions to this. (UB) calculation, the approach of Zhang et al. (2006) The first is instance SCP25. This is the only instance was employed. The computational experiment for the that takes more time to solve by the sequential algo- sequential version of the algorithm was performed on rithm than the necessary setup time for the parallel the Intel Core Duo T2400, with 1.83 GHz and 2 GB of RAM. Copyright: not be posted on any other website, including the author’s site. Pleaseone, send any questions regarding this policy to [email protected]. which enables the latter to perform slightly bet- ter. On the other hand, the time needed for the parallel These results show that the smallest instances of algorithm to solve the SCP22 instance using just one this set are still too easy to solve in order to use a CPU for the calculations is much greater than the time parallel algorithm. For the harder cases, however, the Bak˛ et al.: A Parallel Branch-and-Bound Approach to the Rectangular Guillotine Strip Cutting Problem 10 INFORMS Journal on Computing, Articles in Advance, pp. 1–11, © 2010 INFORMS

Table 3 Computation Times (in Seconds)

Instance Sequential Number of parallel processors

nmLNG LG UB 1 2 4 6 8 10 12 14 16 18 20

C1P1 16 16 20 20 20 <00153515444455 C1P2 15 17 20 21 22 20577656655766 C1P3 14 16 20 20 21 <001414454414764 C2P1 22 25 15 15 16 4775577566667 C2P2 21 25 15 16 16 58,321 416 152 104 82 67 60 60 62 61 63 C2P3 19 25 15 15 15 0024145 41344445 C3P1 26 28 30 30 33 dnf 159795 9551 68 66 63 62 59 58 59 60 C3P2 28 29 30 31 34 dnf 59846 19545 19380 16151 16080 15481 9180 8944 8650 731 C3P2 28 28 30 30 34 dnf dnf 1076 77 39 37 36 33 35 33 36

Note. dnf, did not finish.

Table 4 Speedup

Number of processors

Instance 2 4 6 8 10 12 14 16 18 20

C2P2 1 274 4 507 621 693 693 671 682 66 C3P1 1 167234993 242114 253643 257743 270839 275509 270839 266325 C3P2 1 306 309 371 372 387 652 669 692 8187

parallelisation offers a significant improvement in per- than in algorithms presented in the literature. The formance. This is particularly apparent for the C3P3 sequential algorithm served as a base for a paral- instance. For this instance, the parallel algorithm failed lel version. The experimental results show that this to finish within 48 hours, using just one worker pro- algorithm can solve instances that were previously cess, which can be viewed as a sequential version of unsolved to optimality. Generally speaking, the idea of version, which is made available to institutional subscribers. The file may the algorithm, whereas the parallel version of the algo- slicing trees may be used to handle rotations; however, rithm, using just eight CPUs, reduced the computation we did not consider this in this paper but plan to add time to less than 40 seconds. The speedup for these this enhancement in our future work. Furthermore, instances is shown in Table 4. It can be seen that the the development of better bounds and tree traversal speedup is greater than linear. This is not only a result methods for the branch-and-bound method might be of increasing the available processing power but also beneficial. Additional research can also be carried out decreasing the amount of required computation. This to optimise the parallelisation method—for example, Articles in Advance is because the parallel processing of a few different by introducing load balancing techniques. work units may result in finding good solutions ear- lier, which leads to a larger number of branches cut in Acknowledgments the branch-and-bound phase. This research was partially supported by the Ministry of Science of Poland Grant NN519188933. 5. Conclusions A new approach for solving the two-dimensional guil- References lotine strip cutting problem has been proposed. Two Alvarez-Valdes, R., F. Parreño, J. M. Tamarit. 2008. Reactive versions of the algorithm have been implemented: the GRASP for the strip-packing problem. Comput. Oper. Res. 35(4) first version is sequential, and the second is parallel. 1065–1083. Baker, B. S., E. G. Coffman Jr., R. L. Rivest. 1980. Orthogonal pack- Our main contribution in this paper is the branching ings in two dimensions. SIAM J. Comput. 9(4) 846–855. schema, forming the binary trees where the horizontal Bennell, J. A., J. F. Oliveira. 2006. The geometry of nesting problems: INFORMS holds copyright to this and vertical cuts are represented. This parallelisation A tutorial. Eur. J. Oper. Res. 184(2) 397–415. is profitable for some instances (see Table 4) and sig- Bła˙zewicz, J., P. Hawryluk, R. Walkowiak. 1993. Using a tabu search approach for solving two-dimensional irregular cutting nificantly improves the performance of these instances problem. Ann. Oper. Res. 41(4) 313–325. (see Table 3). Although the literature results are quite Bortfeldt, A. 2006. A genetic algorithm for the two-dimensional strip packing problem with rectangular pieces. Eur. J. Oper. Res. Copyright: not be posted on any other website, including the author’s site. Pleaseoutdated, send any questions regarding this policy to [email protected]. our computational results show that these algorithms are able to effectively solve instances taken 172(3) 814–837. Burke, E. K., G. Kendall, G. Whitwell. 2004. A new placement from the literature, which are still considered to be heuristic for the orthogonal stock-cutting problem. Oper. Res. challenging. The computational time is much shorter 52(4) 655–671. Bak˛ et al.: A Parallel Branch-and-Bound Approach to the Rectangular Guillotine Strip Cutting Problem INFORMS Journal on Computing, Articles in Advance, pp. 1–11, © 2010 INFORMS 11

Burke, E. K., G. Kendall, G. Whitwell. 2009. A simulated annealing IEEE Internat. Conf. Systems, Man Cybernetics, Vol. 2. IEEE, enhancement of the best-fit heuristic for the orthogonal stock- Washington, DC, 1583–1590. cutting problem. INFORMS J. Comput. 21(3) 505–516. Jakobs, S. 1996. On genetic algorithms for the packing of polygons. Cui, Y., Y. Yang, X. Cheng, P. Song. 2008. A recursive branch-and- Eur. J. Oper. Res. 88(1) 165–181. bound algorithm for the rectangular guillotine strip packing Kröger, B. 1995. Guillontineable bin packing: A genetic approach. problem. Comput. Oper. Res. 35(4) 1281–1291. Eur. J. Oper. Res. 84(3) 645–661. Dagli, C. H., P. Poshyanonda. 1997. New approaches to nesting Leung, T. W., C. H. Yung, M. D. Trout. 2001. Applications of genetic rectangular patterns. J. Intelligent Manufacturing 8(3) 177–190. search and simulated annealing to the two-dimensional non- Dyckhoff, H. 1990. A typology of cutting and packing problems. guillotine cutting stock problem. Comput. Indust. Engrg. 40(3) Eur. J. Oper. Res. 44(2) 145–159. 201–214. Faina, L. 1999. An application of simulated annealing to the cutting Leung, J. Y.-T., T. W. Tam, C. S. Wong, G. H. Young, F. Y. L. Chin. stock problem. Eur. J. Oper. Res. 114(3) 542–556. 1990. Packing squares into a square. J. Parallel Distrib. Comput. Gilmore, P. C., R. E. Gomory. 1961. A linear programming approach 10(3) 271–275. to the cutting-stock problem. Oper. Res. 9(6) 849–859. Liu, D., H. Teng. 1999. An improved BL-algorithm for genetic algo- Gilmore, P. C., R. E. Gomory. 1966. The theory and computation of rithm of the orthogonal packing of rectangles. Eur. J. Oper. Res. knapsack functions. Oper. Res. 14(6) 1045–1074. 112(2) 413–419. Hifi, M. 1997. An improvement of Viswanathan and Bagchi’s exact Lodi, A., S. Martello, M. Monaci. 2002. Two-dimensional packing algorithm for constrained two-dimensional cutting stock. Com- problems: A survey. Eur. J. Oper. Res. 141(2) 241–252. put. Oper. Res. 24(8) 727–736. Martello, S., M. Monaci, D. Vigo. 2003. An exact approach to the Hifi, M. 1998. Exact algorithms for the guillotine strip cut- strip-packing problem. INFORMS J. Comput. 15(3) 310–319. ting/packing problem. Comput. Oper. Res. 25(11) 925–940. Smith, D. 1985. Bin packing with adaptive search. Proc. First Inter- Hochbaum, D. S., W. Maass. 1985. Approximation schemes for cov- nat. Conf. Genetic Algorithms, Lawrence Erlbaum Associates, ering and packing problems in image processing and VLSI. Mahwah, NJ, 202–207. J. ACM 32(1) 130–136. Viswanathan, K. V., A. Bagchi. 1993. Best-first search methods for Hopper, E., B. Turton. 1999. A genetic algorithm for a 2D industrial constrained two-dimensional cutting stock problems. Oper. Res. packing problem. Comput. Indust. Engrg. 37(1–2) 375–378. 41(4) 768–776. Hopper, E., B. C. H. Turton. 2000. An empirical investigation of Wang, P. Y. 1983. Two algorithms for constrained two-dimensional meta-heuristic and heuristic algorithms for a 2D packing prob- cutting stock problems. Oper. Res. 31(3) 573–586. lem. Eur. J. Oper. Res. 128(1) 34–57. Wäscher, G., H. Haußner, H. Schumann. 2007. An improved typol- Hopper, E., B. C. H. Turton. 2001. A review of the application of ogy of cutting and packing problems. Eur. J. Oper. Res. 183(3) meta-heuristic algorithms to 2D strip packing problems. Artifi- 1109–1130. cial Intelligence Rev. 16(4) 257–300. Zhang, D., Y. Kang, A. Deng. 2006. A new heuristic recursive algo- Hwang, S.-M., C.-Y. Kao, J.-T. Horng. 1994. On solving rectan- rithm for the strip rectangular packing problem. Comput. Oper. gle bin packing problems using genetic algorithms. Proc. 1994 Res. 33(8) 2209–2217. version, which is made available to institutional subscribers. The file may Articles in Advance INFORMS holds copyright to this Copyright: not be posted on any other website, including the author’s site. Please send any questions regarding this policy to [email protected].