using a tabu search approach for solving the two-dimensional irregular cutting problem

13
Annals of Operations Research 41(1993)313-325 313 Using a tabu search approach for solving the two-dimensional irregular cutting problem J. Bi'a~ewicz, P. Hawryluk and R. Walkowiak Technical University of Poznati, Institute of Computing Science, 60-965 Poznah, Poland Abstract In this paper, a new approach to cutting a rectangular sheet of material into pieces of arbitrary shapes is presented. The proposed method consists of two stages. After the generation of an initial solution, a tabu search is applied for f'mding a f'mal cutting pattern. The presentation of the main ideas of the method is followed by a description of an implementation and some experimental results. 1. Introduction The two-dimensional cutting problem consists of cutting a set of pieces from a sheet of material in order to minimize waste. The problem arises in various production processes in glass, steel, wood, paper and textile industries. Thus, the problem is interesting not only from the theoretical but also from the practical point of view. Following the computational complexity analysis of the problem, we see that the two-dimensional cutting problem is strongly NP-hard, thus unlikely to admit even a pseudopolynomial algorithm. For this reason, the problem in question must be solved by approximation algorithms. Such an algorithm is proposed in this paper. The method involves a tabu search strategy applicable for solving combinatorial optimization problems. The organization of the paper is as follows. Section 3 contains basic definitions. In section 3, a description of a method for solving the problem in question is presented. Section 4 deals with an implementation of the proposed method. Then the obtained results are presented and compared with the results of other existing methods. 2. Problem formulation A two-dimensional irregular cutting problem can be formulated as follows: Given: a rectangular material (area) and a set of two-dimensionalelements of arbitrary shapes; the shapes are described by the line-segment approximation and the material has a limited width; each element is characterized by its area. J.C. Baltzer AG, Science Publishers

Upload: j-blazewicz

Post on 14-Aug-2016

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Using a tabu search approach for solving the two-dimensional irregular cutting problem

Annals of Operations Research 41(1993)313-325 313

Using a tabu search approach for solving the two-dimensional irregular cutting problem

J. Bi'a~ewicz, P. Hawryluk and R. Walkowiak Technical University of Poznati, Institute of Computing Science, 60-965 Poznah, Poland

Abstract

In this paper, a new approach to cutting a rectangular sheet of material into pieces of arbitrary shapes is presented. The proposed method consists of two stages. After the generation of an initial solution, a tabu search is applied for f'mding a f'mal cutting pattern. The presentation of the main ideas of the method is followed by a description of an implementation and some experimental results.

1. Introduction

The two-dimensional cutting problem consists of cutting a set of pieces from a sheet of material in order to minimize waste. The problem arises in various production processes in glass, steel, wood, paper and textile industries. Thus, the problem is interesting not only from the theoretical but also from the practical point of view. Following the computational complexity analysis of the problem, we see that the two-dimensional cutting problem is strongly NP-hard, thus unlikely to admit even a pseudopolynomial algorithm. For this reason, the problem in question must be solved by approximation algorithms. Such an algorithm is proposed in this paper. The method involves a tabu search strategy applicable for solving combinatorial optimization problems.

The organization of the paper is as follows. Section 3 contains basic definitions. In section 3, a description of a method for solving the problem in question is presented. Section 4 deals with an implementation of the proposed method. Then the obtained results are presented and compared with the results of other existing methods.

2. Problem formulation

A two-dimensional irregular cutting problem can be formulated as follows:

Given: a rectangular material (area) and a set of two-dimensional elements of arbitrary shapes; the shapes are described by the line-segment approximation and the material has a limited width; each element is characterized by its area.

J.C. Baltzer AG, Science Publishers

Page 2: Using a tabu search approach for solving the two-dimensional irregular cutting problem

314 J. Bt'a~ewicz et al., Solving the irregular cutting problem

Minimize the length of the material used to allocate the elements (the elements should be placed without overlapping).

The above problem is NP-hard in the strong sense. This is because the simplest problem, i.e. the one-dimensional cutting problem, is already NP-hard. A complete discussion of the complexity of the problem in question is given in [3]. Strong NP- hardness of the two-dimensional irregular problem implies the lack of a polynomial optimization algorithm. Worse still, as far as we know there are neither algorithms with known worst-case behavior bounds nor algorithms that compute an optimal solution in any way. Methods that solve the problem are mainly heuristics using different approaches. Approximation algorithms [1,2,7], though polynomial, require a considerable amount of time and sometimes construct solutions of poor quality. Thus, the design of new methods that construct more satisfactory solutions is desirable.

