2017 2nd International Conference on Computer, Network Security and Communication Engineering (CNSCE 2017) ISBN: 978-1-60595-439-4
A Randomness Ant Colony Algorithm for Solving TSP
Yue-cheng NIU
*and Deng-yin ZHANG
Nanjing University of Posts and Telecommunications, Nanjing 210003, China *Corresponding author
Keywords:Travelling salesman problem, Ant colony optimization, Path selection probability update rule, Pheromone update rule.
Abstract. The Travelling Salesman Problem (TSP) has received much attention because of its
practical applications in several problems. One of the commonly used algorithms to solve TSP is Ant Colony Optimization (ACO). In this paper, a randomness ant colony algorithm is proposed to solve the defects of ACO by optimizing the path selection probability update rule and pheromone update rule. As the improved algorithm is applied to solve the classical TSP problem, the results show that it is more effective and converge faster.
Introduction
Traveling Salesman Problem (TSP) is one of the most typical problems in path optimization, which is a classical NP-hard problem. The description of the traveling salesman problem is that the traveling salesman traverses N cities and returns to the original city under the conditions of each city is visited only once, aimed to find the shortest path.
At present, the algorithms for traveling salesman problem are genetic algorithm (GAS), particle swarm optimization (PSO) and ant colony optimization (ACO) [1, 2]. Ant colony optimization is a kind of intelligent algorithm which model is the ant colony searching for food. Distributed feature of Ant colony algorithm makes the algorithm reliable and the global search ability relatively strong. Also it can be effectively combined with other algorithms. The shortcomings of Ant colony algorithm is that the search time is long and easy to fall into the local optimal solution at the early stage.
Related Work
For the hybrid ant colony system (ACS), many researchers made outstanding contribution. Ding [3] puts forward hybrid algorithm based on ant algorithm and genetic algorithm which combines the positive feedback of the ant colony algorithm with the global convergence of the genetic algorithm to obtain a better performance. The research by Katagiri [4] is an example for hybrid max-min ant system. Junqiang Wu [5] proposed a hybrid ACO with beam search for solving TSP. Mahi [6] proposed a new algorithm in which ACO was hybridized with PSO and 3-opt for solving small instances.
In the algorithm of path selection principle, Yuan [7] proposed a multi thread ant colony algorithm which is by virtue of the differences in individual organisms in nature. The algorithm is used to solve the TSP problem and the result shows that the algorithm has good global search ability. Wu [8] proposed an ant colony algorithm based on natural selection strategy which uses the randomness of competitive factors to enhance the probability of the local optimal solution.
In the setting of algorithm parameters, Zhou [9] researched the convergence of the basic ant colony algorithm in theory and proved that the different parameter settings of the ant colony algorithm will have different convergence time.
Improved Algorithm
The improved algorithm proposed in this paper mainly includes the path selection probability updating rule and the pheromone optimization updating rule.
Path Selection Probability Update Rule
Ant colony algorithm has the characteristics of falling into the local optimal solution. When the numbers of city is small, the situation of ant colony algorithm being prone to defects of hysteresis in the local optimal solution is not obvious. But when the city number increases gradually, the ant colony algorithm out of local optimal solution of the opportunity is lower which is easier to fall into local optimal solution.
Aiming at the above condition, competitive factor and competitive factor rating threshold are put forward. The competitive factor is a parameter to characterize the probability that ants select the next path node while the competitive factor rating threshold is the threshold value of the probability of selecting the next node. Firstly, each ant chooses the probability of the next hop node according to the predetermined rule, and then chooses the probability of each ant. Each ant will be assigned a competitive factor when the competition factor is greater than the competition factor rated threshold which indicated that the probability of ants select the next hop node needs to be corrected. The equation of the next hop is
( )
( ) ( ) ( ) ( )
( ) ( ) ( ) ( )
{ & }
p { & }
0 k k ij ij k k is is
s allow ed
k ij ij
ij
k k
is is
s allow ed
t t
if R F R F R j a llo w ed
t t
t t
t ran d if R F R F R j allow ed
t t else α β α β α β α β τ η τ η τ η τ η ∈ ∈ ≤ ∈
= > ∈
∑
∑
i (1)Where τij denotes the amount of pheromone on between city i and city j;ηij indicates the inverse
distance city i and city j;
α
and β represent the pheromone concentration and the weight of self-inspired variable; allowedk is a set of cities which ant k has not visited. rand is a randomparameter which has been distributed evenly in
[ ]
0,1 ;RFk is a random parameter in[ ]
0,1 whichmakes ant k choose next city more randomness;RFR is a constant threshold parameter in
[ ]
0,1which determines the probability.
By the parameters of RFk and RFR, the degree of information that ants rely on the feedback of
other ants to choose the next city is reduced, which effectively avoids the interference of the local optimal solution. The algorithm’s lack of low convergence rate is made up by the more randomness choose.
Pheromone Update Rule
The improvement of pheromone update rule is that not all ants update the pheromone at the end of each search, but only update the pheromone of the ant which searches to the shortest path.
The improved pheromone update rule is as follows:
( ) (
1) (
1)
ij t ij t ij
τ = −ρ τ − + ∆ρ τ
(2)
1
if ( , )i j Lc
τ
∈
( )
[
, max]
ij t nin
τ ∈ τ τ
(4)
[
]
[
]
[
]
m a x m a x m a x
0 .1 0 , 0 .3 5
0 .2 0 .3 5 , 0 .7
0 .3 0 .7 ,
c c
c c
c c
N N
N N
N N
ρ
−
−
−
∈
= ∈
∈
(5)
Where Lc is the distance of the best route; pheromone coefficient ρ reflects the retention of
pheromone on the path.
In the basic ant colony algorithm, the pheromone coefficient ρ is a constant coefficient, but this will lead to the problem that the optimization ability of the algorithm is insufficient in the initial stage, and the optimization result is obtained. At the same time, the local optimization leads to the stagnation of the algorithm, so the pheromone coefficient is associated with the search number in the improved ant colony algorithm, and the pheromone volatilization coefficient also changes with the increase of the search times. As equation (5) shown, with the change of the pheromone volatile coefficient is helpful to strengthen the search ability of the algorithm in the early stage, which can also avoid the algorithm stagnate in the middle and late period.
Equation (2) makes the pheromone, which is retained after the last search, is related to the pheromone evaporation coefficient. This greatly enhanced the search ability of the algorithm, avoiding the algorithm due to local optimal solution and lead to stagnation.
Equation (4) is mainly to prevent the performance of the pheromone on a path is too large or too small. By this method, it can effectively control the pheromone and avoid the pheromone to exceed the threshold value, so as to improve the effectiveness of the algorithm.
Experimental Results and Discussion
In order to verify the effectiveness and convergence of randomness ant colony algorithm (RACA), the proposed algorithm is applied to solve the TSP problem in comparison with the ant colony optimization (ACO) and the hybrid algorithm based on genetic algorithm and ant algorithm (HAGA). The test environment is personal computers: Core i5-4210M 2.60GHz, 4GB RAM, Win7, Matlab.R2010b. Each algorithm runs ten times in Oliver30 and eil51. The parameters of the algorithm simulation are as follows:
Table 1. Common parameters of three algorithms.
Parameter name Parameter values
pheromone heuristic factor
1 2 Maximum number of iterations
Enhancement factor Number of ant
[image:3.612.80.540.504.706.2]100 100 20 Table 2. Different parameters of each algorithm.
Algorithm Parameter name Parameter values
ACO pheromone coefficient 0.2
HAGA pheromone coefficient 0.2
Crossover probability Mutation probability
0.75 0.05
RACA pheromone coefficient
Random factor rating
Effectiveness of Algorithm
It is not obvious that the ACO is easy to lag in the local optimal solution when the number of cities is small. But with number of cities is increasing, the chance of ACO to jump out of the local optimal solution is lower, and it is easier to fall into the local optimal solution.
HAGA introduced genetic factors to reduce the dependence of ant colony algorithm on path pheromone in iterative process. That is to say, the ants are more likely to determine the next-hop city from their own experience and search range. However, the crossover factor in HAGA will intersect some poor solutions in the iterative process of ant colony algorithm, which means the longest two sub-paths in the current optimal solution path are crossed to optimize the optimal solution. This may cause HAGA to miss the global optimal solution.
It can be seen from Table 3 and Table 4 that RACA is better than ACO and HAGA in all kinds of city scale. In the calculation of probability path of cities, the changes of randomness and probability of the selection operation can not only improve the randomness of the algorithm, but also avoid the blind search algorithm into a state of disorder, which makes the probability of obtaining the optimal solution increase.
Table 3. Path results of each algorithm in Oliver 30.
Algorithm Best Worst Average Optimal solution Average error
ACO 427.17 440.96 438.20 423.74 3.4
HAGA 423.74 434.47 429.11 423.74 1.3
[image:4.612.73.539.347.422.2]RACA 423.74 426.37 424.26 423.74 0.12
Table 4. Path results of each algorithm in eil51.
Algorithm Best Worst Average Optimal solution Average error
ACO 461.90 481.52 484.94 426.00 13.8
HAGA 449.79 465.65 457.72 426.00 7.4
RACA 426.00 434.87 427.75 426.00 0.41
Convergence of Algorithm
The comparison of the convergence times of the algorithms in Table 5 and Table 6 shows that the convergence time of RACA is lower than ACO and HAGA.
The ACO path search is a long time. That is to say, in the early iterations in pheromone induced ant colony search, ant mainly rely on the random detection path distance to determine the next path node, which causes the algorithm to find the optimal solution of the time bound than the other two algorithms. In the crossover operation of HAGA, to a certain extent, improved the ACO algorithm at the cost of the algorithm's execution time increasing. With the city scale greater, the time consumption of the cross operation will be more and more.
[image:4.612.78.535.620.666.2]At the initial stage of RACA in accordance with the path length of the spread of pheromone, to help the ant colony to reduce the random search time. In the iteration, the pheromone concentration on the optimal path is further strengthened, which reduces the convergence time of the algorithm.
Table 5. Time results of each algorithm in Oliver30.
Algorithm Best Worst Average
ACO 4.24 4.57 4.34
HAGA 3.45 3.61 3.56
[image:4.612.77.537.687.737.2]RACA 2.89 2.97 2.91
Table 6. Time results of each algorithm in eil51.
Algorithm Best Worst Average
Conclusion and Future Work
In this paper, a randomness ant colony algorithm is proposed, which improves the self - searching ability of the algorithm by optimizing the path selection probability update rule and pheromone update rule. The simulation results show that the improved algorithm can improve the accuracy of the search results, and at the same time, it can improve the convergence speed to a certain extent. Intelligent tourism route planning is one of the typical applications of TSP and we propose an intelligent tourism route planning method based on the improved algorithm.
Acknowledgement
The work was partially supported by the National Natural Science Foundation of China [61571241], Industry-university-research Prospective joint project of Jiangsu Province [BY2014014], and Major projects of Jiangsu Province university natural science research [15KJA510002].
References
[1] Dorigo M, Maniezzo V, Colorni A. Ant system: optimization by a colony of cooperating agents[J]. IEEE Transactions on Systems Man & Cybernetics Part B Cybernetics A Publication of the IEEE Systems Man & Cybernetics Society, 1996, 26(1):29-41.
[2] Dorigo M, Gambardella L M. Ant colony system: a cooperative learning approach to the traveling salesman problem[J]. IEEE Transactions on Evolutionary Computation, 1997, 1(1):53-66.
[3] Li D J, Qiang C Z, Zhi Y Z. On the Combination of Genetic Algorithm and Ant Algorithm [J]. Journal of Computer Research and Development, 2003, 9: 10.
[4] Katagiri H, Hayashida T, Nishizaki I, et al. A hybrid algorithm based on tabu search and ant colony optimization for k -minimum spanning tree problems[C]// International Conference on Modeling Decisions for Artificial Intelligence. Springer-Verlag, 2009:5681-5686.
[5] Junqiang W, Aijia O. A hybrid algorithm of ACO and delete-cross method for TSP[C]//Industrial Control and Electronics Engineering (ICICEE), 2012 International Conference on. IEEE, 2012: 1694-1696.
[6] Mahi M, Baykan Ö K, Kodaz H. A new hybrid method based on particle swarm optimization, ant colony optimization and 3-opt algorithms for traveling salesman problem[J]. Applied Soft Computing, 2015, 30: 484-490.
[7]Yuan L, Hu JS. multi-thread ant colony algorithm and its application in the shortest path [J]. Logistics Technology, 2005(2):57-59.
[8] Wu H, Chen X Q, Mao Q H, et al. Improved ant colony algorithm based on natural selection strategy for solving TSP problem[J]. Journal of China Institute of Communications, 2013, 34(4): 165-170.