You are on page 1of 6

Application of Genetic Algorithm for Rectangular Object Layout Optimization*

Xiaozhen Mi 1, Xiaodong Zhao 1, Wenzhong Zhao 1, Wenhui Fan 2


Mechanical Engineering department, Dalian Jiaotong University, Dalian, P.R. China
mxz@djtu.edu.cn
2
Automation department, Tsinghua University, Beijing, P.R. China
fanwenhui@tsinghua.edu.cn
Abstract

Rectangular Object Layout is not a simple NP


(nondeterministic polynomial) optimization problem
because of the practical production rules, such as
guillotine. Under some situations, the guillotine is even
more important than the pure using ratio of metal
sheets. To improve the using ratio of stock sheets and to
reduce the production costs, the genetic algorithm is
adopted to optimize rectangular object layout on stock
sheets. The purpose of this paper is to construct the
model of genetic algorithm and design the genetic
operators. Combined with the lowest horizontal linesearch algorithm, Genetic Algorithm model is applied
into rectangular object layout optimization. Results
show that the model in the paper can satisfy not only
the practical production requirements of guillotine, but
also the requirement for production convenience. In
this way, user can get optimal layout results effectively
and quickly and a higher material using ratio at the
same time for normal production practice.

Keywords: Genetic Algorithm, Genetic Operators,


Rectangular Object Layout, Guillotine.

1. Introduction
The optimization of rectangular object layout is to
put rectangular objects of different sizes in definite
stock sheets and get the higher using ratio of material
sheets with no interference and not beyond the
boundary [1]. According to different technical and
production requirements of companies, rectangular
objects can be placed horizontally or vertically.
Sometimes objects may be put at any angles for
adapting certain performance requests or sizes. Because
of too many choices for layout solution on stock sheets,
problems are complicated usually. In fact, practices
need an effective and easier method to prepare
materials, to organize production, to manage their
supply chains in order to get higher material using ratio
and lower costs.
The Rectangular Object Layout is not a simple NP
*Sponsored by State Key Technologies R&D Program
(2006BAF01A01)

(nondeterministic polynomial) optimization problem [2].


Many researchers are engaged in this area and bring
forward many approximate solutions[3], such as the
sequent order algorithm, the matching algorithm for
surplus rectangle and so on. The basic strategy of
approximate solution is to select the best solution at
current situation, so it is hard or impossible to find out a
optimal solution. In the early of 1960s, Gilmore and
Gomory[4~7]published four papers and put forward to
the layout problem. During 1980s there ware many
research results [8~11] on rectangular layout and solved
some problems of rectangular parts and irregular parts
layout. Segenriech and Braga put forward to a Genetic
algorithm solution for multi parts layout problem[12].
Genetic algorithm has the powerful ability to search
globally and find out optimal solution with bigger
probability. But unilateral pursuing for higher ratio and
no concerning practical requirements from industry
could not reach higher ratio and lower costs in
production. It may take more human-hours to cut down
material costs, and at last people got opposite results.
Combining the lowest-horizontal-line searching
algorithm, the paper builds a genetic algorithm model
and tries to solve rectangular object optimal layout.
Main requirements from industry are guillotine and
same-parts-together rule. Leaving safe distances for
operating and special fiber directions or performances
for metal parts are practical requirements too. Later one
is represented by the texture of parts in this paper, that
is, parts must be put at special directions with the
drawing fiber of metal sheets. Optimization can help to
improve the using ratio of stock sheets, reduce
preparing time and standardize process management.
Fig. 1 shows the different results of layout.
In Fig.1, layout solution a) and b) will give different
production costs because same parts when putting
together need much less operating time for cutting.
Guillotine is a particular requirement from shear
machine when cutting rectangular sheet parts. Shear
machines can only cut straight lines through the whole
sheet width, so layout c) is an ideal theoretical solution
and not suitable for practical manufacturing. The
correct and useful result should be layout d).
The objective of this paper is to propose an
optimized solution for rectangular object layout by gene

_____________________________________
978 -1-4244-1651-6/08/$25.00 2008 IEEE


a. Same parts not together

b. Same parts put together

with X direction; negative serial numbers of the


rectangle parts stand for parts placed in vertical
direction, namely the long sides of the parts parallel
with Y direction. For example, the chromosome (3, -1,
2, -4, 5) means that part No.3 is placed horizontally first;
Then part No.1 vertically; part No.2 horizontally; part
No.4 vertically; Finally part No.5 horizontally (in Fig.
2).
Y