As already mentioned, the problem is difficult and its complexity increases very rapidly with the number of elements and the number of vertices in the elements' description. Both generation of a feasible solution of the problem and each change in this solution are time consuming. Therefore, minimizing the number of such steps in an optimization procedure is very important.

The above reasoning leads to the proposed method. The first stage of the method is a simple algorithm allocating elements in two ways. It tries to allocate a chosen element in unused areas among the earlier allocated elements or (if this is impossible) in the area to the right of the allocated elements. After the construction of the first feasible solution, a tabu search method that improves the quality of the first solution is used. The method is implemented in such a way that a single element is chosen and its position is changed at each step of the algorithm. The cost of changing the position of one element is less than the cost of generating a new allocation, and therefore the operation can be repeated. At each stage, the best possible change of the allocation, according to the OPTIMUM function, is made.

The choice of the tabu procedure was influenced by the relatively small overhead involved and by the small number of steps required to obtain an improvement of the solution. Moreover, the use of a tabu list forbade certain obvious poor steps. The last feature was especially important because of the high (time) cost of any change in the allocation of elements.

3. Description of the method

3.1. GENERATION OF THE FIRST SOLUTION

Let us give some definitions that allow us to present the algorithm in a more compact way (cf. fig. 1).

DEFINITIONS

A hole is a connected area of unused material (allocation area) among the allocated elements.

Page 3: Using a tabu search approach for solving the two-dimensional irregular cutting problem

J. Bt'a~ewicz et al., Solving the irregular cutting problem 315

Fig. 1. Example of layout.

An external hole is the hole to the right of the rightmost placed element (see fig. 1; an extemal hole: f ) .

An internal hole is each hole that is not an external hole (see fig. 1; internal holes: a, b, c, d, e).

A neighborhood. Two neighboring elements have at least one common point. The neighboring element and the hole have at least one common edge (see fig. 1; neighbors are: element_l and hole_a, element_3 and element_4).

An external element is the element that is a neighbor of an external hole (see fig. 1; element_4).

An internal element is each element that is not an external one (see fig. 1; elements 1, 2, 3).

A waste for an element is an unused area in the neighborhood - the sum of the areas of neighboring holes (in fig. 1, the waste for element_l is equal to the sum of areas hole_a and hole_b).

An algorithm generating a primary solution can now be presented as follows:

begin Place the allocation area (material) on the list of holes (list D). Place the elements on the list of elements to allocation (list E). Sort list E according to non-increasing areas of the elements. while list E is not empty do

begin Sort list D according to increasing areas of the holes. i : = 1 Allocated :=false while not Allocated do

if it is possible to allocate the first elements of list E in the ith hole of list D then

Page 4: Using a tabu search approach for solving the two-dimensional irregular cutting problem

316 J. Bl'a~ewicz et al., Solving the irregular cutting problem

end

begin allocate element Allocated := true update list D by taking out the ith hole and adding new holes just created

end else i := i + 1

update list E by taking out the first element end

Of course, the implementation of this algorithm required many problems of geometrical and data-base nature to be solved. They will be described in more detail in section 4.1.

In the above algorithm, it is assumed that there always exists at least one hole in the list of holes which can contain elements not being placed. This is true whenever an extemal hole of satisfactory area exists. The elements are placed in order of non-increasing areas. This is advantageous from two points of view:

• a fixed order of an allocation decreases the complexity of the algorithm;

• small elements placed later can be allocated in holes created by allocating large elements - t h u s , the waste is minimized.

The algorithm is not very complex from the time complexity point of view and seems to be able to produce solutions of an average quality.

3.2. TABU SEARCH IMPROVEMENT

The tabu search method [6, 8] is used to improve the quality of solutions obtained by the use of the heuristic algorithm described in the previous subsection. We will now give the basic elements of the tabu method used for solving the two- dimensional irregular cutting problem. (A preliminary knowledge of the tabu method is assumed.)

3.2.1. A move

The first and most important problem in designing the tabu search method for solving any combinatorial problem is to define a move. A transition from one admissible solution to another is hidden under this concept. The move s is defined here in the foUowing way: it is a change of the allocation of one element from one place to another obeying the restriction on the non-overlapping of the allocated elements. The element is taken from its allocation place to another unused part of the allocation material, i.e. to one of the holes existing in the current solution.

Page 5: Using a tabu search approach for solving the two-dimensional irregular cutting problem

J. Bl'a~ewicz et al., Solving the irregular cutting problem 317

3.2.2. Tabu list

Tabu list T contains all moves not allowed for a current move in a current iteration. It can be defined as follows:

