Free Essay

Generic Algorithim for Travelling Salesman

In:

Submitted By gkimutai
Words 3446
Pages 14
Introduction
TSP (Travelling salesman problem) is an optimization problem that it is difficult to solve using classical methods. Different Genetic Algorithm (GA) have been right to solve the TSP each with advantages and disadvantages (Davis, 2005)
In this research paper, I highlight a new algorithm by merging different genetic Algorithm results to the better solution for TSP. In amalgam algorithm, appropriateness of algorithm and traveled distance for TSP has been considered. Results obtained suggest that it does not quickly establish in the local optimum and enjoys a good speed for an inclusive answer (Fogel, 2010).
New methods such as GAs, refrigeration algorithms, Artificial Neural Networks, and ACO (Ant Colony Optimization) to solve TSP problem, in recent past have been suggested. Both ACO and GAs is centered on repetitive (Goldenberg, 2005)
ACO system was unfilled for the first time by Dorigoat al. to solve TSP. In ACO algorithms, people work together to find the solution. In collective intelligence algorithms, it uses the real life of creatures without putting in consideration the complex mechanisms in run their day to day life in all aspects as best as possible.
GA is an iterative procedure that contains a population of individuals or chromosomes. Coding of randomly or heuristic by a string of symbols as a gene in possible solution is done. All possible solution in this search space is examined. When search space is large, GAs usually are used. People can select an operation, integration or mutation the problem to obtain a higher fitness values find the optimum solution to it.
Literature review
In the past, optimization methods that are have been used to solve the TSP in past. One of the groups of optimization methods is evolutionary algorithms. Huang suggests that Evolutionary algorithms are useful for solving the TSP (Beyer, 2012)
Different GAs according to the type of operation, mutation, and integration and used combinations produce the different solution to of each other.
GA suggested by Fogelhas shown an excellent presentation in solving TSP. The method of exclusion as the combination operator and the reverse mutation operator are used in this algorithm. In this algorithm, the distance of the route is well-thought-out as suitability. In John Holland based on Darwin's theory of evolution was the first to propose Gas (Davis, 2005). GA is one of the recursive accidental processes that does not automatically guarantee finding the solution; however; with respect to the possible solutions it rises probability endeavored in the method of proposed solution in this paper. The Condition for discontinuing repetitions of this algorithm can be verified by some fix set amounts, for example, the generation’s number or the suitability level of acceptance. GA method is a resourceful approach that has gathered the optimistic characteristics of the random and ultra-creativity methods. But according to the characteristics of the problem some changes, in the standard GA is proposed (Beyer, 2012)
He suggested that, the creation of initial population as randomly or heuristically is the first step in GA. The population member are called a chromosome that proposes a solution to the problem Chromosomes evolves in repeated periods called a generation. The population in each period changes and creates a new generation that is more real in reaching the finest answer. In order to maintain the optimum solution of each generation and avoid the destruction of them, exclusive techniques can be used (Ambati B.K, Ambati, J. &Mokhtar, 2011)
There are two ways of doing Evolution of chromosomes. In the first stage, random few chromosomes are selected from the existing population and crossed together, to give rise new elements. Mutation is the second stage, where some chromosomes are randomly selected in each replication, and one of the chromosome’s genes is nominated and according to distinct mechanism changes. Thus, new chromosomes are acquired. In the final step of the initial population of lengthened populations of the members elected and shall be seen as a new generation. Roulette wheel selection is one method of selecting the stage. High level and professional mathematical model are required in GA (Beyer, 2012)
In overall, the concepts of evolutionary and population improvement are used in these algorithms. GA have proved appropriate for solving the TSP. Even though it has not found a better solution to the TSP than is already known, but many of best solutions have been initiated by some GA method also. It seems that the biggest problem with the genetic algorithms devised for the TSP is to make sure that the structure from the parent chromosomes are maintained and still end product has a legal tour in the child chromosomes (Akley, 2007)
ACO used in this research paper is an algorithm used by Doryegu in 2006 in his presentation. In the first phase of the algorithm, m ants are created by the memory that are randomly placed on a given number of nodes say n. In each node, there is an initial amount of pheromone. In my hybrid algorithm, I aim at finding minimal distance order for the salesman that is applied by the assistance of optimizing ACO. Chemical substance called pheromones left by the ants while walking remains on the floor as the Ants footprints in the short term since the chemical are volatile and are easily evaporated.
It is noted that in this algorithm Ants produces pheromones that assist them find the shortest path to their food hence surviving. Trails are least by the ant that finds the shortest route to the local of food for other ants to follow by creating a stronger pheromones trails. The strong pheromones attract more and more ants making the choose the path increasing the pheromones concentration in that shortest path to the food, and this encourages all the ants to follow the route.
My research have assumed that there are two known routes to the food source that can be chosen of different lengths. The probability of an ant select one of the path is half, hence the two have the equal probability of selection by the ant. Most pheromones are produced by the ant who has gone to shortest route and returns with the food than the rest. Thus, other ants choose this path sooner and increase the pheromone concentration on this route. Lastly, all the ants use the shortest path to food.
Proposed solution.
In my proposed solution, I have had an exceptional look at ACO due to the comparable structure to GA to come up with the new algorithm. In my hybrid algorithms, original answers of ACO among the found data from routes to the mutations are nominated by GAs. I have used GAs answers for a wide range of ants search; this provides an optimal solution to achieve the most suitable solution in each generation (Banzhaf, 2010). Therefore, the GA using efficient routes of ACO, uses the best way in search space till in a new searching point reaches the improved solutions. GA as a computational algorithm for optimization with respects to a set of answer points in every repetitive computation searches the different parts of solution successfully. In this hybrid method distinct to ACO, all the all-around solution space is examined; resulting in less possibility of convergence to the local optimum. Fig 1 below gives a summary of the proposed hybrid algorithm (Akley, 2007).

