You are on page 1of 4

IJSRD - International Journal for Scientific Research & Development| Vol.

3, Issue 08, 2015 | ISSN (online): 2321-0613

The Solutions of Travelling Salesman Problem using Ant Colony and

Improved Particle Swarm Optimization Techniques
Pratibha Singh1 Dr. K.L. Bansal2
Research Scholar 2Professor
Department of Computer Science
Himachal Pradesh University Shimla, India
AbstractIn this paper we consider two widely used Swarm
Intelligence (SI) inspired heuristic approaches Ant Colony
Optimization and Improved Particle Swarm Optimization to
solve classical optimization problem called Travelling
Salesman Problem (TSP) that cannot be solved
conventionally because it is NP hard problem. If one tries to
solve TSP using conventional approach it will take years to
find optimal solution. Therefore, Heuristic algorithm is the
feasible solution to such problem. Interest of researchers has
been attracted by Ant Colony Optimization (ACO) and
Improved Particle Swarm Optimization (PSO) algorithms
because of their simple, effective and efficient nature in
solving real world optimization problems. The comparative
analyses based on Performance have been done by using
ACO and Improved PSO respectively in solving TSP in this
paper. The comparative results are shown and it is devised
that Improved PSO is better approach to solve the traveling
salesman problem.
Key words: Particle Swarm Optimization, Swarm
Intelligence, Ant Colony Optimization
A. Swarm Intelligence
Swarm intelligence (SI) is based on the collective behavior
of decentralized and self-organized systems in
computational intelligence [9]. Swarm Intelligence consists
of a population which simulates the animals behavior in the
real world. There are several swarm intelligence
optimization algorithms, as bee colony, ant colony, particle
swarm optimization algorithm, genetic algorithms,
differential evolution, fish-warm algorithm, etc. SI is the
property of a system where Coherent functional global
patterns emerge because of the collective behaviors of
agents interacting locally with their environment. The basis
for unguided problem solving is provided by Social
interactions. [1]
B. Solving the Travelling Salesman Problem (TSP)
One of the best known NP-hard problems is the Travelling
Salesman Problem, which means that to solve it in
polynomial time there is no exact algorithm. To obtain
optimal solution the minimal expected time is exponential.
For this reason, we use heuristics to help us to obtain an
optimal solution. With more or less success many
algorithms were applied to solve TSP. Travelling salesman
problem is most studied optimization problem and it has
been most favorable among the researchers [5]. Almost
every new approach is first tested on TSP for solving
Optimization problems. Various metaheuristic approaches
like Genetic Algorithm (GA), Simulated Annealing (SA),
Ant Colony Optimization (ACO), particle Swarm
Optimization (PSO), Firefly Algorithm (FA) have been
proposed by researchers to solve these kinds of problems

[12]. In this paper well discuss ACO and PSO approaches

for solving TSP.
A. Ant Colony Optimization
The food foraging behavior of real ants is the inspiring
source of ACO. Ants initially explore the area surrounding
their nest when searching for food in a random manner. As
soon as an ant finds a food source, they evaluate the quality
and quantity of the food and bring some of it back to the
nest. Ants deposit a chemical pheromone trail on the ground
during their return trip. The quantity of pheromone
deposited depends on the quantity as well as quality of the
food; guide other ants to the food source. The main idea
behind these interactions or communication through the
environment is termed stigmergy. This feature makes swarm
intelligence very attractive for optimization, network
routing, robotics, etc. To the original ant algorithm a number
of extensions are proposed. Main features of this model are
the use of a constructive greedy heuristic, positive feedback
and distributed computation. The Pheromone trails are
updated in two ways in the Ant colony optimization
algorithm which differentiates it from the classical ant
system. Firstly, when ants construct a tour they change the
amount of pheromone locally by a local updating rule on the
visited edges. Secondly, A global updating rule is applied on
the edges to modify the pheromone level that belong to the
best ant tour found so far after all the ants have built their
individual tours, the Behavior of ants colony is mimicked
by the ACO algorithm while gathering food. Every ant starts
from the nest and walks towards food till intersection is
reached, where it has to decide which path to select. Choice
is random in the beginning, but the majority of ants will be
moving along the optimal path because of the colonys
collective intelligence after some time. Every ant, as he
moves, chemical called pheromone is deposited thus
marking the route taken. As time passes Pheromone trail
evaporates. Hence, a shorter path will have more pheromone
because it will get less time to evaporate before it is
deposited again. Hence shorter routes will be selected with
higher pheromone as every ant chooses paths that have more
pheromone. [8]
B. Particle Swarm Optimization (PSO)
Small birds fly in coordination and show strong
synchronization in the way they turn, flight initiation, and
how they land without any clear leader. Certain rules are
followed for their movement. To develop a particle swarm
optimization (PSO) concept simulation of a bird swarm was
used by Kennedy & Eberhart in 1995. Procedures of
Searching by PSO can be described as follows:
1) Every particle evaluates the maximize function at
each point it visits in space.