T={s - l : s=sh for h > k - t } ,

where k is an iteration index, s -1 is the inverse of move s, and sh is a move in iteration h.

In our case, a tabu list forbids changes of allocation of those elements which have changed their allocation in the last t iterations of the tabu search process.

3.2.3. The optimum function

The optimum function is responsible for finding the best admissible move. The best move is one which allows one to place external elements in some of the internal holes. When there are more such elements, they are chosen according to the best-fit criterion (the ratio of areas of an element and a hole is taken into account). In this way, all moves which decrease the area of used material by taking out the rightmost elements are preferred. When no move of such a type is possible, internal elements are candidates for change. They are taken in decreasing order of their wastes and placed in holes chosen according to the best-fit rule.

3.2.4. The scheme of the algorithm

An iteration of the algorithm may be presented in the following way:

begin try to place an external element e: e ~ T, in an internal hole take an element and a hole whose ratio of areas is the largest if a pair "element-hole" is found

then begin

make the move update T exit {end of iteration}

end else

begin take an internal element e: e ~ T whose waste is the greatest take out the chosen element from the solution update list of holes D sort list D according to non-increasing areas i : = 1 placed : = false

Page 6: Using a tabu search approach for solving the two-dimensional irregular cutting problem

318 J. Bt'a~ewicz et al., Solving the irregular cutting problem

while not placed do if the chosen element can be placed in the ith hole

then begin

make the move update T placed := true

end else i := i + 1

end end of iteration

The algorithm described above gives a basis for the practical implementation of the tabu search method for the two-dimensional irregular cutting problem, which will be presented in more detail in the next section.

In general, the scheme of a tabu search procedure may consist of additional elements such as aspiration levels, intermediate and long-term memory functions.

In using aspiration levels, one needs to know the quality of each move before it is made. In our case, there are two levels of quality: the global one measured by the length of material used in allocation, and the quality of a move. Moves of good quality (chosen according to the rules based on the observation of the allocation process) are likely to improve a solution in the next steps. They are accepted without any knowledge about the improvement they will really introduce. Looking for a move wNch most improves the quality of a solution would introduce a great number of additional computations, with no certainty that it is the best move towards a global optimal solution.

Similar problems arise in the case of intermediate and long-term functions. It is not easy to obtain "a type" for good solution features which allows for intensification of a search in a selected region. We deal with geometric entities, and good solutions require good matching of their shapes. In checking this feature, there arises the new problem of packing (considered in [9]), which requires a great deal of additional computation. Because of this, we decided to suspend realization of this idea.

In order to achieve global diversification of the search, more start solutions should be generated. This requires various policies of allocation in the first phase of the process. The problem is to find simple algorithms which wiU provide different initial solutions. It would make a final solution independent of a start solution. Such a modification of the method seems to be worthy of realization and possibly will be introduced in the next version of the tabu search method application.

4. Practical implementation

4.1. BASIC ELEMENTS OF AN IMPLEMENTATION

In this subsection, some practical aspects of the proposed method will be presented. There are some problems whose solution is required for a full implementation

Page 7: Using a tabu search approach for solving the two-dimensional irregular cutting problem

J. Bl'a~ewicz et at., Solving the irregular cutting problem 319

of the algorithm. In a definition of the tabu list, there exists a constant t, the length of the tabu list. Its value must be chosen in an experimental way for the problem in question. This constant is very important for the method and its value is limited by two facts. A proper size of the tabu list should prevent cycling of move sequences as well as an excessive restriction on moves. In our case, an extensive experiment, based on testing and evaluation of a search process for many different data and applying them for various lengths of tabu list, was made. It has been shown that the optimal length of the tabu list should be equal to 3 for all data sets consisting of more than 6 elements. Because of the geometrical features of the problem, the tabu list is not the only restriction on the move. Also, an element which is the only neighbor of a group of elements not being in contact with the border of an allocation area cannot be removed from a current solution. This protects it from generating holes with elements inside.

The main problem of the implementation of the proposed algorithm consists of designing a method for checking the feasibility of placing an element in a given hole. This part of the algorithm is repeated many times, and its complexity has a great influence on the time complexity of the whole method. Elements and holes have unrestricted shapes and, in particular, can be concave. In order to find a possible allocation place of an element within a chosen hole, the following steps should be executed.

Firstly, the extreme points of a hole are computed. These are the partition points (see fig. 2). They designate two parts of a hole border. Perpendicularly to a line joining these points, two additional lines are introduced (see fig. 3). Sections of those lines together with the parts of hole borders create boundary.A and boundary_B.

