Genetic Algorithms for the Single-Sheet and Multi ... - Semantic Scholar

2 downloads 0 Views 145KB Size Report
Jan 24, 1997 - This paper deals with the application of a Genetic Algorithm to the ... When a part type k is included in the part list ( i.e. the bill of materials ), it is ...
Genetic Algorithms for the Single-Sheet and Multi-Sheet Non-convex Cutting Stock Problem Rohit Sharma, Thiagarajan Balachander, Graduate Student, Dept. of Electrical Engineering Christopher McCord, Ph. D., Associate Professor of Mathematics Sam Anand , Ph.D., Associate Professor of Industrial Eng. Qian Zhang.,

Graduate Student, Mechanical Engineering Program

Graduate Student, Dept. of Computer Science January 24, 1997 Computer Aided Manufacturing Laboratory, Industrial Engineering Program University of Cincinnati PO Box 210116 Cincinnati, OH-45221-0116

Abstract

The two-dimensional cutting stock problem is the problem of cutting two-dimensional parts from a sheet such that the cutting requirements are met and no cuts overlap. This paper presents a genetic algorithm for the cutting-stock problem which handles non-convex, irregularly shaped parts and regular sheets. The objective is to maximize the utilization of the sheet for a given bill of materials. The salient features of this algorithm are the way in which layouts are described, and the way in which the eciency function is computed. We create 'pseudo-layout' of the parts on the sheet , which are easier to be manipulated by the genetic algorithm. Also pseudo layout can be changed into unique actual layouts in a simple manner. The proposed algorithm can handle placement of highly irregular parts with ease as no simplifying assumptions are made about the shape of the parts to be placed. The algorithm was tested with part requirements resembling those from an actual leather industry stock cut need. Several runs were made with di erent bill of materials and varying sheet dimensions. The eciency of placement ranged from 65-75%.

Keywords - cutting stock problem, bin packing, bill of materials, greedy algorithms, genetic algorithms, pseudo-layout, cloning, Bernoulli crossover, mutation.

1 Introduction The two-dimensional cutting stock problem can be stated as tting of arbitrary two-dimensional shapes onto a large sheet (of possibly arbitrary shape). This problem is common in applications like bin packing, garment industries, sheet metal stamping, leather industry etc. In general, the problem can be formulated as follows ( Dagli and Tatoglu [1] ) Minimize the scrap generated ( or maximize the total area of parts placed on the sheet) subject to the following constraints : 1

   

Parts must lie entirely within the sheet. Parts should not overlap each other. The placement requirements, as speci ed by the bill of materials, are met. Constraints applicable to speci c applications are met. ( e.g. presence of non-utilizable areas on the sheet (leather industry), patterns to be placed along speci ed directions (garment industry), need for a cutting tolerance between parts ( metal-cutting industry) etc.)

The problem of stock-cutting in leather industry is more dicult as it involves highly non-convex and irregularly shaped parts (mostly unsymmetrical) to be placed on non-convex, irregularly shaped sheets. The application in the leather industry is one of the more challenging ones given the high degree of inhomogeneity of the leather stock and its inherent non-utilizable areas. Our goal is to nd a layout of the parts on the sheets which allows pieces to be cut in keeping with the production schedule, while minimizing the scrap. Many di erent approaches have been suggested for solving the cutting stock problem, depending on the application area, as surveyed by Dowsland et. al. [2]. Given the constraints for the leather industry, two approaches lend themselves as viable solutions for the cutting stock problem - using Greedy Algorithms which involve placing parts on the sheet one at a time or by using Neighborhood Search Algorithms which use a probabilistic approach. The rst approach has the advantage of reducing the global problem of placing all parts on the sheet to the much more tractable, local problem of placing one part at a time. This method has been tried by Albano and Sapuppo[3], and Heistermann and Lengauer [4]. However it is likely that better eciency could be achieved if all parts were placed simultaneously. Thus probabilistic approaches in which the computer generates one or more random placements of parts on the sheet, need to be considered. These include simulated annealing approaches [5, 6] and genetic approaches [7, 8]. Simulated annealing is based on thermodynamics and it uses the annealing process as the basis for the optimization. Genetic approaches use the concept of natural search and selection in order to achieve the optimization. Kroger [7] solves the Bin Packing Problem using sequential and parallel genetic algorithms. Jain [8] introduces the concept of a two-dimensional genetic chromosome to solve the problem of packing non-convex parts on a rectangular sheet. But most of the genetic algorithm based approaches have been applied on highly speci c problems - e.g. assuming shapes to be cut as convex, working with highly regular, synthetic shapes and/or rectangular sheets. This paper deals with the application of a Genetic Algorithm to the cutting-stock problem with highly irregular and non-convex parts included in the bill of materials. This approach was chosen as it has a exible, modular structure that allows the basic algorithm to be easily modi ed from one problem to another. The rest of the paper is organized as follows. In section 2 we present a brief introduction to genetic algorithms. In section 3 we explain our proposed algorithm in detail. In sections 4, 5 and 6 we present an example that brings out the utility of the proposed algorithm and discuss the results and possible future extensions to the work.

