0% found this document useful (0 votes)
54 views

Exploring Travelling Salesman Problem Using Genetic Algorithm IJERTV3IS20833

This document summarizes a research paper that explores using a genetic algorithm to solve the travelling salesman problem (TSP). It briefly describes the TSP, explains genetic algorithms, and outlines how the authors applied genetic algorithms to the TSP. Specifically, it discusses encoding city routes as chromosomes, initializing a population of routes, and using techniques like crossover and mutation to evolve new route populations until an optimal solution is found. The goal is to find the shortest route for a salesman to visit each city once and return to the starting city.

Uploaded by

Jogo da Velha
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
54 views

Exploring Travelling Salesman Problem Using Genetic Algorithm IJERTV3IS20833

This document summarizes a research paper that explores using a genetic algorithm to solve the travelling salesman problem (TSP). It briefly describes the TSP, explains genetic algorithms, and outlines how the authors applied genetic algorithms to the TSP. Specifically, it discusses encoding city routes as chromosomes, initializing a population of routes, and using techniques like crossover and mutation to evolve new route populations until an optimal solution is found. The goal is to find the shortest route for a salesman to visit each city once and return to the starting city.

Uploaded by

Jogo da Velha
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

International Journal of Engineering Research & Technology (IJERT)

ISSN: 2278-0181
Vol. 3 Issue 2, February - 2014

Exploring Travelling Salesman Problem using


Genetic Algorithm

Alka Singh Rajnesh Singh


M.Tech. Scholars, Dept. of Computer Science & Engg. IEC- Associate Professor, Dept. of Computer Science & Engg.
College of Engineering & Technology IEC-College of Engineering & Technology
Greater Noida, U.P., INDIA Greater Noida, U.P., INDIA

Abstract - Genetic Algorithms (GAs) is an evolutionary search The route selected in such a manner that the total distance
algorithm used to find out optimal solutions for various NP travelled is minimized and each city is visited exactly once.
problems. An effective chromosome representation, a carefully This problem is also known as NP-hard, and cannot be solved
designed crossover and mutation operators are needed in GAs to accurately in polynomial time. A lot of heuristic algorithms
achieve an efficient search. Travelling salesman problem (TSP) is
have been developed and proposed in the field of operations
a combinatorial optimization problem. It is NP complete problem
and is the most commonly studied problem in the area of research to solve this problem. When there is less number of
optimization. But the complexity of the problem goes on cities TSP is solved very easily, but as the number of cities
increasing, as the number of cities increases. The objective of this grows it becomes very hard to solve, as huge amount of
study is to solve TSP using GAs approach. In the genetic computation time is required. TSP can be used in numbers of
algorithm system begins from a matrix of the calculated distance fields very effectively such as military and traffic. Genetic
RT

between the cities to be visited by the travelling salesman and algorithm is another approach to solve TSP because of its
randomly chosen city sequence as the initial population. Then new flexibility and robustness. Some distinctive applications of TSP
generations are formed repetitively until the suitable path is comprise vehicle routing, computer wiring, cutting wallpaper
IJE

reached. Genetic algorithms use techniques inspired by


and job sequencing etc.
evolutionary biology such as inheritance, mutation, selection, and
crossover.
2. GENETIC ALGORITHM
Keywords--Genetic Algorithm, TSP, Selection, Crossover, Mutation,
Enhanced Edge Recombination. Genetic algorithm is pioneered by John Holland in the 1970’s
but it got popular in the late 1980’s. Genetic Algorithms are
1. INTRODUCTION search and optimization techniques based on Darwin’s
Principle of Natural Selection. Darwin’s principle of Natural
Travelling salesman problem (TSP) is the most familiar Selection can stated as “select the best and discard the rest”.
combinatorial optimization problem. TSP is a permutation For example assume a population of animals of a particular
problem with the aim of searching the path of the shortest species in a jungle. Some animals in the population are stronger
length (or the minimum cost). TSP can be represented as an than the others and these characteristics help them to survive
undirected weighted graph, such that cities are the vertices, better in that environment as compared to the others. Suppose,
paths are the edges, and a path’s distance is the edge’s length in the natural resources like water and food are limited in the
the graph. It is a minimization problem starting and finishing at jungle. So, these animals have to compete with each another for
a specified vertex after having visited each other vertex exactly the resources. Finally, only the strongest or fittest individuals
once. TSP is used to find out the route for a salesman who will survive and the rest will finish. GAs is used to solve a
begins from a home location, visits a given set of cities and variety of problems that are not simple to solve using other
returns to the original location.

