Exploring Travelling Salesman Problem Using Genetic Algorithm IJERTV3IS20833
Exploring Travelling Salesman Problem Using Genetic Algorithm IJERTV3IS20833
ISSN: 2278-0181
Vol. 3 Issue 2, February - 2014
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
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.
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
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.
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
REFERENCES
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).
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.