Sei sulla pagina 1di 11

A Variant Beam Search Implementation for the Irregular Shape Bin Packing Problem

Xiang Song Department of Mathematics, Cardi University Senghennydd Road, Cardi, CF24 4AG, UK Julia Bennell School of Management, University of Southampton Higheld, Southampton, United Kingdom, SO17 1BJ February 19, 2010

Abstract The 2D irregular shape bin packing problem we are to solve in this paper involves in assigning a set of strongly heterogeneous irregular shapes to a set of identical large rectangular sheets before the real cutting is initialized and the material wastage needs to be minimized. We implement a beam search algorithm to search over the packing order. Using this approach many parallel partial solutions can be generated and compared using the new constructive heuristic. Computational results for benchmark problems show that the algorithm generates highly competitive solutions in signicantly short time.

Introduction

Cutting Stock problems arise in a large number of industrial applications and as a result, there are varieties of cutting and packing problems addressed and solved in the literature. According to the typology of Wscher, et al.[22], the problem we are to discuss is an irregular shape a (Single Bin-Size Bin Packing Problem) SBSBPP. The key characteristics of this problem are that a set of strongly heterogeneous irregular shapes need to be assigned to a set of identical large rectangular sheets before the real cutting is initialized and the material wastage needs to be minimized. It should be noted that on

songx6@cardi.ac.uk

the last sheet the unused part of the rectangular sheet could be stored and reused in the future, which wont be considered as wastage. The SBSBPP is classied as a class of NP-hard problem [18]. The irregular shape SBSBPP is far more complex due to the complexity of the geometry shapes. Although comprehensive research has been carried out and various approaches have been proposed to solve the 1D SBSBPP and 2D rectangular shape SBSBPP ([7][16][17][20]). The research into the 2D irregular shape SBSBPP is rare. Research into 2D irregular packing has largely focused on two-dimensional irregular open dimension problem (ODP), which aims at packing all the irregular shape input pieces, with the objective of minimising the length of a single xed width stock sheet ([1-4][6][8][10-13][15]). Only two papers have been found to solve the irregular shape SBSBPP in the Cutting and Packing Bibliography on ESICUP website ([9][14][21]). The fact that very few publications have been found solving irregular shape SBSBPP directly arouses our research interest. In this paper we will present implementations of beam search algorithm adapted to the irregular shape SBSBPP. We rst adopt the idea of representing the solution as an ordered list and adapt a constructive heuristic from Oliveira, et al.[15] called TOPOS to form the basis of our approach. Then we expand the number of permutations searched through adopting the beam search mechanism. This approach has been used successfully to solve the irregular shape ODP in J. Bennell and X. Song [7] in contrast to other local search methods. We make a number of adaptations in order to implement this approach to solve the irregular shape SBSBPP. Computational results for benchmark problems show that the algorithm generates highly competitive solutions in signicantly short time. In the next section, we will briey describe the no-t polygon, the TOPOS approach of Oliveira et al. [15] for solving irregular shape ODP and the way that the TOPOS is adapted to solve the irregular shape SBSBPP, each of which are building blocks for our beam search implementation. The following section describes our implementation of the variant beam search approach. The implementation is evaluated on adapted benchmark data instances that detail shape, quantity, number of discrete orientations and stock sheet size of each instance. The experimental results and conclusions are given in the last section.

Supporting concepts

In solving the irregular shape SBSBPP, it is important to tell if the layouts generated on each stock sheets are feasible, that is, if any two irregular shape pieces are packed without overlapping each other. We

describe a strong geometric tool called not polygon to answer this question. We will also describe a simple constructive heuristic method - Oliveira et al. [15] TOPOS approach and how this approach could be adapted to solve irregular shape SBSBPP.

2.1

The Not Polygon

The denition of the NFP is given as follows: The N F PAB of two polygons A and B is the polygon that results from a sliding operation in which A is the xed polygon and B is the tracing polygon. The locus of the reference point on B maps out the NFPAB as B traces around A. Once the N F PAB is obtained, we can tell if polygon A and polygon B overlaps each other by judging the position of reference point on polygon B and the position of N F PAB : if the polygon B is positioned with its reference point inside N F PAB , A and B will overlap; if B is positioned with its reference point on the boundary of N F PAB , A and B will touch without overlap, and if B is positioned with its reference point outside N F PAB , then A and B will neither touch nor overlap. Detailed discussion of the NFP and methodologies for implementing this concept in cutting and packing can be found in Bennell and Song [4], and in Burke et al. [6].