All rights reserved by


The Solutions of Travelling Salesman Problem using Ant Colony and Improved Particle Swarm Optimization Techniques
(IJSRD/Vol. 3/Issue 08/2015/137)


Every particle remembers the best value and its coordinates found so far (pbest).
3) The global best position (gbest) is known to every
particle that is found by one of the flock fellow.
4) Using the pbest and gbest co-ordinates every particle
calculates its new velocity and position.
The position of a particle is affected by the best
position visited by the particle i.e. its own experience and
the best particles position in its neighborhood which means
the experience of neighboring particles. The best position in
the neighborhood is denoted as the global best particle.
Therefore, the resulting algorithm is referred as the gbest
PSO at times when entire swarm is particles neighborhood.
In general the algorithm is stated as the pbest PSO while
smaller neighborhoods are used. Using fitness function that
varies depending on the problem of optimization the
performance of each particle is measured. Each Particle in
the swarm is represented by the following features:
Current position of the particle
Current velocity of the particle
The particle swarm optimization is one of the
evolutionary optimization techniques that conducts searches
uses a population of particles. By moving through the
problem space every particle has an updating position vector
and updating velocity vector [4]. Boundary conditions are
used in PSO in order to restrict particles to search within the
solution space of interest during optimization procedure.
Hence we used the constrained PSO that includes the
information about the objective function and constraint
violation. This information facilitated communications
among swarm in the population space and assisted in
selecting the leading particle .This algorithm is based on
identifying and excluding the infeasible region of search
space before and during the search i.e. it keeps check on the
boundary conditions. PSO is started with a group of feasible
solutions and to check whether new explored solutions
satisfy all the constraints a feasibility function is used.

For loop ends.

Select the particle with the gbest( best fitness value) .
For (every particle)
In the particles neighborhood find the particle with the best
Calculation of particle velocity according to the velocity
Apply the velocity constraints
According to the position equation; update particle position
Apply the position constraints
End For loop.
While (max iterations or min error criteria is not attained)
end PSO procedure.
The Simulation environment used for experimentation is
MATLAB. Both ACO and PSO are implemented to solve
conventional Travelling Salesman Problem to find out
optimal path to generate minimum cost for the problem by
visiting every city exactly once.
Figure 1, 2, 3 shows simulation results for ACO. It
demonstrates following: a) coordinates of 10 cities b)
Average tour distance Vs. Iterations c) Optimal path and
Minimum cost (9,4,6,8,1,10,7,5,2,3 and 60.9622).

Fig. 1: Coordinates of cities


A. Pseudo Code for ACO
Begin ACO procedure
Create pheromone trails and other parameters
while(criteria for termination not met)
construct solutions
update pheromone Trails
After process, results and output
End procedure of ACO
B. Pseudo Code for Improved PSO:
Begin procedure PSO
For (every particle)
Initialize particle
End of For loop
For (every particle)
Compute fitness value
If the fitness value is more then the best fitness value
(pBest) of past .
Then current fitness value is set as the new pBest.

Fig. 2: Average of Tour Distance vs. Number of Iterations

