Published on

Published in: Technology
  • Be the first to comment

  • Be the first to like this

No Downloads
Total Views
On Slideshare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide


  1. 1. ISSN: 2278 – 1323 International Journal of Advanced Research in Computer Engineering & Technology Volume 1, Issue 2, April 2012 GENETIC OPERATORS IN SOLVING TRAVELLING SALESMAN PROBLM Nisha Ahuja1, Manisha Dawra 2 out thr best possible x* elements from a set X according to a set of criteria F={f1,f2,f3,f4,…}.These Abstract— In this paper we will see that genetic criteria is expressed in a form of mathematicalalgorithm applied to a optimization problem uses function which is known as Objective function.genetic operator to solve the problem.In this Objective Function: An objectivefunction[3][7] ispaper introduction of modified form of genetic written mathematically as f : X → Y with Y which isoperator is done and then we tried to solve the a subset of R is a mathematical function which isproblem.We have taken TSP problem and applied subject to optimization. The domain X of F is calledthe operator to TSP problem .We have also tried the problem space and codomain and of F must be ato understand the actual meaning of optimization subset of real numbersboth in theoretical and mathematical sense. This Global Optimisation actually consist of all thepaper presents the strategy which is used to find techniques that can be used to find the best elementthe nearly optimized solution to these type of x* from X and also which satisfies the criteriaproblems. It is the order crossover operator (OX) defined by f.which was proposed by Davis, which builds up the As we are discussing about optimiality and thereoffspring by choosing a subsequence of one parent is lot of mathematics involved in it,we mustand preserving the relative order of chromosomes understood in terms of mathematics only that what isof the other parent. optimality.Fist we will discuss optimality in terms of Single Objective function and then we will explore the multiobjective function.Keywords:GeneticAlgorithm,Optimisation,Travel SINGLE OBJECTIVE FUNCTION: Whenever weling salesman problem, Order Crossover,PMX talk about Single objective function[1,7],we actually I. INTRODUCTION talk about optimizing a problem as per the single criteria defined.Now that single criteria can be either One of the most fundamental principle in world is to “Maximum” or “Minimum” depending on ourlook for optimal solution.This principle applies problem.For exampleeverywhere ranging from physics where atoms try toform bonds to minimize the energy of their electrons Example1: Let us take the problem of recruiting theto water where it acquires crystal structure during staff in a organization.freezing to have energy optimal structure Optimal Solution:The optimal solution to thisThe same principle goes with biology given by problem will be the recruitment of the staff should beDarwin which states “Survival of the fittest” is only in such a way that maximizes the profit ofpossible.As long as human kind exist we will always organizationgo on for perfection.We want to have maximumhappiness with least effort.In our economy,we want Example2:Let us take the problem of assigning jobsto have maximum profit,,maximum sales with least to a manufacturing firm in a organizationcost.So optimization is a concept which extends into Optimal Solution:The optimal solution to thisour daily life. problem will be to assign jobs in such a way that As the optimization has a significance in our daily minimizes the time taken for completionlives and anything which has importance has amathematical background dealing with it and so is But in global optimization problems it is conventionthe case with it too.Optimisation is defined as finding to define optimization as minimization,and if the 43 All Rights Reserved © 2012 IJARCET
  2. 2. ISSN: 2278 – 1323 International Journal of Advanced Research in Computer Engineering & Technology Volume 1, Issue 2, April 2012constraint is maximization then we go for 2. Maximize the profitminimization of its negation(-f) ,so that the 3. Maximize product qualitymaximization problem is converted into minimization 4. Minimize the impact of production onproblem.We need to discuss some more terms to environmentmake our concept of optimality more clearer The mathematical foundation of MultiObjectiveLocal Maxima [7]: A local maxima is defined as xi€X of a fn f R an input element with f(ˆx) >=f(x) function was laid down by VilFredo Pareto.Paretofor all x neighbouring xi optimality become an important notion in Economy,Social Sciences,game theory andLocal Minima [7]: A local maxima is defined as xi Engineering.The notion of optimality is strongly€X of a fn f R an input element with f(ˆx) based on the concept of domination.<=f(x) for all x neighbouring xi DOMINATION: The domination[7] is defined asGlobal Maxima [7]: A global maximum xi €x of a the process where one elment is better than other.Forfunction f → R is an input element with f(ˆx) ≥ f(x) example: Let us say we have two elementsfor all xi €X x1&x2.We say that x1 dominates(preferred to) x2 ifGlobal Minima [7]: A global maximum xi €x of a x1 is better than x2 in one objective function and notfunction f → R is an input element with f(ˆx) ≤f(x) worse in all other objective functions.for all xi €X In solving these optimization problems,we wil be using genetic algorithm.A genetic algorithm is a subclass of evolutionary algorithm, which is first proposed for single objective function.But now multiobjective function problems can also be solved by it.The lifecycle of genetic algothm is as under: Figure 1MULTIOBJECTIVE FUNCTION: Optimizationtechniques are not meant just for finding the maximaor minima of a function,the constraint can be multipleSo whenever we will talk about multiple objectivefunction[1][2][3][7],we actually talk aboutoptimizing a problem satisfying multiple criteriasdefined.Now the multiple criteria can be many..Forexample:Example1:Let us take the problem of improving theperformance of factory.The multiple criterias whichneed to be fulfilled are: Figure 2 1. Minimize the time between the incoming order and shipment of the product 44 All Rights Reserved © 2012 IJARCET
  3. 3. ISSN: 2278 – 1323 International Journal of Advanced Research in Computer Engineering & Technology Volume 1, Issue 2, April 2012Since they are applied first to single objectivefunction the objective function is known as fitnessfunction. The above lifecycle can be explained as:Genetic algorithms are iterative loops of optimisation : afitness function measures the adaptation of a solution to the problem needs. Every solution is represented by a set of numbers that we will call a set of "parameters". These parameters are called "genes". Figure 3There exist a "function" that uses the parameters. The"function" is called the phenotype, and the problemconsist in finding phenotypes [4]adapted to theproblem.Phenotypes [3][4]are filtered by the fitness functionthat reproduces the most adapted phenotypes. Themore the adpatation the more the reproduction. Figure 4Phenotypes are modified through 2 ways : The genetic algorithm make use of genetic operators - Mutation : it consists in moving one parameter to solve optimization problem. A genetic operator isthrough a random modification, an operator used in genetic algorithms to maintain genetic diversity, known as Mutation (genetic algorithm) and to combine existing solutions into others, Crossover (genetic algorithm). The main difference between them is that the mutation operators operate on one chromosome, that is, they are unary, while the crossover operators are binary operators. Genetic variation is a necessity for the process of evolution. Genetic operators used in genetic algorithms are analogous to those in the naturalFigure 5 world: survival of the fittest.The different type of genetic operators are as under:-Crossover: Crossover is a genetic operator used to Many crossover techniques exist for organisms whichhave variations in the programming of a use different data structures to store themselves.chromosome or chromosomes. It is analogous toreproduction and biological crossover, upon which One-point crossovergenetic algorithms are based[8] Cross over is aprocess of having taken more than one parents andproducing a child solution from them A single crossover point[8] on both parents organism strings is selected. All data beyond that point in either organism string is swapped between the two parent 45 All Rights Reserved © 2012 IJARCET
  4. 4. ISSN: 2278 – 1323 International Journal of Advanced Research in Computer Engineering & Technology Volume 1, Issue 2, April 2012organisms. The resulting organisms are the children: vertices so that each vertex is visited exactly once. This problem is known to be NP-hard[1], and cannot be solved exactly in polynomial time. Many algorithms have been developed in the field of operations research (OR) to solve this problem. . In the sections we briefly introduce the operation Research problem-solving approaches to the TSP. Figure 6 III. Exact Algorithm The algorithms is used to find the shortest possible tour covering all the vertices and finding out the tourTwo-point crossover and that too of minimum length. The genetic algorithm when applied tries to find many solutionsTwo-point crossover[8] as the name suggest has and consider anly the optimal one,so they are lttleincorporated two points to be selected on the parent more expensive as compared to OR approach. Hereorganism strings. Everything between the two points dij is the distance between vertices i and j and theis swapped between the parent organisms, giving riseto two child organisms: xijs are the decision variables: xij is set to 1 when arc (i,j) is included in the tour, and 0 otherwise. (xij) X denotes the set of subtour-breaking constraints Min ij dijxij Subject to: j xij = 1 , i=1,..,N Figure 7 i xij = 1 , j=1,..,N (xij) X"Cut and splice"[8] xij = 0 or 1 ,Another crossover variant, the "cut and splice"[8]approach, give rise to change in the length of the But as we are seing here the feasible solution ischildren strings. The reason for this difference is that restricted to those consisting of a single tour. Eveneach parent string has a separate choice of crossover the formulation of sub tour-breaking constraints canpoint. be done in many different ways Without the sub tour breaking constraints, the TSP reduces to an assignment problem (AP), and a solution like the one shown in would then be feasible. Branch and bound algorithms which are mostly found in algorithmic theory are commonly used to find the optimal solution to the TSP[2], Figure 8 IV. METHOD USEDII. PROBLEM DESCRIPTION A. Order Crossover (OX) Davis (85), Oliver et al.The Traveling Salesman Problem (TSP) is a classic The way the problem is represented here is incombinational optimization problem.The problem is thesimple two dimension matrix form and here it isstated as : Find the shortest possible tour through N 46 All Rights Reserved © 2012 IJARCET
  5. 5. ISSN: 2278 – 1323 International Journal of Advanced Research in Computer Engineering & Technology Volume 1, Issue 2, April 2012termed as Path matrix which is considered and parent 1 : 1 2 5 6 4 3 8 7drawn under topic Figures. The crossover operatorwhich we are going to discuss is different from the parent 2 : 1 4 2 3 6 5 7 8Davis’s crossover as it allows two cut points to be _________________________________________randomly chosen on the parent chromosomes. Inorder to create an offspring, the string between two Step 1 detect shortest edge from second parentcut points in the first parent is first copied to theoffspring. e.g 3,6 from second parentand the remaining blanks are filled by considering the Step 2 select second crossover point randomly afterposition of the chromosomes in the second parent, first for e.g 5starting after the second cut point .The above saidwill get clearer by one of the example shown crossover points are before 3 and after 5 in secondbelow.Here the substring 564 in parent 1 is first chromoshomecopied to the offspring (step 1). Then, the remaining Step 3 apply order crossoverpositions are filled one by one after the second cutpoint, by considering the corresponding sequence of offspringcities in parent 2, namely 57814236 (step 2). Hence,city 5 is first considered to occupy position 6, but it is Step 3.1 : - - - 3 6 5 - -discarded because it is already included in theoffspring. City 7 is the next city to be considered, and Step 3.2 : 1 2 5 3 6 5 8 7it is inserted at position 6. Then, city 8 is inserted at Step3.3: 1 2 4 3 6 5 8 7position 7, city 1 is inserted at position 8, city 4 isdiscarded, city 2 is inserted at position 1, city 3 is Fig Modified order crossoverinserted at position 2, and city 6 is discarded. VI. RESULTSparent 1 : 1 2 | 5 6 4 | 3 8 7 A. Tables, Figures and Equationsparent 2 : 1 4 | 2 3 6 | 5 7 8_________________________________________offspring(step 1) : - - 5 6 4 - - -(step 2) : 2 3 5 6 4 7 8 1Figure 9.Clearly, Order CrossOver tries to preserve therelative ordering of the cities in parent 2V. Modified Better order crossoverIn order to improve the efficiency of order crossoveroperator ,a change is added to it which suggest todetect the minimum edge and hence a minimum edgeis detected from the second chromosome and byselecting the first node of this edge as first crossoverpoint and by selecting 2nd crossover point after firstby randomly choosing Fig 10- Path matrix 47 All Rights Reserved © 2012 IJARCET
  6. 6. ISSN: 2278 – 1323 International Journal of Advanced Research in Computer Engineering & Technology Volume 1, Issue 2, April 2012parent 1 : 1 2 5 6 4 3 8 7 OX- Order Crossoverparent 2 : 1 4 2 3 6 5 7 8 AP- Assignment Problem_________________________________________ OR- Operation ReserachStep 1 find minimum edge from second parent using PMX- Partially mapped Crossoveradjacency matrix C. EQUATIONSfor e.g 3,6 F(x) = g(F(x)) (1)then crossover point is shown in fig Where f is an objective function , g transforms the1 4 2 |3 6 5 7 8 value of the objective function to a non-negative number and F is relative fitness.Step 2 decide second crossover point randomly afterfirst The most fit individuals and the fitness of the others is determined by the following rules:for e.g • INC = 2.0 ×(MAX -1.0) / n1 4 2 |3 6 5 |7 8 • LOW = INC / 2.0 (2)Step 3 apply crossover • MIN = 2.0 - MAX(step 1) 1 2 5 3 6 5 8 7 The fitness of individuals in the population may be(step 2) : 1 2 4 3 6 5 8 7 calculated directly as,Figure 2- Knowledge augmented PMX f(xi) = 2- MAX + 2 (MAX -1) xi – 1 n- 1 (3)Table 1- Result of OX and My OX Probability of each chromosomes selection is given by: NSample ox, No. Shortest Myox, Shortest Ps(i) = f(i) / f(j)no. of path No of Path J =1 (3) iteration iteration Ps(i) and f(i) are the probability of selection and1 1 86 1 87 fitness value2 1 348 3 3393 1 1727 1 2225 VII. CONCLUSION4 1 605 2 610 Having seen the results of experiments which5 2 2432 2 2388 compares the proposed method with the conventional approach which also suggests that the number of children generated by the traditional crossover operators is limited because of calculationB. ABBREVIATIONS AND ACRONYMS costs factor involved.So,with the help of traditional methods generation of better individuals withTSP- Travelling Salesman Problem limited number of children take place .So a proposal for a new crossover opearor take place.In this methodGA- Genetic Algorithm first, the children generated by the first parents are evaluated for their fitness. Then, some number of top 48 All Rights Reserved © 2012 IJARCET
  7. 7. ISSN: 2278 – 1323 International Journal of Advanced Research in Computer Engineering & Technology Volume 1, Issue 2, April 2012children with quite a good fitness rate set beforehandare selected for the position of the next parents.TSP Name:Nisha Ahujais optimization problem which is used to find Qualification:M.tech Scholar from AFSET,Maharishiminimum path for salesperson. The Actual use of tsp Dayanand University,Presently working withis routing in network. The finding of minimum path NIET,Greater Noidawill helps to reduce the overall time of the Salesman Research Work: 3 National Papers Publishedand thus help to improve the overall performance. 1.Title:E-mail Authentication SystemThe work proposed here intends to test the 2.Title: Passive Attacks in Computer Networkperformance of different Crossover used in GA and 3.Title: Genetic Operators for Optimisationcompare the performance for each of them and Problemscompare to others. This paper presents an Name:Manisha Dawrainvestigation on different crossover techniques used Qualification:Working as a Sr.Lecturer with AFSETin GA . Since there are various other methods also ,Maharishi Dayanand Universitywhich are traditionally used to obtain the optimumdistance for TSP. This work aims at establishing thesuperiority of Genetic Algorithms in achievingoptimizing solutions for TSP. One of the objectivesof this research work is to find a way to come to thesolution fast.But stinll as can be found f rom theexperimental results the conclusion can be drawn thatdifferent methods might out perform the others indifferent situations.VIII. REFERENCES[1]:https://www.rci.rutgers.edu/~coit/RESS_200 6_MOGA.pdf[2]http://people.cs.uu.nl/dejong/publications/spa.pdf[3] http://is.csse.muroran - it.ac.jp/~sin/Paper/file/hiroyasu99.ps.pdf [4] http://en.wikipedia.org/wiki/Genotype-phenotype_distinction[5] http://www.nexyad.net/HTML/e-book-Tutorial-Genetic-Algorithm.html[6] http://www.kddresearch.org/Courses/Spring-2007/CIS830/Handouts/P8.pdf[7] http://www.it-weise.de/projects/book.pdf[8]http://en.wikipedia.org/wiki/Crossover_(genetic_algorithm 49 All Rights Reserved © 2012 IJARCET