IJERTV3IS20833 www.ijert.org 2032


International Journal of Engineering Research & Technology (IJERT)
ISSN: 2278-0181
Vol. 3 Issue 2, February - 2014

3.1 Encoding
We have considered six Indian cities such as- Delhi, Jaipur,
Hyderabad, Pune, Haridwar and Surat and assign a number to
each. Thus a path would be represented as a sequence of
integers from 1 to 6. This is an example of Permutation
Encoding as the position of the elements determines the fitness
of the solution. The distances between different cities are
represented as distance matrix .The distance matrix of the
problem is given in table 1. The distance-matrix is symmetric;
therefore, the part above the main diagonal contains all
necessary information. The distance between the cities is
measured to be symmetric that is if the salesman travels from
city 1 to city 6 than the distance is same if he travels from city
6 to city 1. Due to this half of the matrix is empty. The first row
and column denotes the city.

Table 1.Distance matrix of 6 cities

city 1 2 3 4 5 6
1 0 261 1499 1417 203 1170
2 0 1454 1207 939 922
3 0 541 1679 890
4 0 1806 362
5 0 1552
6 0
*distance in km
RT

Here the initial population consists of six chromosome, where


each chromosome represent the sequence through which cities
IJE

have to be traversed and each gene represent the number


Figure1. Flowchart of applied Gas assigned to a city.

Chromosome 1 1 4 3 2 5 6
The basic steps involved in genetic algorithm are-Evolution, Chromosome 2 1 4 2 6 5 3
Crossover and Mutation. Genetic algorithms implement
optimization strategies by simulating evolution of species Chromosome 3 3 6 1 4 2 5
through natural selection. GA commences with various
problem solution which are encoded into population. For Chromosome 4 6 3 1 5 2 4
evaluating the fitness of each individual a fitness function is
applied, through the process of selection a new generation is Chromosome 5 5 2 6 1 3 4
created, after that crossover and mutation is applied on the
created new generation. After the termination of genetic Chromosome 6 2 6 3 1 5 4
algorithm, an optimal solution is obtained. If the termination
condition is not satisfied then with new population algorithm
continues. The flowchart for applied GA is described in fig.1
3.2 Fitness Function
3. IMPLEMENTATION OF TSP USING GENETIC The main motive of fitness function is to choose if a
ALGORITHM chromosome is good. The criteria in the travelling salesman
problem for good chromosome are its length. The fitness
To apply genetic algorithm for the TSP, the encoding solution function will be the total cost of the tour represented by each
is represented by chromosome. The chromosome’s length is chromosome. This can be calculated as the sum of the distances
equal to number of nodes in the problem. Here we have traversed in each travel segment. Lesser the sum, fitter is the
explained the working of the GAs on a problem of 6 cities. solution.

IJERTV3IS20833 www.ijert.org 2033


International Journal of Engineering Research & Technology (IJERT)
ISSN: 2278-0181
Vol. 3 Issue 2, February - 2014

3.3 Selection Enhanced Edge Recombination Algorithm


Selection is used to pick the chromosome whose fitness value
is less. Here we have used the tournament selection. As the - Randomly choose the initial city from one of the two
name reflects tournaments are played between two solutions parents as a current city.
and the superior solution is selected and placed in the mating - Remove all the occurrence of the current city from the
pool. Two other solutions are chosen again and another slot in edge table and add the current city in the edge list.
the mating pool is filled up with the better solution as shown in - Select the cities in the edge-table which has the fewest
fig. 2 entries in its own edge-list. The city with fewest entries
now becomes the current city. Preference is given in case a
negative integer is present.
- If any tie occurs, it is broken randomly.

3.5 Mutation
Mutation is useful to generate a new generation. The mutation
induces a change in the solution, to maintain the diversity in the
population and to prevent premature conversion. In this paper
we have mutate the string by randomly selecting any two cities
and interchanging their positions in the solution, thus giving
Figure2. Selection Operator rise to a new tour as shown in fig. 4.
3.4 Crossover
Single point crossover method randomly selects a crossover
point in the string and swaps the substrings. But in TSP single
crossover method is not used, as it may produce some invalid
offspring. For solving TSP we have used the Enhanced Edge
RT
Recombination operator. This operator is different from other
genetic sequencing operators as it emphasizes adjacency
information rather than the order or position of items in the
IJE