As a reference point of an element, an upper left vertex is chosen. In the next stages, traces of a reference point while an element is moved along

the boundary.A and then along the boundary_B are recorded. An envelope.A and an envelopeAL as shown in fig. 3, are created. The common part of the envelopes is an area of a feasible allocation of the reference point. Finally, the place of allocation is defined by a point with the minimum y coordinate among those points which have the minimum x coordinate in the feasible allocation area. This is because elements are allocated from the left to the right and from the bottom to the top of the area.

The procedure that checks the feasibility of allocation is an approximate one in the sense that it cannot detect some advantageous allocation places. Only some (defined by the user) orientations of an element are checked in order to find a feasible allocation area. Also, the procedure itself will not find all proper placements for an element. While the envelopes are defined, the element cannot go behind a bottleneck in a partial border to a possible separate allocation area.

The basic procedure for checking feasibility of an allocation is common for both parts of the method - generation of a primary solution and tabu search method.

The algorithm proposed in section 3 was implemented in PASCAL on a PC AT computer. The program is written in a modular form and its second part (implementation of the tabu method) can be used for improving the quality of solutions obtained by

Page 8: Using a tabu search approach for solving the two-dimensional irregular cutting problem

320 J. Bl'a~ewicz et al., Solving the irregular cutting problem

hole element

reference point

parfi fion points Fig. 2. Characteristic points of a hole and an element.

/ ' \ \ / " \ \ " ~ fe~sible allocafion area

\ J \1 \ \ / " bo~nao,u 8

envelope B ~ \ \ "... " envelope

\ boundQrtj A \ "'. ..'"" /

\ / \ . /

Fig. 3. Def'ming a feasible allocation area.

A

the use of another (not described in this paper) method. It is possible to check the process of allocation on a computer screen at every stage. Running of the program can be suspended at any point and the best solution stored on disk.

4.2. EXPERIMENTAL RESULTS

This subsection is devoted to the presentation of the results of some tests made on an IBM-AT compatible computer. Table 1 contains a comparison with the results

Page 9: Using a tabu search approach for solving the two-dimensional irregular cutting problem

J. Bl'a~ewicz et al., Solving the irregular cutting problem 321

Table 1

A comparison of the results obtained by different allocation methods.

Results for Results for Albano- Results for Test file Element Ourel's method Sapuppo's method tabu method

name description Waste (%) Time (see) Waste (%) Time (see) Waste (%) Time (see)

TESTI 8 convex hexagons 36.0 16 29.5 14 20.0 14 TEST2 10 circles 36.3 86 35.7 101 29.3 29

TEST3 10 triangles 46.3 13 37.6 137 37.9 18

TEST4 10 concave elements 25.8 76 18.6 72 12.8 57 (3 arcs, line)

TEST5 12 various dements 35.3 69 28.2 112 27.1 39

TEST6 10 concave elements 58.6 26 57.0 50 57.0 33 (6 vertices, 2 arcs, 4 lines)

TEST'/ 13 various elements 37.7 70 35.4 134 38.4 70

TEST8 12 various elements 33.7 32 38.9 123 33.3 67

TEST9 20 various elements 38.9 170 36.8 468 31.4 107

TESTIO 28 various dements 36.1 218 38.7 830 30.9 150

TESTII 10 convex polygons 32.1 7 37.1 25 26.7 29

TEST15 30 triangles 37.5 158 6.3 160 6.2 62

TES]'24 4 dements, no arcs, 0.7 3 0.7 3 0.7 20 norm~ angles

TEST25 twice dements 3.1 25 11.7 12 0 62 from TEST24

TEST26 4 times elements 3.1 164 6.5 45 0 75 from TEST24

TEST30 TEST25 other 25.5 15 14.7 13 0 13 sheet width

TEST31 twice TEST30 10.5 81 8.2 53 0 28 elements

TEST35 TEST25 other 24.5 10 20.3 14 4 56 sheet width

TEST36 TEST26 other 13.1 70 15.0 57 4 29 sheet width

of two other methods. A Decision Support System using Gurel's and Albano-Sapuppo's methods was described in [4]. Examples were taken from industrial applications.

The value of the waste is calculated by a subtraction from a used area (height multiplied by length of material used), the sum of areas of all allocated elements. Some particular examples of allocation using the three methods mentioned above are shown in figs. 4 and 5.

Page 10: Using a tabu search approach for solving the two-dimensional irregular cutting problem

322 J. Bl'a~ewicz et al., Solving the irregular cutting problem