c. Guillotine unsatisfied
Parts

d. Guillotine satisfied
Unused

4
3

Cutting Line

Fig. 1 Industry requirements for layout

theory and the lowest-horizontal-line search algorithm,


which gives not only a higher material using ratio but
also satisfies requirements in industry. The building
process of genetic algorithm model for rectangular
object optimal layout, including gene coding, decoding,
population initialization, crossover operator, mutation
operator, fitness function and operator selection, is in
chapter 2. Chapter 3 gives a case study. Chapter 4 is
conclusion parts.

2. Genetic algorithm model for rectangular


object optimal Layout
The genetic algorithm is a global optimization
method. It imitates the natural process of gene
evolution and reconstruction. Parameters of the
problem are coded and called "gene". Some genes build
up a "chromosome" and then selections, crossovers, and
variance operator similar to nature can be carried
through. After many repeated operations one can find
out a optimal solution [13,14,15]. Usually the evolutionary
generation is about 100~ 500.

2.1 Gene coding


The first key problem to be solved is the coding in
order to apply genetic algorithm. It is a key step for
designing genetic algorithm too. Coding decides not
only the arrangement form of an individual
chromosome, but also the decoding from genotype to
individual performance type in search space, and the
designing of genetic operators. The coding influences
the performance and the efficiency of the genetic
algorithm directly.
Because stock sheets and parts are both rectangle,
parts can be laid down mainly in horizontal or vertical
directions in order to improve the using ratio of stock
sheets. So the coding of each gene can be positive or
negative. Provision in this paper is: positive serial
numbers of rectangle parts stand for parts placed in
horizontal direction, namely long sides of parts parallel



X
Fig. 2 Part arrangements and
chromosome of genes

Concerning characteristics of rectangular object


optimal layout problem, we adapt the integer coding.
Each rectangle part will be placed unify to carry on
serial number first. Serial numbers for rectangle parts
can be positive or negative, decided by the directions
being placed horizontally or vertically. Each part should
have a gene coding. If the total number of rectangle
parts is n, then n serial numbers of rectangle parts
constitute into a chromosome. The length of each
chromosome is same as the total part number. In a
chromosome, the coding of each gene should be
corresponded to a serial number of rectangle parts. The
arrangement of all gene codes consists of a
chromosome.

2.2 Decoding
Decoding helps people to confirm the conversion
method from the individual genotype to individual
phenotype. In our case, this process is to convert
chromosomes to a layout chart. On the basis of the
lowest-horizontal-line search algorithm [16], steps are as
follows:
1. Suppose that the initial highest contour is the
bottom of stock sheets.
2. Whenever putting a part Pi onto stock sheet, try to
select a lowest segment of the selection horizon from
the highest contour. If there are several segments, we
select the very left side and test whether the width of
that line is larger than or equal to the width of the spare
parts:
(1) If the width of that line is larger than the width of
spare parts, then place that part in this position and
renew the highest contour of the spare parts in the
meantime.
(2) Otherwise, search a spare part that can be placed
backward from the position of spare parts and exchange
positions of these two spare parts in the meantime. If
there is no one, promote the lowest horizon to the lower

height and renew the highest contour. Namely: For P=


{P1, P2 PiPj, Pn}, 1< Pi<Pj<n, if the part Pis
width is larger than the width of the lowest horizon,
then search in {Pi+1 PjPn}. If the part Pis width
is smaller than the width of the lowest horizon, then
place part Pj. At the same time, P= {P1, P2, PiPj
Pn} is renewed into P= {P1, P2PjPi Pn}.
3. Repeat the 2nd step until the spare part placement
finish.
4. Repeat above-mentioned process until all spare
parts placement finish.

2.3 Initialization population


Initialization population plays a key rule on the
convergence speed and solution quality of genetic
algorithm. A simple method to generate the
initialization population is random generating. This
method is easy to be realized but can not assure the
quality of initialization population. Due to neglecting
data characteristics of stock sheets and spare parts, it is
difficult to acquire a better initialization population
with the random method. It is not easy to acquire
satisfactory results even taking longer time. We
recommend the heuristic rule used when generating
initialization population.
The scale of initialization population plays certain
influences on the performance of genetic algorithm.
The bigger the scales of initialization population, the
higher the diversity of the individual, then the algorithm
is not easy to go into a risk of getting a partial solution.
But bigger scales of initialization population may
increase calculation time so to decrease the
performance of genetic algorithm. If scales of
initialization population are too small, the genetic
algorithms search space is limited and as a result
searching stops, probably, at the immaturity stage. In
order to avoid this phenomenon, we must keep the
community diversity, that is, scales of the community
can't be too small. The scale of the community is
between 30 and 200. An inadequate scale of the
community will influence on comprehensive
performance of genetic algorithm [17].