2 Genetic Algorithms Genetic Algorithms are search algorithms for complex search spaces and use the tools of natural selection and genetics for the search. The applications of genetic algorithm range from optimization, layout of facilities, job scheduling, resource allocation etc. Some of the key attributes of the process of natural selection are ( Srinivas et. al., [9] )  A diverse and large initial population.  A mechanism for changing the characteristics of individuals in the population.  A mechanism for introducing new individuals into the population  A mechanism for selecting the ttest individuals in the population 2

A schematic of the working of genetic algorithms is presented in Figure 1. For adapting the genetic algorithm approach to the problem of stock cutting we need to specify the following  A speci c assignment of parts on a sheet (an individual layout)  A suitably large and diverse initial population of layouts  An objective function to evaluate the tness of population suitable structure for a chromosome (genetic encoding )  A suitable method to perform crossover and mutation operations on the chromosomes  A termination criterion

3 Stock Cutting Algorithm The following sub-sections explain in detail how the genetic algorithm has been adapted to solve the cutting stock problem.

3.1 Layout De nition

To describe a speci c assignment of parts on a sheet i.e. layout, we must rst specify the part list and the sheet available for the placement of the parts. The sheet is assumed to be any convex polygon with speci ed dimensions. Each part to be placed has the following information associated with it: a part type k ; a vertex xed as a reference point (xk ; yk ); and an angle that one of the edges emanating from the xed vertex makes with the horizontal (reference direction k ). Using this convention a part can then be described by the vector (k ; xk ; yk ; k ). When a part type k is included in the part list ( i.e. the bill of materials ), it is imperative to specify the number of copies of that part type in the bill of materials. Also speci ed are the lengths and angles that are needed to describe the part in an intrinsic, coordinate free manner (as shown in Figure 2). A layout, then, is given by an ordered listing, of part types to be placed, location of its reference point and its reference direction. But for a layout to be considered as a valid solution, there must be no overlaps between the placed parts and the number of parts placed must comply with the requirements as speci ed in the bill of materials. In Section 3.5 we explain how a given ordered listing of part types (which allows parts to overlap on the sheet) is mapped to an actual placement of parts on the sheet without any overlaps. 3.1.1

Handling Non-Convex Parts

The parts are assumed to have polygonal, but not necessarily convex, boundaries. However if a part is not convex, we rst decompose the part into convex pieces for mathematical tractability. The decomposition algorithm employed (Feng et al. [10]) works in two steps 1. Decomposition of simply connected polygons at concave angles into non-decomposable subpolygons (convex or spiral polygons). 2. Decomposition of spiral polygons into convex polygons. Once a non-convex polygon is decomposed, it is considered as a collection of non-decomposable convex polygons and used as such in future. 3.1.3 Algorithms for Manipulating the Polygons Several basic components for polygon manipulation need to be included in the algorithm. These include  Translating and rotating polygons.  Determining if two polygons intersect.  Moving a polygon for a given distance along a speci ed direction. 3