Based on ACO and GA proposed algorithm code is as follows;
i. Initialization ii. Set all ants at the starting city iii. Repeat until all cities have been visited iv.Update Pheromone
v. Terminating condition. vi. Create initial population with Shortest-Route ACO vii. Repeat (Until terminated) Calculate Fitness for each chromosome evaluate fitness, Selection, Crossover operator, Mutation operator viii. Check for termination criteria ix. Output the best individual found
x. Compare (Solution Best ACO & GA) xi. Repeat (Compare) Length Tour until best Solution (Fogel, 2010)
Chromosome Designing.

A chromosome comprising the gene information is to be used in solving the problem by GA. Classical GAs considers a binary string in the creation of a chromosome that is not appropriate for problems like this. In this classical GA method, chromosomes are denoted by a string of natural numbers that each of the numbers relates to a special parameter in the space of the problem. Table 1 shows a scenario of these chromosomes for a problem with the case of 6 cities. Table 1. Six cities chromosomes. 1 | 5 | 3 | 2 | 4 | 6 |

This type of application is encoded in finding solution of TSP. In this method the chromosome denotes the order of the cities that TSP should go through.

Creating Initial Population
After defining the coding system and pinpointing any chromosome conversion method response, the initial population of chromosomes is randomly produced or sometimes innovative methods are used speed, and quality of the algorithm is used to generate them. The individual of algorithms created according to ACO with respect to the length of the route are seen as members of the population. Individual of the initial population by the travelled routes of the ants are created so that each represents an answer to the problem. Assuming that n is the number of individual, n-1 individual of the population are produced with random permutations. For creating the last individual of the population, I use the nearest not-met neighbor method. The last individual added to the population with the highest likeness is the final answer (Akley, 2007).
Fig 3. Shows an example on creation of the initial population are for the visited cities, by assuming n = 6, then by five random permutation the first five members of the population will be as follows;[5,6,2,4,1,3] ,[4,5,6,2,3,1], [3,6,2,5,4,1], [2,4,5,1,6,3], and [2,4,3,1,5,6] are created. For the last permutation if use does not go in line with nearest neighbor method. If we assume the starting city as 1, last permutation will be [1, 5, 4, 6, 3, 2]. Then the created population is ordered in respect to created length value distance. The shorter the length of the route is, the more correctness answer will be and hence the probability of participation to give the next generation will also be more.

Fig 2: permutation of cities

New Operator Integration
Typical operations, for solving TSP are provided, which are interesting. Two numbers randomly are selected as cut-off points, then the points between the two chromosomes are switched and then both parts are initialized so the two chromosomes the reiteration does not occur. Integration operator is retaining valuable information on a tour of nearby towns. I pick two chromosomes of P1 and P2. Child chromosomes are created as following: (Gunnels, Cull & Holloway, 2014)