2.2

TOPOS algorithm

The basic idea of TOPOS algorithm [15] is to construct a layout in a fast and greedy way. That is, the layout is build up by placing the irregular piece one by one onto the partial solution (pieces already nested) according to a set of criteria until all the pieces are packed. The key to the success of this algorithm is the proper design of the criteria to pack the pieces and criteria to select which piece is to be packed next. The TOPOS algorithm has the following structure: 1. Select the rst piece (piece A) as the partial solution according to the criteria. criteria = {length, area, convexity, } 2. For all available piece types: Candidate piece type (piece B). Find N F PAB Evaluate all admissible positions on N F PAB , select best position. criteria = {min rectangular enclosure, min length, max overlap} 3. Evaluate selected piece-position combinations, select best piece B criteria = {waste (R), overlap, distance (R)} 4. Merge current A with selected B in best position = piece A 5. If all pieces placed STOP, else return to 2.

It needs to point out that with TOPOS algorithm, it is possible to lose some gaps by Step 4 of this algorithm. That is after merging, the gaps between polygons may be lost. Considering all combinations of criteria for piece selection and position selection a total of 126 variants of the algorithm are computationally tested across a number of alternative data sets. No one set of criteria, consistently gave the best results.

2.3

Revised TOPOS algorithm

to break the ties we choose the one with maximum O2 = overlap and xy further we choose the position with minimum L1 = Lnew . The correx lated notations are explained in Figure 1. We use PR(R1, O2, L1) to represent this placement rule in the following sections in this paper. Also in the revised TOPOS, we choose the best piece to pack next according to PR(R1, O2, L1). Thus the structure of revised TOPOS algorithm is as follows: 1. Select the rst piece (piece A) as the partial solution according to the criteria. criteria = {length, area, convexity, } 2. For all available piece types: Candidate piece type (piece B). Find N F PAB . Evaluate all admissible positions on N F PAB , select best position. criteria = PR(R1, O2, L1) 3. If no admissible positions on N F PAB could be found for piece B, mark the best position as NULL.

The TOPOS algorithm works well in solving the irregular shape ODP. However, to solve the irregular shape SBSBPP, some modications need to be made. That is, instead of packing the irregular pieces endlessly onto the partial solution until all the pieces are packed, in the SBSBPP, the position of the next piece to be packed needs to start from a new stock sheet if no admissible position could be found on the current stock sheet due to the physical constraint of the stock sheet (The length of the stock sheet is xed instead of endless in ODP). Besides Bennell and Song [5] pointed out some drawbacks of TOPOS and improved it by lling the gaps between the polygons with the possible small pieces and generating new NFP by merging the NFPs of the original polygons. They also designed alternative evaluation criteria that, according to their experiments, provide better solution quality than the suggested criteria in the original TOPOS implementation. We adopt their idea by choosing a priority strategy as the placement rule instead of the rules provided in TOPOS. That is, the position which returns minimum R1 = Lnew Wnew will be considered and xy

4. If all the best position of all available piece types are marked NULL, mark the current stock sheet as CLOSE, go to step 1,

(a)
Next piece x Partial layout y

(b)

(c) Overlap area

Wold

Wnew

Lold

Lnew

Figure 1: Illustration of variables used to formulate criteria for construction heuristic [5]

else, evaluate selected piece-position combinations, select best piece B. criteria = PR(R1, O2, L1) 5. Merge current A with selected B in best position = piece A 6. If all pieces placed STOP, else return to 2. The revised TOPOS algorithm is still a heuristic constructive algorithm. To expand the number of permutations searched and get high quality solutions, some local search strategy needs to be implemented. In this paper, we adopt the beam search mechanism.

3 Variant Beam Search for Solving SBSBPP