Translating and rotating the polygons is made easy as we de ne the parts in a coordinate free manner. We have used an algorithm similar to that proposed by Avnaim and Boissonnat [11], which computes all the placements for a polygonal object I (with m edges) which is free to rotate/translate but not to intersect another polygonal object E. In order to achieve motion of a polygon in a given direction under the constraint that it does not intersect with any other polygons, we rst need a method to nd the collision distance between polygons in a plane. The algorithm proposed by Yan Yong [12] is used for minimum collision distance calculation. The paper presents an optimal two-step algorithm which rst nds the collision vertex of a polygon given the direction of motion of the polygon, and then nds the minimum colliding distance along the given direction. Once the distance the polygon can move along a given direction is known, translating the polygon is achieved using the algorithm for translation ( as explained earlier ).

3.2 Objective Function

The tness of the individuals in the population needs to be determined by some calculation which determines how well the individual performs with regard to the solution. In our implementation of the genetic algorithm, each generation consists of a collection of potential layouts. An eciency function is evaluated for each of the solutions, and a new generation is produced by the processes of cloning, crossover and immigration. The eciency function used is simply the ratio of the sum of areas of all of the parts completely placed on the sheet to the total area of the sheet. At each generation we sort the population on the eciency of placement. The layout with the best eciency will be at the top of the array of layouts. In this manner we can easily select the ' ttest' layouts for reproduction and apply the concept of natural selection.

3.3 Encoding Mechanism

For a genetic algorithm to operate on layouts, the reproduction process must be able to produce a valid layout by exchanging information between two layouts. To enable such a process we create a new phase space, consisting of 'pseudo-layouts'. This constructed space has two important properties. First, reproduction using two pseudo-layouts produces a new pseudo-layout. Second, there is a well-de ned mapping from pseudo-layout to actual layout. That is, a pseudo-layout can be converted to one and only one actual layout and the mapping always produces a valid solution. A pseudo-layout consists of ve variables (k ; xk ; yk ; k ; k ) for each part placed. The rst four variables are same as needed to de ne a part. The additional variable k is an angle variable used to convert the pseudolayout to an actual layout and is a `chosen angle' useful in resolving overlap con icts when parts are placed on the sheet. The above 5-dimensional vector is chosen randomly from individual uniform distributions. The individual variables are generated within the following ranges: 0 0 0 0 0

 k  xk  yk  k  k

 N  Xmax  Ymax  2  2

where N is the number of di erent part types in the bill of materials, and Xmax and Ymax are the sheet dimensions.

3.4 Reproduction

For a given bill of materials and the sheet dimensions, we can calculate an approximate number of parts that would be needed to utilize all of the sheet area. This number is called 'layout size'. The number of layouts in a generation is called the 'pool size'. The poo size can range from 5 to 10 times the 'layout size'. Now, to generate new generations, we need to perform cloning, crossover and immigration processes which will give us new pseudo layouts. In order to specify the number of layouts 4

in each generation created by the processes of cloning, crossover and mutation, we de ne variables called 'clone num' and 'immigration-num'. These variables are equal to speci ed fractions of the parent population ( i.e. pool size) and are assigned xed values at the start of the algorithm. 3.4.1

Cloning

Of the individuals in the parent population, we clone `clone num' of individuals to the next generation ( i.e. transfer them unchanged ). Keeping with the essence of genetic algorithms we clone those parents that had been evaluated as ` t' by the objective function ( i.e. clone those parents that have the best placement eciencies ). The cloning process ensures that the best solutions are always carried on to future generations and thus maintains a monotonically improving solution. 3.4.2

Crossover