1. The first gene in the chromosomes of P1 and P2 is designated as the city of origin. This city is called C.
2. The two parent chromosomes are selected, and the first two genes means and j in one of the two parent chromosomes are selected. Then the similar genes are selected. In additional two parent chromosomes. The distance between P1 and P2 in C and cities that chromosomes are positions to them is calculated. Found distance from the genes of first and second chromosomes P1 and P2, if chromosome P1in is the distance that is less than or equal to P2 chromosome, then the city P1is injected in Child 1 and chromosomes P1 and P2 in the place of visited cities, become zero. But if the chromosome P1 is bigger than the chromosome P2, then the next town for visiting is designated from the chromosome P2. Cities for the next visits should be equal to the first gene of every chromosome. For this resolution, the exchange action should be done with the genes. When the number of non-zero cities of chromosomes P1 and P2 are equal to zero, then it stops. To produce Child 2 the above steps are done, with this variance that counting of the chromosomes will be from last to beginning. With this action, two new chromosomes are formed which are called the children of two parent chromosomes, for example, a TSP problem with 6 cities as been considered. Matrix of distances between cities is as follows (Table 1.): (Gunnels, Cull & Holloway, 2014)

(Gunnels, Cull & Holloway, 2014)
Fig 4. Show selection of two chromosomes with the hypothetical, the results of the proposed method to create child chromosomes.
Fig 4. Chromosome p1 and p2

Produced Children of Chromosomes P1 and P2 are shown in the Table 3
Table 2: Chromosome p1 and p2 P1 | 1 | 5 | 3 | 6 | 4 | 2 | P2 | 1 | 6 | 2 | 4 | 3 | 5 | Child1 | 1 | 5 | 3 | 4 | 2 | 6 | Child2 | 2 | 4 | 6 | 5 | 3 | 1 |

New Mutation Operator
Mutation Operator's duty is to avert from trapping in local optimum points in the algorithm. In my proposed method for applying the mutation operator, the two genes are randomly designated and exchanged. The new mutation operator contemplates the relationship between cities in the TSP and acts in this way that one city is identified randomly, and then the adjacent city to selected city is considered. The mutation operator is done on the chromosomes with the probability of P (m) (Davis, 2005)
Way of Comparison of Answers in the Proposed Solution
The hybrid algorithm is planned such that both algorithms pay to the discovery of the most optimal route in the problem by the condition to complete it. In this hybrid method, the optimal routes are specified to ACO as the initial population of GA. So that solution to ant optimization algorithm as the present population GA are given. After relocating the solution to the GA, the span of obtained routes by ACOs optimized and associate the shortest acquired route by shortest route algorithm with ACO and finally, the shortest path to the final answer is returned (Goldenberg, 2005)
Results and discussion
In this section, I have discussed the results obtained when my proposed hybrid algorithm is used to solve TSP as compared with Ants Colony Optimization (ACO) and Generic Algorithm (GA). The output shows the substantial improvement of this hybrid algorithm to GA and ants’ optimum algorithm. I have considered 100 iteration from 30cities in my algorithm. The performance of this algorithm is affected due to the fact that I have combined several parameters. In this research paper the effect of a combination of these parameters in the algorithm is analyzed. In respect to conducted tests, ACO algorithm parameters such as the amount of pheromone, pheromone evaporation, and number of ants is the percentage change of each of the above parameters that is significant in the performance of ACO. Table 3 show the parameter values for implementation of algorithms. The values according to numerous performances of the program are said to achieve near-optimal solution to improve-optimum.
Table 3: Values of parameter in my proposed Hybrid algorithm.

Parameter Name | m | α | β | Pc | Pm | Parameter value | 30 | 1 | 5 | 0.9 | 0.5 |

When the hybrid algorithm is compared with the GA and ACO for solving TSP the results of their effectiveness is shown in table 4 with five runs. From the table it is noted that the hybrid algorithm is more effective in converging to the solution.
Table 4: comparison of results when number of run is five. Algorithm | Best solution | Average solution | Worst solution | GA | 351 | 471 | 826 | ACO | 340 | 385 | 384 | Hybrid Algorithm | 340 | 382 | 369 |

From the results in Table 4 above for solutions obtained from ant’s colony optimization algorithm GA is better but when combined to produce to produce the proposed hybrid algorithm the solution is more effective.
Table 5 below show comparison when ten runs are made. It once again shows my hybrid algorithm is better than ACO and GA, this is because implementation of my hybrid algorithm produce more favorable results.

Table 5: comparison of results when number of run is ten Algorithm | Best solution | Average solution | Worst solution | GA | 349 | 464 | 826 | ACO | 385 | 340 | 368 | Hybrid Algorithm | 340 | 384 | 358 |

From table 5, the way with 10 times more running the algorithms the length of path has been more effective. Therefore, the optimal number of path length affect s the performance of the algorithm. Fig 3 below shows implementation of optimal way after ten times running for 30 cities, by a hybrid algorithm.
Fig 3: Optimal path with Hybrid algorithm after 10 times run