We design the beam search algorithm to solve the irregular shape SBSBPP. The basic idea of this algorithm is that given the placement rule PR(R1, O2, L1) given in Section 2.3, our main work becomes to search an ecient packing order so that the corresponding layouts in the bins generates the maximum material usage ratio.

3.1

Background of the Beam Search

Beam search can be presented with a tree search structure, where the nodes are expanded at each level and are aggressively pruned according to an evaluation function. Only the number of the beam width of nodes are kept as candidates. Since the user controls the beam width and no backtracking is allowed, the running time of the algorithm can be controlled and is polynomial in the size of the problem [19]. However,

the exertion of the evaluation function, which is usually called global evaluation, for each node could be very time consuming. Some preevaluate function needs to be designed so that the nodes could be pre-evaluated with a much lower cost. The exertion of the pre-evaluate function is called local evaluation. The number of nodes kept for global evaluation after the local evaluation is called lter width. Typically, beam search implementations use a combination of local and global evaluations.

3.2

Implementation of Beam Search Tree

In the search tree we are describing, each node represents a partial solution and each branch represents the strategy which piece is going to be packed next onto the partial solution. Hence the trees depth is determined by the number of pieces to be packed, and the number of child nodes branching from each beam is the number of piece types, possibly with multiple orientations, remaining to be allocated. As a result, the nodes at the lowest level of the tree represent complete solutions. The tree search starts from R root nodes, where R = min{beam width (), no. of piece type}. Suppose each node has child nodes, where = no. of orientations no. of piece type originally, which could be reduced when a type of piece has been packed up completely and = 0 at the lowest level of the tree. Thus after expanding the R root nodes, we have in total R nodes. The child node for each root node will be evaluated with local evaluation function rst and only lter width () number of nodes are kept for further evaluation all the other child node are pruned without backtracking. After local evaluation, only R nodes are kept for global evaluation and only nodes will be chosen nally for next branching (suppose < R , otherwise all R nodes will be kept for further branching until is smaller than the number of nodes kept for global evaluation.). This procedure carries on until we reach the lowest level of the search tree. As analyzed in the last paragraph, the nodes at the lowest level of the tree represent complete solutions. We are to compare the material usage ratio of the solutions and choose the best one as our nal solution.

3.3

A Variant Beam Search Algorithm

In our beam search implementation, the revised TOPOS is used to evaluate the nodes locally and globally. The local evaluation function evaluates the addition of the next piece to the partial solution using the revised TOPOS criteria PR(R1, O2, L1). Note that in solving irregular shape SBSBPP, not all possible pieces to be packed to the

partial solution can nd the admissible position on the partial solution due to the physical constraint of the rectangular stock sheet. The pieces that cant be packed onto the partial solution are called break pieces. The positions of such pieces will be dened on a new stock sheet and the value R1, O2 and L1 need to be dened as R1 = , O2 = and L1 = which means that the corresponding nodes of such pieces wont have the priority to be chosen before those that can be packed onto the partial solution. In addition, the break pieces are sorted according to an area descending order and the pieces with larger area will be chosen as ltered nodes when necessary. The global evaluation function will continue to pack all remaining pieces after the child node with the strategy that the packing order of the remaining pieces is selected according to revised TOPOS criteria following the revised TOPOS algorithm. And nodes which returns the maximum material usage ratio of the complete solution will be chosen for further branching. In order to determine the root nodes all piece types are sorted in order of descending area and the rst min{beam width (), no. of piece type } are selected as described in section 2.2. Initial results showed that no single initial sort criteria gave better results so the convention of sorting by area was adopted. Our beam search implementation can be summarised by the following procedure. Let T be the total number of pieces and m the total number of piece types including alternative orientations. Let P St,b be a partial solution containing t nested pieces for the b-th path, and let St,b and mt,b be the set of remaining pieces and piece types respectively to be nested at stage t on the b-th path, corresponding to a given P St,b . Let GLOBAL(P St+1,b , t + 1, T ) be the global evaluation function that returns the material usage ratio of the solution obtained using revised TOPOS described in Section 3.4, where the piece order of the rst t + 1 pieces in the partial solution P St+1,b have been determined by the search tree and only the following (T t 1) unpacked pieces need to be ordered using TOPOS. Step 1: Set t = 1. Select R = minbeam width (), no. of piece type (m)} pieces as root nodes. If m < then use all m piece types as root nodes. Otherwise, sort piece type according to their area in descending order and choose the rst piece as root nodes. Initialize R partial solutions P S1,j , S1,j and m1,j correspondingly, where t = 1, j = 1, 2, , R. Step 2: If R < , then for all P St,j , j = 1, 2, , R, move to next level by adding each piece type i (for all i mt,j ) to the corresponding R P St,j . Set R = j=1 mt,j and reduce the corresponding set St,j and mt,j . Set t = t + 1 and go to step 2. Otherwise, go to Step 3. Step 3: Select initial beam nodes. Compute the global evaluation function values for all the nodes with GLOBAL(P St+1,j , t + 1, T ) and