Crossover is the process of exchanging genetic material between two parents in order to produce o spring for the next generation. Crossover is performed on parent individuals randomly selected from the parent generation. The simplest approach to crossover is the single-point crossover. If L is the length of a chromosome, then we randomly select a crossover point (an integer lying in the range 1 to L-1). The parts of the two parent chromosome strings beyond this point are exchanged, resulting in two new strings. We have adopted the Bernoulli crossover (Norman and Bean [13]), which is di erent and inherently simpler than single-point or multiple-point crossover. This is explained below: Suppose there are two layouts (i and j ) in the parent generation with the following variables (chromosome strings) associated with the kth part types in the ordered listing of parts (sheet layout) Part k of layout i (ik ; xik ; yik ; ik ; ik ) Part k of layout j (jk ; xjk ; yjk ; jk ; jk ) A string of Bernoulli random variables in the range (0,1) is generated. A threshold variable called `crossoverratio' is de ned based on which the individual parent elements are switched if the Bernoulli generated random variable is larger than the crossover ratio. The crossover process is exempli ed in Figure 3 The result of crossover between the parts i and j is therefore Child 1 (jk ; xik ; yjk ; jk ; ik ) Child 2 (ik ; xjk ; yik ; ik ; jk ) Both part types are valid and are introduced into the pseudo-layout for the new generation. This process is illustrated further using a numerical example in Figure 4. 3.4.3

Mutation

As only the ttest individuals among the potential layouts are selected as members of the new generation, some of the genetic material which in combination with the crossover process can result in tter layouts in future generations, is lost. As cloning and crossover do not introduce any entirely new chromosomes, the genetic algorithm needs an operator to restore lost genetic material and create new, variant individuals. This is achieved by the process called mutation. In some genetic algorithm implementations the chromosomes are binary encoded i.e. they consist of a string of 1's and 0's. In such cases the mutation operation involves ipping the bits with a nite probability. In other words, the chromosomes are altered only if a random number generated is greater than a speci ed value (called the mutation rate). However implementing a mutation operator for our 5-dimensional vector which is a chromosome consisting of real values (as opposed to binary coded chromosomes) presents diculties. To circumvent this we perform immigration-type mutation [13], rather than single parent mutation. In immigration-type mutation, we generate 'immigration num' of new randomly generated layouts that contain new genetic material and are not related to the parent population. The new generation now has layouts equal in number to the 'pool size' + 'immigration num'. Next, the pseudo-layouts are converted to actual layouts as described in the next section. As we have de ned a generation to have population size of 'pool size', we sort the actual layouts in order of eciency and select the best layouts such that the new generation has 'poo size' number of layouts (in other words we discard the worst 'immigratio num' number of layouts ). 5

3.5 Generation of Actual Layouts

A pseudo-layout consists of only variables that describe the type of part that is being placed, information about its reference vertex and direction and another angle variable. To convert it to a actual layout, the parts are placed successively on the sheet. For example, the kth part is placed using the variables (xk ; yk ; k ). An actual layout cannot have parts overlapping with each other. So for each part placed a test is performed to see if it intersects any of the previously placed parts. Depending on the result of this test three possible steps can be taken 1) if the placed part does not intersect with any other part, it is brought as close as possible to the parts already located on the sheet, using a simple compaction routine [14]. 2) if the placed part intersects a part already on the sheet then we implement a routine that nds gaps in the sheet where the part can be placed (explained in section 3.5.1). 3) if no gap is found where the part can be placed, we just slide the part along the line determined by the angle k until it no longer overlaps any other part. Finally we test to see if the parts lie completely on the sheet . All the parts that are on the sheet constitute the actual layout for the sheet. The eciency of placement of parts in the sheet can now be calculated. The layouts are then sorted in decreasing order of eciency and a new population of individuals is de ned.3.5.1 Gap Finding Routine : If a part k intersects another part on the sheet, we draw a rectangular container along direction k such that the container represents the area that the part k will sweep out if it is moved along direction k. Then we nd all the intersecting areas of the rectangular container with parts already placed on the sheet. The projection of these areas in the direction k then gives the inaccessible regions for the placement for the given part k (as the part is constrained to move only along the d

3.6 Termination Criterion

The advantage of using natural selection is that the best layout of the child generation always has a placement eciency of at least the best layout of the parent generation. That is, as more iterations are performed and new generations generated, the eciency of placement never decreases. The genetic algorithm can be made to run till a layout achieves a certain tness value. But for this problem we cannot specify any reasonable desired tness value and so this method is not appropriate. Instead, we can let the algorithm run until a timer or generation counter reaches a given value. This guarantees that the algorithm terminates, but doesn't assure that we have got the best results. In our case we terminate the algorithm after 500 generations.

4 Example Here we demonstrate the advantages of this approach using an example. The bill of material contain both convex and non-convex parts. The sheet is a rectangle. The maximum number of copies of each part type that can be placed on the sheet is also given. The bill of materials is given in Table 1. If the 'layout size' calculated is N, then for this example, the values of the various variables are = 5*N pool size clone num = N immigratio num = N crossove ratio = 0.5 The algorithm was implemented in C++ programming language. The simulations were run on a Sparc 5 Sun Station. The result obtained at the end of the 500th generation is shown in Figure 6.

5 Conclusions The eciency of placement for the example shown is 70%. For di erent bills of material ( with the same sheet ), the eciencies ranged from 65-75% depending on the irregularity of the parts.

6

The results show that this algorithm is e ective for placement of parts that are highly irregular. There are minimal use of assumptions about the form of the parts and so the algorithm can be used for any collection of parts and not just for a selected group of parts with similar properties. Also the algorithm can easily handle irregular ( non-rectangular or non-convex ) sheets as it does not make any simplifying assumptions about the geometry of the sheet. The algorithm can be easily extended to handle the multiple sheet problem ( the objective in this case is to minimize the number of sheets required to place a speci ed bill of materials) by simple modi cations to our basic algorithm.

6 Applications This algorithm can be applied in many stock cutting applications but its use in the leather industry is most promising. Defective areas in the hide ( the sheet ) can be easily included in the problem framework by treating them as permanently placed parts. Also the fact that no two leather sheets have the same dimensions presents no diculties for the algorithm.

7 Acknowledgements The research reported here is supported by a grant from the National Science Foundation (Grant Number DMI - 9523123 ). This support is gratefully acknowledged. REFERENCES

References [1] Dagli, C.H. and Tatoglu, M.Y., An Approach to two-dimensional cutting stock problems, Int. Journal of Production Research, vol. 25, pp. 175-190, 1987. [2] Dowsland, K.A. and Dowsland, W.B., Solution Approaches to Irregular Nesting Problems, European Journal of Operational Research 84, pp. 506-521, 1995. [3] Albano, A. and Sapuppo, G., Optimal allocation of two-dimensional Irregular Shapes using Heuristic Search Methods, IEEE Transactions on System, Man and Cybernetics, Vol. 10, No. 5, pp. 242-248, May 1980. [4] Heistermann, J. and Lengauer, T., Ecient Automatic Part Nesting on Irregular and Inhomogenous Surfaces, Proc. of the 4th Annual ACM-SIAM Symp. on discrete Algorithms, pp. 251-,1993. [5] Luti yya, H., McMillin, B., Poshyanonada, P. and Dagli, C., Composite Stock Cutting through Simulated Annealing, Math. Comput. Modeling, 16 #1, pp. 57-74, 1992. [6] Dagli, C. H. and Hajakbari A., Simulated Annealing Approach For Solving Stock Cutting Problem, IEEE Transactions, pp. 221-223, 1990. [7] Kroger, B., Guillotineable Bin packing : A Genetic Approach, European Journal of Operational Research 84, pp. 645-661, 1995. [8] Jain, S. and Gea, H. C., Two-Dimensional Packing Problems using Genetic Algorithms, ASME Design Engineering Conf. 1996. [9] Srinivas, M. and Patnaik, L.M., Genetic Algorithms: A Survey, IEEE Transactions, pp. 17-26, June 1994. [10] Feng, F.H. and Pavlidis, T., Decomposition of Polygons into Simpler Components : Feature Generation for Syntactic Pattern Recognition, IEEE Transaction on Computers, Vol.c-24, No. 6, pp. 636-650, 1975. [11] Avnaim, F. and Boissonnat, Jean-Daniel, Polygon placement under translation and rotation, Theoretical Informatics and Applications, vol. 23, pp 5-28, 1989. 7

[12] Yan Yong, An optimal algorithm for solving collision distance between convex polygons in a plane, Journal of Computing Science and Technology, vol. 8, pp 367-373,1993. [13] Norman, B. A. and Bean, J. C., Random Keys Genetic Algorithm For Job Shop Scheduling, Technical Report March 1994. [14] Zhenyu, Li and Milenkovic, V.,A Compaction Algorithm for Non-Convex polygons and its Applications, ACM. pp. 153-159, 1993.

8

Suggest Documents