Waste reduction in Rectangular Figure Cutting using a Genetic Algorithm

Resumen Reducción de desperdicios en corte de figuras rectangulares usando algoritmo genético Date Received: April 7th 2016 Fecha de recepción: Abril 7 de 2016 Date Accepted: June 3rd 2016 Fecha de aceptación: Junio 3 de 2016 Waste reduction in Rectangular Figure Cutting using a Genetic Algorithm 1 Industrial Engineer. Independent consultant. jcnoriega08@gmail.com 2 Industrial Engineering PhD. Associate Researcher at Grupo LOGER. jaracohe@gmail.com 3 Systems Engineer. Development Engineer at PayU América Latina. leottau7804@gmail.com Ship Science & Technology Vol. 10 n.° 19 (19-26) July 2016 Cartagena (Colombia) 20 This document presents a genetic algorithm (GA) to minimize the waste produced when cutting rectangular figures out of a sheet. In academic literature, this problem is known as the Bin Packing Problem – BPP. The problem consists in searching for the best possible distribution in a sheet format or a predetermined plate, given a set of pieces with different shapes. Several types of industries require tools to solve this issue, that may be applied to cutting materials such as metal, wood, glass, plastic, paper, leather, among others. For example, it is a common problem in the shipbuilding industry, since rectangular shapes are cut out of metal sheets and then used to join flat and curved blocks in order to assemble vessels. There are three types of packing problems in literature: twodimensional bin packing problem (2D-BPP); two dimensional cutting stock problem (2D-CSP); and two-dimensional strip packing problem (2D-SPP). This effort addresses the 2D-BPP problem. This document introduces a genetic algorithm (GA) to solve the problem of cutting rectangular pieces in a rectangular area. Binkley & Hagiwara, 2006, describe the packing issue through the four corner heuristics with an auto-adaptive genetic algorithm to find the best solution to the problem. Lee, 2008, suggests a GA a crossover operator that will enable generating several offspring from a couple of parents. Albano & Sappuro, 1980 show one of the first researches related to the problem, accepting regular or irregular-shaped pieces; it uses a heuristic as a solution-seeking method. Definition of the Problem The mathematical problem is shown in Álvarez & Toro, 2009; annex 1 where the model parameters and variables are presented. Equation (1) shows the target function which consists of minimizing the amount of wasted material. Equations (2) to (5) avoid superimposing rectangles on the sheet. Equation (6) ensures that the couple of rectangles assessed with the above equations fit within the dimensions of the sheet. Equations (7) and (8) ensure that the positions of the pieces fit within the sheet dimensions

This document presents a genetic algorithm (GA) to minimize the waste produced when cutting rectangular figures out of a sheet.In academic literature, this problem is known as the Bin Packing Problem -BPP.The problem consists in searching for the best possible distribution in a sheet format or a predetermined plate, given a set of pieces with different shapes.
Several types of industries require tools to solve this issue, that may be applied to cutting materials such as metal, wood, glass, plastic, paper, leather, among others.For example, it is a common problem in the shipbuilding industry, since rectangular shapes are cut out of metal sheets and then used to join flat and curved blocks in order to assemble vessels.There are three types of packing problems in literature: twodimensional bin packing problem (2D-BPP); two dimensional cutting stock problem (2D-CSP); and two-dimensional strip packing problem (2D-SPP).This effort addresses the 2D-BPP problem.This document introduces a genetic algorithm (GA) to solve the problem of cutting rectangular pieces in a rectangular area.Binkley & Hagiwara, 2006, describe the packing issue through the four corner heuristics with an auto-adaptive genetic algorithm to find the best solution to the problem.Lee, 2008, suggests a GA a crossover operator that will enable generating several offspring from a couple of parents.Albano & Sappuro, 1980 show one of the first researches related to the problem, accepting regular or irregular-shaped pieces; it uses a heuristic as a solution-seeking method.

Definition of the Problem
The mathematical problem is shown in Álvarez & Toro, 2009; annex 1 where the model parameters and variables are presented.Equation (1) shows the target function which consists of minimizing the amount of wasted material.Equations (2) to (5) avoid superimposing rectangles on the sheet.Equation ( 6) ensures that the couple of rectangles assessed with the above equations fit within the dimensions of the sheet.Equations ( 7) and ( 8) ensure that the positions of the pieces fit within the sheet dimensions Sujeto a: Packing problem models without piece rotation are obtained by replacing equations (2) to (8) for equations ( 9) to (14), respectively.