sequence. Edge-Recombination Operator algorithm involves


constructing an Edge Table first. The Edge Table is an
adjacency table that lists links into and out of a city found in
the two parent sequences. If an item is already exists in the Figure4. Interchange Mutation
edge table and we are inserting it again, it shows that the
particular element of a sequence must be a common edge and is 3.6 Termination and Result
represented by inverting its sign.Fig.3 shows the edge table of
After the number of operators, such as selection, crossover and
two selected parents.
mutation have been applied to the problem, the best tour will be
obtained and the process will be terminated. The tour between
the six cities with minimum distance is 3968km as shown in
figure 5.

Figure3. Edge table of two parents

IJERTV3IS20833 www.ijert.org 2034


International Journal of Engineering Research & Technology (IJERT)
ISSN: 2278-0181
Vol. 3 Issue 2, February - 2014

REFERENCES

[1] Chetan Chudasama, S. M. Shah and Mahesh Panchal, “Comparison of


Parents Selection Methods of Genetic Algorithm for TSP”, International
Conference on Computer Communication and Networks (CSI-
COMNET), 2011.

[2] Dwivedi, TarunaChauhan,SanuSaxena and PrincieAgrawal, “Travelling


Salesman Problem using Genetic Algorithm”, International Journal of
Computer Applications(IJCA), 2012, pp. 25-30.

[3] Naveen kumar, Karambir and Rajiv Kumar, “A Genetic Algorithm


Approach To Study Travelling Salesman Problem”, Journal of Global
Research in Computer Science, 2012, Vol. 3, No. (3).

[4] Adewole Philip, AkinwaleAdioTaofiki and OtunbanowoKehinde, “A


Genetic Algorithm for Solving Travelling Salesman Problem”,
International Journal of Advanced Computer Science and Applications,
2011, Vol. (2), No. (1).

Figure5. Minimum Distance between 6 cities [5] Ivan Brezina Jr.,ZuzanaCickova, “Solving the Travelling Salesman
Problem using the Ant colony Optimization”, Management Information
4. CONCLUSION Systems, 2011, Vol. (6), No. (4).

[6] ButhainahFahran, Al-Dulaimi, and Hamza A. Ali, “Enhanced Traveling


Genetic Algorithms employ optimization strategies based on Salesman Problem Solving by Genetic Algorithm Technique (TSPGA)”,
simulation of the natural law of evolution. By combining the World Academy of Science Engineering and Technology, 2008, Vol.
(14).
knowledge of GAs for solving TSP is an optimistic approach.
Depending on the manner the problem is encoded and which [7] Naef Taher Al Rahedi and Jalal Atoum, Solving TSP problem using New
RT
crossover and mutation methods are used, genetic algorithm Operator in Genet ic Algorithms, American Journal of Applied Sciences
find fine solutions for the travelling salesman problem. 6(8):1586- 1590, 2009.
Through this paper our objective is to give a very effective [8] H. Braun, “ On Solving Travelling Salesman P roblem by Genet ic
process for solving TSP by using the genetic algorithm. In this Algorithm”, in P arallel P roblem-Solving from Nature, Lecture Notes in
IJE

paper we have solved the symmetric TSP but in future we Computer Science 496, H.P. Schwefel and R. Manner Eds, Springer-
would like to solve asymmetric TSP as well. Genetic algorithm Verlag, app. 129-133.
is applicable in various artificial intelligence approaches as [9] R. Poli and W. B. Langdon. “Genetic Programming with One-point
well as different fundamental approaches like object-oriented Crossover and Point Mutation”. Technical Report CSRP-97-13,
application and robotics etc. University of Birmingham, School of Computer Science, Birmingham,
B15 2TT, UK, 15 Apr. 1997.

[10] Alka Singh Bhagel and Ritesh Rastogi, “Effective Approaches for
5. ACKNOWLEDGEMENT Solving Large Travelling Salesman Problems with Small Populations”,
International Journal of Advances in Engineering Research (IJAER),
We would like to thanks all the people who directly or 2011, Vol. (1), Issue (1).
indirectly helped us and we would also extend my sincere
thanks to our Head of the Department, Computer Science and
Engineering.

IJERTV3IS20833 www.ijert.org 2035

You might also like