2.4 Crossover operator


Crossover operator plays a core role in genetic
algorithm. Crossover means exchanging part structure
of parents individual to generate new individual.
Crossover is a main method to generate new individuals
and decides the ability for global search in genetic
algorithm. Crossover probability is between 0.4 and
0.99.
In chromosomes coded by integral sequences, the
most difficult thing for crossover is that there will bring
illegal genes after exchanging parts of gene fragments
between two chromosomes, namely there will contain
repeated gene in the chromosome. In the process of
chromosome crossover, we need to make sure that not

only chromosome crossover occurs, but also no


repeated gene appears after chromosome crossover.
The method for chromosome crossover is as follows:
First, choose a fix crossover position and then keep the
front part of genes fixed. Genes behind the cross point
are crossover. Compare uncrossed genes between two
chromosomes. Remained genes of chromosome are put
into two array P[] and Q[] with original sequence after
throwing away the same gene in two gene fragments.
During operating the cross gene fragment of the
chromosome genes not equal to array P[] and Q[] will
exchange directly. The gene equal to array P[] and Q[]
will be changed into genes in array P[] and Q[] and then
exchange.
For example, two chromosomes to be crossover are:
A = {-3, 5, 7, -1, 6, 8, -2, 4}, B= {5, -2, 4, -7, 8, 6, 3, 1}, and steps for the chromosome crossover are as
follows:
(1) Firstly, set a crossover position and choose the
fifth position is the point of intersection (the very left of
each chromosome is 1, from left to right, the position
serial number increases one by one in order). The arrow
stands for the point of intersection;
part of fixed
of crossover


 partA ^ 3,5, 7, 1, 6, n 8,-2,4 `

part of fixed



5, 2, 4, 7,8, n

part of crossover

6,3,-1

(2) Compare the fixed part of chromosome A and


B chromosome. Both A and B have gene 5 and 7. Then
5 and 7 are throwing away from fixed part of
chromosome gene fragments A. Remaining genes of A
chromosome are put into array P[]={-3, -1, 6}by
original sequence. In the same way, 5 and 7 are
throwing away from fixed part of chromosome gene
fragments B, and the remaining gene of B chromosome
are put into array Q[]={-2, 4, 8} by original sequence.
(3) Compare the crossover part of A chromosome
and B chromosome. Each has different part: A
chromosome has 8, -2, 4 and B has 6, 3, -1. Different
part are then substituted respectively for the gene of P[]
and Q[]. At this time, the crossover gene of A
chromosome are changed into {-3, -1, 6}, and the B are
changed into {-2, 4, 8}.
(4) After three step above, A chromosome and B
chromosome are changed into:

Two new chromosomes will be generated after


crossover operation:
A-357-16-248
B5-24-78-3-16
The implementing method of crossover operation is:
set the number of rectangle parts is n, cross position is a
random count in [1, n]. Set the cross probability in
advance and crossover operation occurs according to
the following situations:



Produce a random R between 0 and 1


If (R is smaller than cross probability)
{
Crossover operation are carried on between
two chromosomes in the population from
random choice
}
Else
Crossover operation didnt occur.

2.5 Mutation operator


From the point of genetic algorithm, the solution
evolution mainly depends on the choosing mechanism
and crossover strategy. The mutation is an assisted
method to generate new individuals and decides the
local search ability of genetic algorithm. Combined
crossover operator with mutation operator, we can
accomplish the global search and the local search in the
searching space. It will result in an optimization process
with good searching performance by genetic algorithm.
Mutation probability is between 0.4~ 0.99. Generally
the mutation operator adopts the rotating mutation and
the position mutation. In our case, the number of
rectangle parts is n.
The thought for rotating mutation is producing a
random num between 1 and n, and then the number is
set to the opposite.
For example: Producing a random num 5,
For Chromosome A= {-3, 5, 7, -1, 6, 8, -2, 4}
The result of the rotating mutation is: A'= {-3, 5, 7,
-1, -6, 8, -2, 4}
The thought for position mutation is producing two
random number num1 and num2 between 1 and n, and
then exchange two positions each other.
For example: Producing two random num1 and
num2 is 3 and 6,
For Chromosome A= {-3, 5, 7, -1, 6, 8, -2, 4}
The result of the position mutation is: A'= {-3, 5, 8, 1, 6, 7, -2, 4}

2.6 Fitness function


The definition of fitness function applies a great
influence on the efficiency of solving problem. There
are two methods to define fitness function: One method
mainly considers the biggest height of the sheet layout
and tries to make the height of the sheet layout lower. It
can be expressed by the reciprocal of maximum height.
The other method is considering reusing of wasting
sheet and tries to improve the utilization ratio by
reusing the waste part of sheet (between the highest
outline of sheets and the highest contour of the sheet
layout). Suppose the total area of the rectangle part is
area1. Two kinds of fitness functions are defined
according to different stock sheets [18].
(1) The width is definite and length is infinite
For the situation of definite width and infinite length,
the height of layout is generally used to evaluate the
quality of layout. The fitness function is as follows:



area1 1
hu w
hthe maximum height of stock sheet
wthe width of stock sheet
(2) Both width and length are definite
The fitness function is as follows:
area1
2
Fitness
Fitness

area 2  h u w

area2the total area not including the last one


stock sheet
hthe maximum height of the last stock sheet
wthe width of the stock sheet
Here the fitness function means the utilization ratio
of stock sheet

2.7 Operator selection


In the process of genetic and natural evolution of
biology, species with more adaptive ability have more
opportunities to be inherited to the next generation, and
species with lower adaptive ability have fewer
opportunities to be inherited to the next generation. The
genetic algorithm imitates this process to select operator
(or called Reproduction Operator) so to keep the
survival of the fittest species in the community.
Individuals with higher adaptability have higher
probability to be inherited to the next generation;
individuals with lower adaptability have smaller
probability to be inherited to the next generation. The
operator selection of genetic algorithm is used to decide
how to select individuals in the community to inherit to
the next generation.
The operator selection adopts elitist strategy [19]. The
individuals with the highest adaptability in the current
community dont participate in crossover and mutation
operation, but substitute the individuals with the lowest
adaptability after crossover and mutation operation. The
operation process is as follows:
(1) Find out the individuals with highest
adaptability and the lowest adaptability in the current
community.
(2) If the adaptability of the best individual in the
current community is higher than the best individual up
to now, the best individual in the current community
becomes the new best individual up to now.
(3) The new best individual up to now then
substitutes the worst individual in the current
community.
This strategy makes sure that the best individual will
not be broken by crossover and mutation operation. It is
very important for assurance of genetic algorithms
convergence.

3. Case study
According to the models above, we develop a
system for rectangular object optimal layout on
platform VB.NET. Part parameters for layout are in

Table 1. Part Parameters in layout


Part
Name

Part width
(mm)

Part length
(mm)

Part
number

Texture

A
B
C
D
E
F
G
H

62
125
242
42
76
54
45
120

589
500
300
250
89
105
50
120

20
50
18
35
89
65
45
30

No
No
No
No
No
No
No
No

The length of chromosome is 8 (equal with the


total part number). Four kinds of situations are
calculated and analyzed. Under each situation, we can
get best layout and corresponding results.
1) The Generation of evolution changes and other
parameters remain unchanged. The scale of initial
population is 80. The crossover probability is 0.6. The
mutation probability is 0.001. Under this situation, the
larger the generation of evolution, the higher the using
ratio of material. At the same time, the time of
calculating is longer. Results are in Fig.3. In the paper
40-90 is recommended for rectangular part layout
problem.

and the calculating time increases too. It is unnecessary


for the scale of initial population more than their
permutations and combinations. Results are in Fig.4. In
the paper 60-100 is recommended for rectangular part
layout problem.
3) The crossover probability changes and other
parameters remain unchanged. The scale of initial
population is 80. The Generation of evolution is 50.
The mutation probability is 0.001. The using ratio of
material reaches the optimal when the crossover
probability is about 0.6. Results are in Fig.5. In the
paper 0.5-0.8 is recommended for rectangular part
layout problem.
Fig. 5 Results when the crossover
probability changes
The using ratio
of m aterial

Tab.1. The length of stock sheets is 1480 mm; the width


is 1250 mm. When the texture of a part is No in Tab.1,
this part can be placed on sheets at any directions and
has no any special requirement for metal performances.
If the texture of a part is Yes, this part can only be
placed on sheets at a specific direction, say, at a right
angle with X direction.


















The crossover probability

4) The mutation probability changes and other


parameters remain unchanged. The scale of initial
population is 80. The Generation of evolution is 50.
The crossover probability is 0.6. The using ratio of
material reaches the optimal when the mutation
probability is about 0.001. Results are in Fig.6. In the
paper 0.5-0.8 is recommended for rectangular part
layout problem.








Fig.6 Results when the mutaion


probability changes












The generation of evolution

2) The scale of initial population changes and


other parameters remain unchanged. The Generation of
evolution is 50. The crossover probability is 0.6. The
mutation probability is 0.001. With the increasing of
initial population, the using ratio of material increases

The using ration


of material

Fig.4 Results when the initial


population changes













The using ratio


of m aterial

The using ratio


of material

Fig.3 The results when the generation


of evolution changes






  









The mutation probability

The optimized layout is in Fig.7. In Fig.7, letters


represent parts (Tab.1) and numbers behind letters
represent the number of parts. In this case, material
utilization ratio is up to 96.92%. Parameters are: the
scale of initial population=80, the generation of
evolution=50, the crossover probability=0.6, the
mutation probability=.001. The most important is that
the high ratio is easy to fulfill in production.

The initial population



Fig.7 Optimal results for the case

4. Conclusion
Genetic algorithm is an important method in the
modern intelligent computation because of its strong
global searching ability. Genetic Algorithm model
proposed in the paper is very efficient for rectangular
object layout optimization. Results can not only satisfy
the practical production requirements of guillotine, but
also the requirement for production convenience, and
can be used for practical mass production in cutting
stock.

References
[1] Yang Wei, Liu Shengqing, Luo Yang. Genetic algorithm
for large scale rectangular object optimal embed
placement [J]. Journal of Sichuan University, 2001, 33(5)
35-38



[2] Cao Ju, Zhou Ji. An approximate algorithm for


rectangular cutting stock problem [J]. Journal of computer
aided design & computer graghics, 1995, 7(3) 190-195
[3] Patrick Healy. An optimal algorithm for rectangle
placement [J]. The Operations Research Letters, 1999,
24:73-80
[4] Gilmore. C, Gomory.R _E .A linear programming
approach to the cutting stock problem .Operations
Research.1961, 9: 849-859
[5] Gilmore .C, Gomory.R _E .A linear programming
approach to the cutting stock problem II .Operations
Research.19 63, 11:863-888
[6] Gilmore .C, Gomory.R .E .Multistage cutting stock
problems of two and more dimensions .Operations
Research.1965, 13:94 -120
[7] Gilmore C, Gomory.R .E .The theory and computation of
Knap sack functions. Operations Research.1965, 13:94 120
[8] Special Interest Group on Cutting and Packing Problem
(SICUP), http://prodlog.wiwi.uni-halle.de/sicup
[9] A.A. Farley. Mathematical programming models for
cutting-stock problems in the clothing industry. Journal of
the Operational Research Society.1988, 39(l):41 -53
[10] A.I. Hinxman. The trim-loss and assortment problem: a
survey. European Journal of Operational Research and
Development.1980, 16:462-469
[11] J. E. Beasley. Algorithms for unconstrained twodimensional guillotine cutting. Journal of the Operational
Research Society.1985, 36 (4):297-306
[12] Segenreich S .A, Braga F. Optimal Nesting of General of
Peane Figures: A Monte Carlo Heuristic Approach.
Computers and Graphics.1986, 10(3):22 9-238
[13] Stefan Jakobs. Theory and methodology on genetic
algorithms for the packing of polygons [J]. The
European Journal of Operational Research, 1996,
88:165-181
[14] Huang Hongbing, Cui Yaodong. Optimizing cutting
pattern in rectangular packing problem by genetic
algorithm [D]. Guangxi Normal University, 2005.13
[15] Yang cai, Gu Haiming, Shi Junyou. Optimized layout of
rectangular work piece using mixed genetic algorithm [J].
Forging & Stamping Technology, 2005, 30(3)4-7
[16] Long Zhihui, Huang Xingmei. The system of the
rectangles cutting stock problem based on genetic
algorithm [D]. Hunan University 2006.11
[17] Hopper E, Turton B. Application of Genetic Algorithms
to Packing Problems-A Review. Proceeding of the 2nd
On-line World Conference on Soft Computing in
Engineering Design and Manufacturing. Springer Verlag,
London, 1997, 279-288
[18] Zhang Ke, Lin Jiaheng. The research of the optimal
layout of rectangular part [D]. Shandong University,
2006.18
[19] Zhou Ming, Sun Shudong. Genetic algorithm theory and
applications [M].National defense industry press,
1996.46

You might also like