Genetic Algorithm Design
To solve the problem, most procedures reported in literature are based on metaheuristic techniques (Álvarez & Toro, 2009).Therefore, this paper addresses the problem from the genetic algorithm implementation standpoint.Individual representation was based on objects (Lee, 2008) as a solution coding mechanism; this is due to the easy implementation of genetic operators.Object based coding consists of a swap of the given pieces.The values for each gene represent the pieces, whereas the sub index is only useful to indicate the packing order on the sheets, e.g.: given the following chromosome 3 2 4 5 6 1, Fig. 1 shows that pieces 3,2 are cut out of sheet 1, pieces 4, 5 are cut out of sheet 2, and pieces 6, 1, are cut out of sheet 3. Fig. 1 shows the structure of the genetic algorithm used to solve the problem.
The starting population is generated at random, using right angle polygon heuristics (Bottom Left) proposed in (Jakobs, 1996).This heuristics is used to define the way in which the pieces will be cut out of the sheet and therefore, defines the adaptation for each individual with the fitness function calculated as .Where A i is the area of the sheet i, and tj is the area of piece j packed in sheet i.In this case, the area of the last sheet is considered to be calculated with the height of the piece that stands out the most from the rest of the pack, which is known as maximum height.
Next, we carry out selection, where the individuals that will be taken to reproduction, in accordance with the results yielded by the fitness function, are defined.After several tests, the SUS-stochastic universal sampling operator was used for the selection process.In the SUS crossover operator a random number is required, and with such number all the individuals that will make part of the reproduction process are obtained.
Once the fittest have been selected, a genetic code combination is performed and as a result, new chromosomes called offspring are produced through the partially matched crossover (PMX) operator.During crossover, a segment of the chromosome chains of one of the parents is copied and inserted in the offspring chromosome; consequently, the blank spaces are filled with information from the other parent, so the genes will not be repeated along the genetic code.Fig. 3 shows an example.
After crossover, mutation comes to have a broader search area space.Mutation consists of modifying certain genes at random.For the case of the object or piece-based representation, the proposed (2-   opt) operator was used.This operator consists of selecting two random objects and then swapping positions between them provided both objects do not have the same random number.Fig. 4 shows an example.
The replacement operator consists of substituting some members of the population with newly generated individuals.The most renowned replacement operator is elitism, which is based on the adaptation function.It prioritizes the individuals with the highest adaptation function to remain in future generations, thus and just as in the natural evolution process, the least feasible solutions are replaced by the best ones.

Genetic algorithm parameters
In order to select the genetic algorithm parameters, an experiment in which its values varied was carried out; for the case of the number of generations, values of 100, 150, 200 were selected; in mutation, 1%, 5% and 10% values were used; and for the population size values ranging from 10 to 50 were chosen.The response variable is the average waste percentage after five replications of the experiment.Table 1 shows the results of the experiment carried out for parameter selection.
For each parameter combination the genetic algorithm was performed five times, using the case study; then, the parameter combination was determined which presented the best results; in this regard, the best performance was achieved with a number of generations with 200 individuals, a 50 individual population size and a 5% mutation percentage.
Application of the genetic algorithm in a case study of cutting pieces out of sheets I order to test the benefits of the genetic algorithm, a specific case related to the distribution of pieces of a product in a predefined format was set for solving.Some of these pieces are shown in Fig. 5.The sheets used in the manufacturing process are 2.4 meters wide, 1.2 meters high, and 12 mm thick; the total product consists of 20 different components.Since some pieces are repeated several times, there is a problem consisting of cutting a total of 55 pieces.
Even though most of these pieces are rectangles of several dimensions, there are also pieces known as "right angle polygons" (having more than four sides), such as the one shown in Fig. 6a.    2 3 4 5 1   1 3 2 4 5   1 3 4 4* 5  1 3 4 2 5   2 3 4  Th is right angle polygon name is due to the fact that the angle formed by every two adjacent sides is a 90 degree angle.In case of the rectangle (Fig. 6b), the same principle applies, considering that not all right angle polygons are rectangles, which aff ects the heuristics construction that allows placing the pieces in the sheets.
Before solving the case study using the GA, an evaluation of the process of distributing the pieces on the sheets was carried out, as done in the company (manually); for such purpose, the average waste generated in manufacturing 10 products was carried out, with the aid of Equation ( 15).
Where I d represents the waste indicator for a product distribution, A sheet is the total area of the sheets used in distributing a product, considering that the area of the last packed sheet is calculated with the maximum, and A AP.sheet is the total area of the pieces used in distributing a product, or the sum of the areas of all the pieces.
When performing the manual piece distribution based on experience, seven sheets are required, resulting in a total of 18.42 m 2 and 31.84% of waste, which is equivalent to 5.88 m 2 of the total sheets.Fig. 7 shows the distribution of the pieces over the total sheets for cutting, performed manually and based on experience.Th e average time associated to distributing the pieces on the formats was 32,5 min.
Th e Genetic Algorithm was implemented in JAVA and ran on a PC with WIN 7, AMD Turion  2.00GHz processor, 3 GB RAM and 500 GB HD.The distribution of the cuts generated by the genetic algorithm is shown in Fig. 8.This solution used only five sheets for a total of 15.42 m 2 and 21.25% of waste, which is equivalent to a 3.28 m 2 area.The average execution time was 8.8 minutes.When this numbers are compared with the average result of the manual distributions, a considerable reduction of 23.67 minutes on average can bee identified.
Considering the diagnosis results and the ones yielded by the computerized tool, Table 2 shows a comparison of the results obtained by the genetic Fig. 1.Object or piece-based representation.
Fig. 5. Types of pieces to be cut out of the sheet.

Fig. 7 .
Fig. 7. Distribution of the pieces on the sheets using an experience-based design.

Table 1 .
Experiment for parameter selection.

Table 2 .
Fig.8.Distribution for cutting pieces on sheets using the Genetic Algorithm.Comparative results chart.