Combination of algorithms
Table 6 below, show analysis of the effect of the concentration of pheromone on the route used by ant denoted by parameter α on the performance of the hybrid algorithm. The parameter equals the numbers 0.1, 0.3, 0.5, 1 and 2.
Table 6: Effect of parameter α on the effectiveness of my hybrid algorithm.

Number of the cities | α =0.1 | α =0.3 | α =0.5 | α =1 | α =2 | 30 | 340 | 340 | 340 | 340 | 342 |

It is visible from above table 6 that any amounts of Parameter α affect the increases and decreases along the length of route to the best solution. The route length will increase if the parameter value α is big.

Table 8 also analyses the effect of parameter β which is the relationship between direction and pheromones on the performance of the algorithm. The parameter is made to be 1, 2, 3, 4 and 5. Number of the cities | β =1 | β =2 | β =3 | β =4 | β =5 | 30 | 618 | 441 | 381 | 355 | 340 |

It can be seen, placing the value of parameter β to 5 results to decreased trend along the way. Therefore by putting the value 5 for the parameter β is more efficient along the way.

Conclusion
GA and ACO have quick convergence; however, they cannot solve the difficult of premature convergence of local optimum alone. So to avoid this problem, a hybrid algorithm in my research paper has been used to solve these problems. Using an amalgamation of GAs and ACO the search process to discover the optimal path dramatically increases. The proposed algorithm cannot be easily placed in a local optimal solution and can be found close to the optimum. It is worth noting that the implementation of proposed algorithm, the does not have complexity.

Reference
Akley, D.H. (2007). A Connectionist Machine for Genetic Hill climbing, Kluwer Ademi Publishers. Ambati, B.K., Ambati, J. and Mokhtar, M.M. (2011). Heuristic Combinatorial Optimization by Simulated Darwinian Evolution: a Polynomial Time Algorithm for the Traveling Salesman Problem, Biological Cybernetics, 65, pp. 31-35. Banzhaf, W. (2010). The “Molecular" Traveling Salesman, Biologic al Cybernetic s, 64, pp. 7-14. 48 Beyer, H.G. (2012). Some aspects of the `Evolution Strategy' for Solving TSP-Like Optimization Problems Appearing at the Design Studies of the 0.5 TeV e + e -Linear Collider, in: R. Manner and B. Manderi k (Eds.), Parallel Problem Solving From Nature 2, North-Holland, Amsterdam, pp. 461-370. Brady, R.M. (2005). Optimization Strategies Gleaned From Biological Evolution, Nature, 317, pp. 804- 806. Bremermann, H.J., Rogson, M. and Sala, S. (2005). Sear h by Evolution, in: M. Maxeld, A. Callahan and L.J. Fogel (Eds.), Biophysics and Cybernetic Systems, Spartan Bo oks, Washington, pp. 157-167. Davis, L. (2005). Applying Adaptive Algorithms to Epistasis Domains, Pro endings of the International Joint Conference on Artificial Intelligence, pp. 162-164.
Davis, L. (Ed.) (2011). Handbook of Genetic Algorithms, Van Nostrand Reinhold, New York.
Fogel, L.J. (2012). A tumorous Automata, Ind. Res. 4, pp. 14-19.
Fogel, D.B. (2008). An Evolutionary Approach to the Traveling Salesman Problem, Biological Cybernetics, 60, pp. 139-144. Fogel, D.B. (2010). A Parallel Processing Approach to a Multiple Traveling Salesman Problem Using Evolutionary Programming, in: L. Canter (Ed.), Proceedings on the Fourth Annual Parallel Processing Symposium , Fullerton, CA, pp. 318-326.
Fogel, D.B. (2013). Applying Evolutionary Programming to Selected Traveling Salesman Problems, Cybernetics and Systems, 24, pp. 27-36. Fox, M.S. and M Mahon, M.B. (2007). Genetic Operators for Sequencing Problems, in G. Rawlings (Ed.), Foundations of Genetic Algorithms: First Workshop on the Foundations of Genetic Algorithms and Classier Systems, Morgan Kaufmann Publishers, Los Altos, CA, pp. 284-300. Gunnels J., Cull P. and Holloway J.L. (2014). Genetic Algorithms and Simulated Annealing for Gene Mapping, in Grefenstette, J.J. (Ed.) Proceedings of the First IEEE Conference on Evolutionary Computation , IEEE, Florida, pp. 385-390. 49 Goldberg, D.E. and Lingle, Jr., R. (2005). Alleles, Loiand the TSP, in Grefenstette, J.J. (Ed.) Proceedings of the First International Conference on Genetic Algorithms and Their Applications, Lawrence Erlbaum, Hillsdale, New Jersey, pp. 154-159.

Similar Documents