select the best nodes as initial beam nodes, j = 1, 2, , R. Step 4: Local evaluation of all available next piece types with revised TOPOS criteria PR(R1, O1, L1). If for a piece type, the parameters are dened as R1 = , L1 = , O1 = , select the piece according to the piece area. Select pieces (nodes) for each beam. Step 5: Global evaluation of ltered nodes. Compute GLOBAL(P St+1,j , t+1, T ) for selected nodes, where j = 1, 2, .., . Select nodes across all beams according to the best material usage ratio of the complete solutions. Step 6: Update sets. For each selected beam node, form P St+1,j (j = 1, 2, , ) by adding the beam node (piece j) to P St,j . Remove piece j from St,j , update mt,j , t = t + 1. Step 7: If t = T STOP, else return to step 4. Step 8: Final solution. Among the solutions, select the one with maximum material usage ratio.

Computational Experiments

In this section, we report the computational results for the Beam Search algorithm using the criteria dened in section 2.4. The procedures were coded in Visual Studio C++ and the instances were run on a Laptop with 512 MB, 1.6 GHz. The four data sets we used could be found on the European Working Group in Cutting and Packing (ESICUP) website, where the length and width of the bins are dened by the width of the stock sheet of corresponding irregular shape ODP. The denitions could be found in Table 1, where B Width and B Length represent the newly dened length and width of the stock sheet of the BSBPP and S Width represents the width of the stock sheet of corresponding irregular shape ODP. The reason that for the case Trousers, the B Width = S Width is dened instead of B Width = S Width/2 is that the width of the case Trousers is quite narrow. For each data set the lter width can not be greater than the number of piece types (including all orientations). Given that the lter width inuences the number of global evaluations for each beam at each level, a large lter width can be costly. However, it must be large enough to provide scope to nd good solution arising from less greedy partial solutions. Our experimentation demonstrated that solution quality does not continue to improve up to the maximum possible lter width. The following rule of thumb was devised: lter width = min{no. of orientations 5, no. of piece types}. Beam widths = {1,10, 100, 400} were tested across 4 revised benchmark data sets mentioned above. Since irregular shape ODP has no physical constraints on the length of the stock sheet, it is supposed to generate the better material

Figure 2: Table 1 The new denition of the width and length of the stock sheets of the SBSBPP

Figure 3: Table 2 Computational result with the Beam Search algorithm

usage ratios than those of SBSBPP for packing up the same set of the input pieces. Thus we take the literature best material usage ratios of the benchmark ODP as the upper bound and make a comparison with those of the corresponding SBSBPP results. The comparison result is given in Table 2. In Table 2, column Data gives the name of the benchmark problems from the ESICUP website. The column lter width and beam width give the lter width and beam width used to get the corresponding solutions. The column Piece Types and the Total Pieces gives the number of piece types and total number of pieces packed. The column Usage Ratio (%) and Time (s) give the material usage ratio and computer running time for each benchmark problem. In addition, to make the comparison, the literature best usage ratio of the ODP of the corresponding benchmark problem is given in column Best Usage Ratio of ODP (%). From Table 2, we could see that the usage ratio of the material is quite close to those of upper bounds. Some physical gures could be found at the end of the paper.

Conclusion

