Professional Documents
Culture Documents
Tomislav Šarić, Danijela Pezer, Goran Šimunović and Roberto Lujić 393
th
6 International Scientific and Expert Conference TEAM 2014
Technique, Education, Agriculture &Management
Kecskemét, November10-11, 2014
to allways provide an optimal final solution, The best known examples are simulated
however, because of its O(n!) complexity is the annealing, genetic algorithms, and ant colonies
impractical even for the 10 cities. optimization methods.
Linear programming is the optimization method of Solving the Travelling Salesman Problem with
the linear objective function, which is subject to evolutionary algorithms is very common. Although
constrains of linear equalities and inequalities. evolutionary algorithms do not allways find an
Branch and Bound is the general algorithm for optimal solution, their advantage is that they can in
searching the optimal solutions of many real time find a solution that is very close to the
optimization problems. It consist of counting all the optimal. Solving the problem of drilling sequence
potential solutions, where large subsets of inferior was obtained also by using GA.
solutions were rejected.
There are used method of dynamic search, 3. Genetic algorithm (GA) – general model
Backtracking method, and Branch & Cut method. GA is the optimization method based on the
Approximation methods – use the algorithms natural evolution, with the basic idea of survival of
that provides so-called sub-optimal solutions in a the best individuals in the population. Unlike most
relatively short time. The best known of the deterministic algorithms, GA does not start
approximation algorithm is the Christofides' search from the one point of solution, already from
algorithm. a hole range of potential solutions that are usually
Heuristics methods – the methods for solving randomlly generated and represents the inital
problems based on experience. population of the genetic algorithm. Depending on
Solving the Travelling Salesman Problem with the the given problem, capability (goodness) defined in
algorithm of nearest neighbor starts searching from fitness (objective) function, are determinate to the
arbitrary initial city, and every next city is the one initial population. In every generation choosen
which is nearest to the current city without being solution is closer to the optimum in comparison
visited yet. This algorithm usually does not provide with other members of the population, while inferior
an optimal solution, because it doesn't use all of solutions were rejected. Selected solutions are
the available data, for example, some of the city subjected to genetic crossover and mutation
are visited too early which prevents later to finding operators in order to create a new generation. The
a better solution, respectively, the solution procedure is performed iteratively until the
converges to a local minimum. The adventage of stopping criterion is met as a defined by the user.
this algorithm is in its implementation speed with a The basic algorithm structure is shown in Figure 1.
good optimum approximation, and it is used to
compare and testing the other algorithms. Generate initial population P(t)
Except the mentioned, there is used the Greedy Evaluate population P(t)
algorithm, Heuristic of nearest and farthest While stopping criteria not satisfied Repeat
insertion, and Nearest insertion of arbitrary city. Select some elements from P(t) to copy into
Metaheuristics methods – are iterative procedure P(t+1)
of solving combinatorial optimization problems that Crossover of some elements of P(t) and put
may include traditional heuristics such as one step into P(t+1)
of the procedure (e.g. local search). The essential Mutation of some elements of P(t) and put into
characteristic of metaheuristics is to use the P(t+1)
strategy of finding the global optimum. Sometimes Evaluate new population P(t+1)
metaheuristics allows the acceptance of inferior P(t)= P(t+1)
solutions of objective function in order to achieve Figure 1. Standard genetic algorithm [3]
the escape from a local optimum.
The basic terms used in the work of genetic
algorithm [4] are shown in the Figure 2.
gens
genotype 0 1 0 1 1 0 1
0 0 1 1 1 0 0 1 0 1 1 1 0
fenotype 11 9 25 14
chromosome 1 chromosome 2 chromosome 3 chromosome 4
population
Figure 2. Display of the basic terms int the work of the GA
The chromosome consist of the genes, where Each chromosome represents the one individual,
each gen is an one parameter, or variable xi = (i = or a one possible solution of the problem, and the
1,…,n). set of all chromosomes makes the population, i.e.,
X = [chromosome] = [gen1,…,genn] = [x1,…,xn]. the set of all possible solutions. The genetic
parent 1 1 1 0 0 1 1 1 1 1 0 offspring 1
CROSSOVER
parent 2 0 1 1 1 0 0 1 0 0 1 offspring 2
parent' s chromosome offsprings
Figure 4. Crossover in one (single) point
crossover points
parent 1 1 1 0 0 1 1 1 1 1 1 offspring 1
CROSSOVER
parent 2 0 1 1 1 0 0 1 0 0 0 offspring 2
parent' s chromosome offsprings
Figure 5. Crossover in two points
Tomislav Šarić, Danijela Pezer, Goran Šimunović and Roberto Lujić 395
th
6 International Scientific and Expert Conference TEAM 2014
Technique, Education, Agriculture &Management
Kecskemét, November10-11, 2014
There are different types of mutations, which operator, and it was used the permutation in which
among the other things, depends of the are two randomly selected genes swich the values
representation of chromosomes. In this paper, it is (Figure 7).
not possible to apply the traditional mutation
Figure 6. Mutation
Figure 7. Permutation
A significant increase of the crossover probability
Decoding reduces preservation of existing solutions, i.e.,
Decoding is the process of converting a binary increases the degree of destruction of individuals
number to a potential solution. with greater capability.
Elitism Termination of the algorithm
The protection of the best individual of the possible The process of creating the new generations is
changes or elimination, applying of genetic repeated until a predefined stopping criterion of
operators during the evolutionary process evolution is not satisfied. Some of the stopping
(selection, crossover or mutation) is called elitism. criteria for the algorithm are reaching predefined
However, although elitism can improve number of generations, satisfying the minimum
performance of genetic algorithm, the protection of criteria or the ending of evolutionary process,
the best individual of each step of evolution can which is reflected in the way that successive
significantly slow down the genetic algorithm. repetitions do not lead to better results.
Genetic algorithm parameters
The tipically algorithm parameters are population 3. Experimental part
size, number of generations (iterations), the For the selected technological task shown in
crossover and mutation probability. Considering Figure 8 on the principle of Travelling Salesman,
the values of the genetic algorithm parameters, the by using genetic algorithm, sequence of drilling
algorithm gives different results, faster or slower was optimized. The task was defined drilling of 25
coming to a better or inferior solutions. holes on the prismatic workpiece, with minimal tool
The population size is parameter that directly path, where the starting point of drilling depends
affects to the quality of the obtained solutions by on the random selection of the genetic algorithm,
reducing the probability of permature convergence and after the last hole drilling the tool is necessary
to a local optimum, while the negative side of return to the starting position. For a given problem
increasing complexity of computing and thus the of the tool path optimization, minimizing the lenght
total running time of the algorithm. Smaller of tool path was realized using the MATLAB
populations provides a better solution for a small software and the achieved software solution was
number of generations, and increasing of the simulated in EMCO WinNC program for Sinumerik
population is necessary to increase the number of 840D Mill control unit.
generations. The algorithm was run multiple times (50 times)
Number of generations is a parameter that directly with different combinations of population size and
affects at the algorithm execution time, as well as stopping conditions, in the aim of experimental
the quality of the obtained solutions. A larger determination of the number of individuals in the
number of generations gives a better solution, but population and the number of generations of
with increasing the runing time, it is necessary to genetic algorithm (for the tool path optimization
determine a number of generations by which the problem) an in order to determine parameters of
algorithm will find a satisfactory solution that may the algorithm that gives the best solution. Initial
not allways be optimal to be satisfying. population of chromosomes was randomly created,
A very important role in the work of GA has a where each chrormosome represents a string of
parameter of mutation probability that allows holes that need to drill, and each gene represents
avoiding of “stacking“ in the local optimum at assigned number of holes.
random algorithm leaps per solutions spase.
According to the Figure 9, there was obtained a The algorithm was tested on a sample with a small
total distance of tool path in the amount of 318,77 number of holes, and the results were compared
mm with manual programming, while the proposed with results obtained by heuristics nearest
genetic algorithm according to the size of the neighbour method. A Genetic algorithm, for the
population and the number of generations (which defined problem with 4 holes, finds an optimal
causes stopping execution of the algorithm), solution already for the 10 generations and 5
finding the optimal solution almost in the all the individuals in the population.
combinations, i.e., the minimal distance of tool Table 1 shows the average values obtained for all
path in the amount of 263,86 mm. 50 times starting of genetic algorithm, from which it
can be concluded that the genetic algorithm gives
quite stable solutions very close to the minimum.
Analyzed the data (Table 1) concluded that a
substantial increase the number of generations
and number of individuals do not give much better
solutions than the case with a smaller number of
generations and smaller number of individuals. For
Start (final) point of tool path a large number of individuals in the population
during performance of the algorithm there is the
possibility to appearance of a large number of
Figure 9. The total distance of tool path during the similar or identical individuals that provide good
manual programming solutions. By choosing these individuals for
Table 1. The average value of the fitness function in multiple algorithm startup
Number of Number of individuals in the population
generations 50 100 300 500 1000
100 292,7529 279,3912 269,0384 268,808 267,3062
300 270,5388 269,6934 267,3176 265,7477 264,4715
500 271,4110 270,0652 265,7013 265,6332 264,1243
1000 268,8153 266,8541 265,1995 264,6979 263,9364
reproduction, diversity of genetic material are Table 2 shows the average runtime of the
reduces and in that way are often obtained the algorithm in seconds, depending on the number of
lower results for the same number of generations generations and population size. Smaller
with a plurality of individuals in relation to a smaller population have a higher chanse to “stuck“ in a
number of individuals for the same number of local optimum, but through the generations iterates
generations. For random generating a first much faster than the larger population, which is
population, the probability of appearance a good more suitable for the complex problems, in this
individual is higher when the population are larger. case for the problem with a large number of holes.
Tomislav Šarić, Danijela Pezer, Goran Šimunović and Roberto Lujić 397
th
6 International Scientific and Expert Conference TEAM 2014
Technique, Education, Agriculture &Management
Kecskemét, November10-11, 2014
To solve the problem of minimizing tool path and to graphical representation one of possible solutions.
achieve the optimal solution for the proposed From Figure 11 it is evident that the value of
genetic algorithm, it was enough 100 generations fitness function gradually decreases through the
and 100 individuals in the population. generations which is an indicator of optimization
Considering that genetic algorithm is multiple unfolding. In addition to reduce the value of the
started, which generates a new solution, some of fitness function for the best individuals, also is
the obtained results have the same distance but reduced the mean (average) value of the fitness
with another drill path. In Figure 10 is shown a function of the population.
Figure 10. Graphical display of an optimal tool path Figure 11. Fitness function depending on the
number of generations
5. Conclusion References
The paper tried to find the sequence of drilling [1] J. Abu Qudeiri, “Optimization of Operation
operation that provides the shortest path, i.e., Sequence in CNC Machine Tools Using
reduction of the total work time and efficiency Genetic Algorithm“, Journal of Advanced
increase with the assistance of genetic algorithm. Mechanical Design, Systems and
Selection of the genetic operators and parameters Manufacturing, vol.1, no.2, p. 272 – 282,
which determine behaviour of these operators is 2007.
an important for the successful algorithm work. [2] V. Bosancic, A. Golemac, T. Vojkovic, “How to
The algorithm in relatively short time finds the Help a Traveling Salesman“, Osječki
optimal solution and therefore is reliable to use. In matematički list, no.12, p.139 -149, 2012.
order to improve finding solutions, genetic [3] A. Chipperfield, “Genetic Algorithm Toolbox
algorithm is possible to combine with one of the User's Guide, version 1.2“, [Online]. Available:
methods for searching of local optimum, which http://www.pohlheim.com/Papers/tr_gatbx12/
leads to faster convergence of certain individual ChipperfieldFlemingPohlheimFonseca_tr_GA
according to their optimum, which is potentially the Tbx_v12.pdf. [Accessed: 19-Jun-2014].
global. This paper aims to reduce the total path, [4] M. Brezočnik, “Uporaba genetskega
without considering tool wear, and the problem is programiranja v inteligentnih proizvodnih
solved for drilling holes of the same diametar and sistemih“, Fakulteta za strojništvo, Maribor,
depth and the further research could expand in Slovenija, 2000.
that sense. In further research the defined problem [5] N. Mohamad, M.K.A. Ariffin, A. Ali,
could be resolved with another metaheuristic F.Mustapha, I.M. Salleh, “Development of
optimization method (e.g. Particle Swarm genetic algorithm toolboks using MATLAB in
Optimization or Ant Colony Optimization), with the cutting tool path optimization,“ Scientific
possibility of comparing the obtained solution with Research and Essays, vol.8(38), pp. 1848-
the solution achieved with CAM software. 1857, October, 2013.