1 s2.0 S2211381911002232 Main
1 s2.0 S2211381911002232 Main
1 s2.0 S2211381911002232 Main
com
Systems
Engineering
Procedia
Systems Engineering Procedia 00 (2011) 000–000
Systems Engineering Procedia 4 (2012) 226 – 235
www.elsevier.com/locate/procedia
Abstract
The paper presents three intelligent algorithms, namely, basic genetic algorithm, Hopfield neural network and basic
ant colony algorithm to solve the TSP problem. Then different algorithms are compared in the perspectives of time
complexity, space complexity, the advantages and disadvantages of the calculation results, and difficulty level of
realization. We use the application of paired comparison matrix to make comprehensive evaluation, and then give the
value of comprehensive evaluation in engineering.
©
© 2011
2011 Published byElsevier
Published by ElsevierLtd.
Ltd.Selection
Selection and
and peer-review
peer-review under
under responsibility
responsibility of Desheng
of Desheng Dash Dash
Wu Wu.
Open access under CC BY-NC-ND license.
Keywords: basic genetic algorithm, Hopfield neural network, ant colony optimization, paired comparison matrix, TSP
1. Introduction
The travelling salesman problem (TSP) is a problem in combinatorial optimization studied in operations
research and theoretical computer science and in engineering. Given a list of cities and their pair wise
distances, the task is to find a shortest possible tour that visits each city exactly once.This is an NP-hard
problem, when a large number of nodes of G, if the use exhaustive search, the time complexity is O (n!) ,
2 2
if use the search of dynamic programming, the time complexity is O ( n 2 ) , combinatorial explosion
will occur in the both search methods. Therefore, the majority of domestic and foreign scholars began to
study intelligence algorithms for TSP, since the basic genetic algorithm appears, they began to examine
the use of genetic algorithm on solve TSP problems until present and proposed many improvements.
Reference [1] presents a genetic algorithm based on common path, reference [2] proposed a new genetic
algorithm through using multiple-search method. All these improved genetic algorithms are promising
approach for TSP problem. Hopfield network was proposed in 1970s, and in 1985, Hopfield proposed to
use CHNN for solving TSP problems, but Hopfield network prone to ineffective solutions and local
solutions, so many scholars have been studying how to improve the algorithm, reference [3] analyzed the
effectiveness of solving TSP with Hopfield, reference [4] through optimizing the Hopfield network and
path of the initial steps to improve the Hopfield network to solve TSP and received good results. Ant
colony algorithm which is effectiveness proposed a new computational intelligence algorithm for solving
TSP problems recently. Because of its use of pheromone heuristic function, can greatly reduce the search
2211-3819 © 2011 Published by Elsevier Ltd. Selection and peer-review under responsibility of Desheng Dash Wu.
Open access under CC BY-NC-ND license. doi:10.1016/j.sepro.2011.11.070
Wang Hui / Systems Engineering Procedia 4 (2012) 226 – 235 227
space, so compared to other algorithms it have better time performance, but precisely because of this, ant
colony algorithm is easy to fall into local optimal solution, reference [5] by dynamically adjusting the
pheromone volatility to present a dynamic ant colony algorithm and get a more satisfactory results. All of
these three algorithms for solving TSP problems have advantages and disadvantages. In this paper, these
three kinds of algorithms are compared in time complexity, space complexity, the advantages and
disadvantages of the calculation results, and difficulty level of realization, etc. We apply paired
comparison matrix to make comprehensive evaluation, and then give the value of comprehensive
evaluation.
This paper uses a common framework of genetic algorithm to solve TSP. this section gives the
general framework of genetic algorithm, then given the steps of genetic operators’ algorithm.
(2) Select two crossover points are denoted i and j randomly, generally i < j .
(3) We set a new individual T, make T = Y, then remove the cities which belong to X i to X j .The
first bit to the i − 1 of Z m is same as the first bit to the i − 1 of Tm . The i bit to the j of Z m is same as the i bit
to the j bit of Tm . then send the i bit and behind of the i bit of Tm to Z.then get the individual Z.
(4)Similarly, we can get another individual W. For example, let X = (1,2,3,4,5,6,7,8), Y =
(3,4,5,1,7,8,2,6), i = 3, j = 5 , then Z = (1,7,3,4,5,6,2,8), W = (2,3,1,7,8,4,5,6)
The core of Hopfield Network for TSP is to determine the network energy function and derive the
equation of state of the network. We are running the network to reach a steady state, the steady-state is a
solution for the problem.
du xi
= − A ∑ vxi − 1 − B ∑ v yi − 1 − D ∑ d xy v y ,i+1 (2)
dt i Y y
1 u
v xi = 1 + tanh xi (3)
2 λ
Initial ant colony algorithm is graph-based algorithms, is proposed by Gutjahr WJ in 2000. The steps
of algorithm are as follows:
STEP0: The TSP for n cities. N={1,2,…,n},A={(i,j), i,j∈ N},The matrix for distance between
cities (dij)n×n, We set value of each arc(i,j) is τij(0)=1/|A in TSP graph. We suppose m ants are working,
all the ants are starting from the same city i0. The best solution current is w = (1,2, ..., n).
STEP1 (outer loop) if accordance with stopping rule of algorithm, stop the calculation and output
the best solution which we calculate. Otherwise, the ant s starts from i0.L (s) represents the collection of
cities which ant walked, and at first L (s) is the empty.
STEP2 (inner loop) We calculated according to the order 1≤s≤m of ants. When the ants in the city i,
if L(s ) = N or {l | (i, l ) ∈ A, l ∉ L( s )} = Φ ,complete the calculation of s-ants. Otherwise, if L(s ) ≠ N and
T = {l | (i, l ) ∈ A, l ∉ L(s )} , − {i0 ≠ Φ} ,it will according with the probability pij =
τ ij (k − 1)
, j ∈T
to reach j ,
∑ τ ij (k − 1)
leΤ
ρ
τ ij (k ) = (1 − ρ k −1 )τ ij (k − 1) + k −1 (i, j ) ∈ W
W (4)
τ (k ) = (1 − ρ )τ (k − 1) (i, j ) ∈ W
ij k −1 ij
We will get new τ ij (k ), k = k + 1 , then repeat steps STEP 1.
230 Wang Hui / Systems Engineering Procedia 4 (2012) 226 – 235
The time complexities of selection operator, crossover operator and mutation operator in genetic
algorithm are O(n n), O(n P n 2 ), O(n P n 2 ) . While n0 is the initial size of population. For under normal
0 0 c 0 m
circumstances pc > p m , so O(n P n 2 ) > O(n P n 2 ) > O(n n) . T is the number of outer iterations, so the
0 c 0 m 0
time complexity of outer loop is O(Tn n 2 ) . The time complexity of Initial population generation
0
algorithm and the fitness function calculation are O(n n) < O(Tn n 2 ) . So the time complexity of genetic
0 0
algorithm is O(Tn n 2 ) .
0
The time complexity of the inner loop in Hopfield network is O(T n 2 ) . While T1 is the number of
1
inner loop iterations. T is the number of outer iterations. So the time complexity of Hopfield network
is O(TT n 2 ) .
1
The time complexity of inner loop in ant colony algorithm is O(mn 2 ) , while m is the number of ants,
T is the number of outer iterations. So the time complexity of ant colony algorithm is O(Tmn 2 ) .
2
Genetic algorithms, Hopfield networks and ant colony algorithm's time complexity are O(Tn0 n ) ,
O(TT1n 2 ) and O(Tn0 n 2 ) > O(TT1n 2 ) >
O(Tmn 2 ) , obviously, O(Tmn 2 ) .That is, the time complexity of
the genetic algorithm the highest, the lowest time complexity is ant colony algorithm.
The distance matrixes of three algorithms must be saved and will takes n2 of the space. Genetic
algorithm need to save the population, so it needs n0 n of the space, under normal circumstances n0 > n , so
genetic algorithm space complexity is O(n0 n) . Hopfield network needs to save v, u . v, u are small as n 2
.so the space complexity of Hopfield network is O(n 2 ) . Pheromone matrix and the parameter β of ant
colony algorithm are only need n 2 of the space, so the space complexity of ant colony algorithm is O(n 2 ) .
So the time complexity of genetic algorithm, Hopfield networks and ant colony algorithm
Wang Hui / Systems Engineering Procedia 4 (2012) 226 – 235 231
are O(n0 n) , O(n 2 ) and O(n 2 ) ,and O(n0 n) > O(n 2 ) = O(n 2 ) That is, the space complexity of the genetic
algorithm the largest, Hopfield networks and ant colony algorithm have the same space complexity.
This paper uses TSPLB eil51 to compare the results of the three algorithms. Genetic algorithm uses
the following parameters: initial population size n0= 5000, crossover probability pc = 0.3, mutation
probability p m = 0.01, the maximum number of iterations T = 2000. Value of global optimal is 1007.9.
The optimal path length of genetic algorithm's generations is shown in Fig 1
Genetic algorithm can ensure the population's evolution by selecting the operator, crossover
operator and mutation operator, while selection operator to ensure the best individual parent to survive in
a larger probability, crossover probability to use a certain desired cross-breeding to produces a more
excellent offspring, mutation operator to a certain mutation probability to the progeny gene mutation
expect better offspring.Because of crossover and mutation operators, genetic algorithm can escape local
optimum and make it possible to find the global optimum. The result of Hopfield network and ant colony
algorithms is good or bad depends on parameter, the value of parameter directly affect the convergence of
the algorithm and results of the pros and cons. And these two algorithms are easy to fall into local
optimum.
In this paper, we use the code lines of algorithm to reflect the amount of algorithm implementation.
The amount of code lines of three algorithms implemented in MATLAB are 186, 93 and 96. From the
lines of codes, the most difficult is genetic algorithm.
4. Comprehensive Evaluations
Based on the analysis in Section 3, three algorithms are compared in time complexity, space
complexity, the advantages and disadvantages of the calculation results, and difficulty level of realization,
etc. We use the application of paired comparison matrix to make comprehensive evaluation, and then give
the value of comprehensive evaluation.
The value of aij in paired comparison matrix from reference [8].
The time complexity, space complexity, the advantages and disadvantages of the calculation results
and difficulty level of realization of three algorithms can use comparison to obtain comparison matrix A
as follows.
1 1
1 5 7
3 3
1 1 1
1 3
5 7 7
3 7 1 3 9
1
3 7 1 7
3
1 1 1 1
1
7 3 9 7
The maximum eigenvalue of the matrix is λmax =5.3573. CI is extent of inconsistency of a pair-wise
comparison matrix A (n> 1), the formula is:
λmax ( A) − n (5)
CI =
n −1
234 Wang Hui / Systems Engineering Procedia 4 (2012) 226 – 235
CI 0.0893
CR = = = 0.0798 < 0.1 (6)
RI 1.12
This shows that A is not a consistent matrix, but A is according with consistency, and the
inconsistency of A is acceptable. The maximum eigenvector after normalized of matrix A is
good or bad. First, we should find the calculation results of different algorithm. Second, we calculate
local partial and overall partial of calculation results. Third, we find it`s time complexity and space
complexity. Last, we ensure the difficulty level of realization this algorithm. For find comprehensive
evaluation on these three algorithms, we analyzer the results base on section 3 can construct the
comparison matrix B1-5 from time complexity, space complexity, the advantages and disadvantages of the
calculation results, and difficulty level of realization. The value of comparison matrix B1-5 as follow:
1 1 1
1 1 1 1 3 1 1
3 5 1 5 1 3 3 1
1 5 5 1 1 1 3 3
B1 = 3 1 , B2 = 5 1 1 , B3 = 1 , B4 = 1 1 , B5 = 3 1 1
3 3 7 3
5 3 1
5
1 1 5 7 1 1 3
1 1
1 1
3
After test, matrix B1-5 all is right. The weight vector of B1-5 are:
They can be considered the point at the time complexity, space complexity, the advantages and
disadvantages of the calculation results, and difficulty level of realization of each algorithm. Finally,
calculate the total score of each algorithm.
P (GA) = 0.17 × 0.10 + 0.05 × 0.09 + 0.46 × 0.19 + 0.29 × 0.60 + 0.03 × 0.14 = 0.29
P( HNN ) = 0.17 × 0.29 + 0.05 × 0.45 + 0.46 × 0.08 + 0.29 × 0.20 + 0.03 × 0.42 = 0.18
P( ANN ) = 0.17 × 0.63 + 0.05 × 0.45 + 0.46 × 0.73 + 0.29 × 0.20 + 0.03 × 0.42 = 0.53
Wang Hui / Systems Engineering Procedia 4 (2012) 226 – 235 235
Genetic algorithms, Hopfield networks and ant colony algorithm consolidated total scores were 0.29,
0.18, 0.53, that the best algorithm is ant colony algorithm, second is genetic algorithm, third is Hopfield
network.
5. Conclusion
This paper presents three intelligent algorithms, namely, basic genetic algorithm, Hopfield neural
network and basic ant colony algorithm, solving of the TSP problem in engineering. Then these different
kinds of algorithms are compared in time complexity, space complexity, the advantages and
disadvantages of the calculation results, and difficulty level of realization, etc. We use the engineering
application of paired comparison matrix to make comprehensive evaluation, and then give the value of
comprehensive evaluation. This method of comprehensive evaluation is relatively simple and useful.
References
[1]Zhang Jingqang, Cao Yunfu. ( 2004), A Genetic Algorithm Based on Common Path for TSP [J], Journal of Computer
Engineering and Applications, 40[20]:58~61.
[2]Chen Jing, Yang Xiaofan, Zeng Zhi. ( 2006), A Genetic Algorithm Base on Gene Bank and Multiple-Searching Method for
TSP [J],Computer Science,33(8):195~201
[3]Zhao Jianming, Yao Nianmin. (2009), Study on the Efficiency of solving TSP Based on Hopfield Network [j], Science
Technology and Engineering ,9(2):437-439
[4]Jiang Guojun. (2001), A modified algorithm of Hopfield network to solve TSP, [j]. Journal o f Zhejiang University (Science
Edition), 28(2):160~163
[5]Li Yong, Duan Zhengcheng.(2003), A New Ant System for TSPs [J], Journal of Computer Engineering and Applications,
39(17):103~106
[6]Wang Zhengying, Shi Bingxin.(2001) , Solving QoS Multicast Routing Problem Based on Heuristic Genetic Algorithm [J],
Chinese Journal of computer, 24(1):55~61
[7]http://elib.zib.de/pub/Packages/mp-testdata/tsp/tsplib/tsplib.html
[8]Gan Yingai etc,2005, Tsinghua University Press ,Operations Research.