The paper describes a beam search implementation for the irregular shape SBSBPP. It argues that when representing the problem by a packing order list, which is then decoded using a constructive heuristic, it is essential to ensure the constructive heuristic can eectively generate good quality solutions and does not remove global or locally optimal solutions from the solutions space. The TOPOS constructive heuristic of Oliveira, Gomes and Ferreira (2000) is proposed and modied to solve SBSBPP and a new criterion is developed. Our experiments show that beam search is an eective search mechanism for the irregular shape SBSBPP. dfdfdafs dfasdfadaf Bibliography
[1] Babu, A.R., Babu, N.R. 2001. A generic approach for nesting of 2-D parts in 2-D sheets using genetic and heuristic algorithms. ComupterAided Design. 33 : 879-891 [2] Bennell, J.A., Dowsland, K.A. 1999. A tabu thresholding implementation for the irregular stock cutting problem. International Journal of Production Research. 37 4259-4275 DEC 15 [3] Bennell, J.A., Dowsland, K.A. 2001. Hybridising tabu search with optimisation techniques for irregular stock cutting. Management Science. 47 1160-1172 [4] Bennell, J.A., Song, X. 2008. A comprehensive and robust procedure for obtaining the not polygon using Minkowski sums. Computers and Operations Research 35, Issue 1, pp 267-281. [5] Bennell, J. and Song, X.. 2008. A Beam Search Implementation for Nesting Problems, Journal of Heuristics, online. [6] Burke, E., Hellier, R., Kendall, G., Whitewell, G. 2006. A new bottomleft-ll heuristic algorithm for the two-dimensional irregular packing problem. Operations Research. 54 587-601. [7] Dowsland, K.A. and Dowsland, W.B. Packing Problems. European Journal of Operational Research, 56:2-14, 1992. [8] Egeblad, J., Nielsen, B.K., Odgaard, A. 2006. Fast neighbourhood search for two- and three-dimensional nesting problems. European Journal of Operational Research. Article in press. [9] ESICUP. European Working Group on Cutting and Packing. http://www.fe.up.pt/esicup. [10] Gomes, A.M., Oliveira, J.F. 2002. A 2-exchange heuristic for nesting problems. European Journal of Operational Research. 141 359-370 [11] Gomes, A.M., Oliveira, J.F. 2006. Solving Irregular Strip Packing problems by hybridising simulated annealing and linear programming. European Journal of Operational Research. 171 811-829.

10

[12] Heckman, R., Lengauer, T. 1995. A simulated annealing approach to the nesting problem in the textile manufacturing-industry. Annals of Operations Research. 57 103-133. [13] Jakobs, S. 1996. On genetic algorithms for packing polygons. European Journal of Operational Research. 88 165-181. [14] Okano, H., 2002, A scanline-based algorithm for the 2D free-form bin packing problem, Journal of the Operations Research Society of Japan, 45, pp 145-161. [15] Oliveira, J.F., Gomes, A.M., Ferreira, J.S. 2000. TOPOS - A new constructive algorithm for nesting problems. OR Spektrum. 22 263284. [16] Hopper, E. and Turton, B.C.H.. A Review of the Application of MetaHeuristic Algorithms to 2D Strip Packing Problems. Articial Intelligence Review, 16: 257-300, 2001. [17] Lodi, A, Martello, S. and Vigo, D. Two-Dimensional Packing Problems: A Survey. European Journal of Operational Research, 141: 241252, 2002. [18] Garey, M.R. and Johnson, D.S.. Computer and Intractability: A Guide to the Theory of NP-Completeness. W.H. Freeman, San Francisco, 1979. [19] Sabuncuoglu, I., Bayiz, M., 1999, Job shop scheduling with beam search. European Journal of Operational Research. 118 390-412. [20] Vanderbeck, F., Computational Study of a Column Generation Algorithm for Bin Packing and Cutting Stock Problems. Mathematical Programming, 86(3): 565-594, Dec. 1999. [21] Verkhoturov, M. A., 1997, Combinatorial methods and algorithms for irregular cutting stock problem, Decision Making Under Conditions Of Uncertainty (Cutting-Packing Problems), pp 270-283. [22] Wscher, G., Hauner, H. and Schumann, H., An improved typology a of cutting and packing problems, European Journal of Operational Research, 2006, available online.

11

Potrebbero piacerti anche