Fig. 3: Optimal Path and Minimum Cost

All rights reserved by


The Solutions of Travelling Salesman Problem using Ant Colony and Improved Particle Swarm Optimization Techniques
(IJSRD/Vol. 3/Issue 08/2015/137)

Figure 4, 5, 6 shows simulation results for PSO. It

demonstrates following: a) coordinates of 10 cities b)
Standard deviation Vs. Iterations c) Optimal path and
Minimum cost(7,10,3,8,6,2,9,4,1,5 and 58.5192)

Fig. 4 Coordinates of cities


This paper presents a comparative assessment of most
extensively used optimization algorithm techniques namely
ACO and Improved PSO Optimization. The comparative
results are shown and it is formulated that Improved PSO is
better approach to solve the traveling salesman problem
when it comes to generating optimal path to find the
minimum cost. The ACO and PSO can be analyzed for
future enhancement so that new research can be
concentrated to generate better solution by reducing the
limitations and improving the effectiveness of these
algorithms. More possibilities for determining the best target
through ACO can be developed and a plan to provide PSO
with fitness sharing aiming to examine whether this helps in
improving performance. Further work will be focused on:
finding patterns in the evolved structures and hence this will
help us design PSO algorithms that use larger swarms,
developing better PSO algorithms for optimization and
evolving PSO algorithm for other difficult problems.
Another idea to be discovered is variable velocities in future
researches. These techniques have immense potential and
scope of applicability. For finding suitability of these
techniques to certain applications; they need to be further
explored. Also, there is a necessity to combine two or more
techniques so that they nullify their respective limitations
and complement each other. The idea that these kinds of
techniques could be combined to give a better technique so
as to give better results for more complex TSPs and other
optimization problems has to be tested.

Fig. 5 Standard Deviation vs. Iterations

Fig. 6: Optimal Path and Minimum Cost

Simulation results for both ACO and Improved PSO are
generated by implementing both the algorithms in
MATLAB Simulation tool. Figure 1, 2, 3 shows Simulation
results for ACO whereas; Figure 4, 5, 6 shows Simulation
results for Improved PSO. From Figure 1, 2, 3 and Figure 4,
5, 6 it can be seen that minimum cost for ACO is 60.9622
and minimum cost for PSO is 58.5192 therefore it can be
said that Improved PSO is better than ACO because it gives
optimal path to generate minimum cost in comparison to the

[1] E. Bonabeau, M. Dorigo, and G. Theraulaz., Swarm

intelligence: from natural to Artificial intelligence,
Oxford University Press, 1999Retrieved: 10 August
ssed July 12, 2015).
_algorithms(accessed July 15, 2015).
tion(accessed July 15, 2015).
blem(accessed July 19, 2015).
[6] M. Dorigo and G. Di Caro, The ant colony
optimization meta-heuristic.
[7] Dorigo,M.& Gamberdella, L. M. (n.d.), Ant colonies
for the traveling salesman problem.
[8] Dorigo, M., & Stutzle, T. (2004), Ant Colony
Optimization,. Prentice-Hall.
[9] V.Selvi and Dr.R.Umarani, Comparative Analysis of
Ant Colony and Particle Swarm Optimization
Techniques, International Journal of Computer
Applications (0975 8887) Volume 5 No.4, August
[10] Shweta Singhal, Shivangi Goyal, Shubhra Goyal and
Divya Bhatt, A Comparative Study of a Class of
Nature Inspired Algorithms,ISSN 0973-7529 ISBN
[11] B.Booba and T.V Gopal, Comparision of Ant
Colony Optimization and Particle Swarm Optimization

All rights reserved by


The Solutions of Travelling Salesman Problem using Ant Colony and Improved Particle Swarm Optimization Techniques
(IJSRD/Vol. 3/Issue 08/2015/137)

in grid scheduling,Asian Journal of information