22

83

Length: 31.470

L' Wictth: 15.000

(a) WQs~e: 36.1%

Length: 32.844 Width: 15.000 Waste: 38.7% (b)

z4 27

Lencj~h: ~cj. 091 W~cI'~h : ;.5. 000 Waste: 30.9%

(c)

Fig. 4. (a) TEST10: Gurel's method; (b) TEST10: Albano-Sapuppo's method; (c) TEST10: tabu method.

Page 11: Using a tabu search approach for solving the two-dimensional irregular cutting problem

J. Bl'a~,wicz et al., Solving the irregular cutting problem 323

I.engt-h: 28.750 Width: 15.000 Wa~l'e: 38.9% (,,)

1.eng"H'l: 27. 791 Wid'l'h: 15.000 Wa~e: 36.8~

(b)

3 lg 1 t ) 14

Leng'~h: 25. 601 Width: 15.000 (c)

.... 18 l

WO.5"l'e: 31.4 %

Fig. 5. (a) TEST9: Gurd 's method; (b) TEST9: Albano-Sapuppo's me~od; (c) TEST9: tabu method.

Page 12: Using a tabu search approach for solving the two-dimensional irregular cutting problem

324 J. Bl'a~ewicz et al., Solving the irregular cutting problem

Analyzing table 1, one can state that the average waste for the examples tested is the smallest for the tabu method. The average time used for generation of solutions is also the smallest for this method. An interesting feature of the tabu method implemented for the two-dimensional irregular cutting problem, in comparison with other methods, is its possibility for control of the solution quality and computation time. Extending computations beyond the imposed limits, one will probably obtain a better solution --closer to the optimum. It is also possible to break computation at any stage if the solution is good enough. The remaining methods give only one solution for one data set.

In the implementation, the stop condition was based on the restriction of the number of iterations made without an improvement of solution quality. Hence, the total time of computation varies for different data. Total time statistics for the tabu method used for different data would not give a proper evaluation of the approach.

An interesting evaluation parameter is the value of improvement made during the search phase. The final solutions were on average 6% better than the start solutions. The last improvement was made in 90% of cases in the first half of the computation time.

The tests also showed some disadvantages of the proposed version of the tabu method. Sometimes, a tabu list did not allow for rebuilding a solution and for obtaining (visible to operator) better cutting patterns.

5. Conclusions

In this paper, an implementation of the tabu search method for the two- dimensional irregular cutting problem was described. The relatively simple version of the method was the result of the complexity of the problem and the aim was to construct solutions in a short time. We eliminated the possibility of more complicated moves, allowing only for changing an allocation of one element at a time. The function of aspiration levels, as presented in [6], has also been reduced for the same reasons.

A challenging issue in this area seems to be the implementation of more complicated "moves", allowing for a replacement of several elements at a time and starting the tabu search stage from more than one initial solution.

References

[1] A. Albano and G. Sapuppo, Optimal allocation of two-dimensional shapes using heuristic search methods, IEEE Trans. Systems, Man and Cybernetics SMC-10(1980).

[2] R.C. Art, Jr., An approach to the two-dimensional irregular cutting stock problem, IBM Report 320-2006, Cambridge (1966).

[3] L B ~ w i c z , M. Drozdowski, B. Soniewicki and R. Walkowiak, Two-dimensional cutting problem: Basic complexity results and algorithms for irregular shapes, Found. Contr. Eng. 14(1989).

Page 13: Using a tabu search approach for solving the two-dimensional irregular cutting problem

J. Bt'a~wicz et al., Solving the irregular cutting problem 325

[4] J. B~.ewicz, M. Drozdowski, B. Soniewicki and R. Walkowiak, Decision Support System for culfing irregular shapes -implementation and experimental comparison, Found. Comp. Dec. Sci. 15(1990).

[5] M.R. Garey and DH. Johnson, "Strong" NP-completeness results, motivation, examples and implications, J. ACM 25(1978).

[6] F. Glover, Tabu search, Part I, ORSA J. Comput. 1(1989)190-206. [7] O. Gurel, Circular graph of marker layout, IBM Data Processing Division, New York Scientific

Center, Report No. 320-2965 (1969). [8] A. Hertz and D, de Werra, The tabu search metaheuristic: How we used it, Ann, Math. Art. Int.

1(1990) 111-121.

[9] J. Nelissen, Die Optimierung zweidimensionaler Zuschnittprobleme, Schriften zur Informatik und Angewandten Mathematik Rheinisch-Westf~ische-Technische Hochschule Aachen, No. 150 (1991).