technology 13(9): 561 565,2014.
[12] Sharad N. Kumbharana, Prof. Gopal M. Pandey, A
Comparative Study of ACO, GA and SA for Solving
Travelling Salesman Problem,International Journal of
Societal Applications of Computer Science Vol 2 Issue
2 February 2013 ISSN 2319 8443.
[13] Hifza Afaq and Sanjay Saini, On the Solutions to the
Travelling Salesman Problem using Nature Inspired
Computing Techniques,IJCSI International Journal of
Computer Science Issues, Vol. 8, Issue 4, No 2, July
[14] Neha Goyal and Pradeep Mittal, Comparative
Analysis of Genetic Algorithm, Particle Swarm
Optimization and Ant Colony Optimization for TSP,
Artificial Intelligent Systems and Machine Learning,
Vol 4, No 4 (2012).
[15] Mehmet Cunkus and M.Yasin,A Comparative Study
On Particle Swarm Optimization And Genetic
Algorithms For Traveling Salesman Problems,
Journal Cybernetics Ans Systems Vol. 40 Issue
6,August 2009.
[16] Ivan Brezina Jr. Zuzana ikov, Solving the
Travelling Salesman Problem Using the Ant Colony
Optimization, Management Information Systems,
Vol. 6 (2011), No. 4, pp. 010-01.
[17] Mona Borisagar and Mahesh Pancha, Experimental
Comparison of GA and PSO methods for Solving
Travelling Salesman Problem, IJSRD - International
Journal for Scientific Research & Development| Vol. 2,
Issue 10, 2014.
[18] Xuesong Yan, Can Zhang, Wenjing Luo, Wei Li, Wei
Chen and Hanmin Liu, Solve Traveling Salesman
Problem Using Particle Swarm Optimization
Algorithm,IJCSI International Journal of Computer
Science Issues, Vol. 9, Issue 6, No 2, November 2012.
[19] Elizabeth F. G. Goldbarg, Marco C. Goldbarg and
Givanaldo R. de Souza, Particle Swarm Optimization
Algorithm for the Traveling Salesman Problem, SBN
978-953-7619-10-7, pp.202, September 2008
[20] Walid Elloumi, Nesrine Baklouti, Ajith Abraham yz
and Adel M. Alimi, Hybridization of Fuzzy PSO and
Fuzzy ACO Applied to TSP.
[21] M. Tuba, R. Jovanovic, Improved ACO Algorithm
with Pheromone Correction Strategy for the Traveling
Salesman Problem, INT J COMPUT COMMUN,
ISSN 1841-9836 8(3):477-485, June, 2013.
[22] X.H. Shi, Y.C. Lianga, H.P. Leeb, C. Lub, Q.X.
Wanga, Particle swarm optimization-based algorithms
for TSP and generalized TSP, Information Processing
Letters 103 (2007) 169176.
[23] Majid Yousefikhoshbakht, Farzad Didehvar, Farhad
Rahmati, Modification of the Ant Colony
Optimization for Solving the Multiple Traveling
Salesman Problem, Romanian Journal Of Information
Science And Technology Volume 16, Number 1, 2013,
[24] A. Kaveh and S. Talataharib, A Hybrid Particle
Swarm And Ant Colony Optimization for design of
Truss Structures, Asian Journal Of Civil Engineering
(Building And Housing) Vol. 9, No. 4 (2008) Pages

[25] .Xianmin Wei, Parameters Analysis for Basic Ant

Colony Optimization Algorithm in TSP, International
Journal of u-and e-Service, Science and Technology
Vol.7, No.4 (2014), pp.159-170.
[26] Walid Elloumia, Haikal El Abeda, Ajith Abrahama,
Adel M. Alimi W. Elloumi, A comparative study of
the improvement of performance using a PSO
modified by ACO applied to TSP, Applied Soft
Computing 25 (2014) 234241.
[27] Olfa sammoud, Sebestein Sorlin, Christine Solnon and
Khaled Ghedira, A comparative study of ant colony
optimization and reactive search for graph matching
problems, EvoCOP'06 Proceedings of the 6th
European conference on Evolutionary Computation in
Combinatorial Optimization.

All rights reserved by