International Journal of Innovative Computing, Information and Control Volume 7, Number 1, March 2013 c ICIC International ⃝2011 ISSN 1349-4198 pp. 1–16 A METHOD FOR ANALYZING SOLUTION SPACE OF TRAVELING SALESMAN PROBLEM BASED ON COMPLEX NETWORK Weizhen Rao and Chun Jin Institute of Systems Engineering Dalian University of Technology Dalian City, Liaoning Province 116024, P. R. China raoweizhen@mail.dlut.edu.cn jinchun@dlut.edu.cn Received July 2012 Abstract. In this paper, a complex network-based method for analyzing solution space of traveling salesman problem (TSP) is proposed. The aim is to analyze what properties the complex network corresponding to a good heuristic has and understand its behavior solving TSP from the new point of view. It is found that solution space of one heuristic for TSP is a classical complex system that can be analyzed by using complex network theory. The method framework includes two parts: constructing a complex network according to a specified heuristic and computing the related indexes of the complex network. Then the solution spaces of 2-opt, Or-opt, 3-opt and Lin-Kernighan are analyzed by using the method proposed in this paper. Our findings demonstrate that the complex networks corresponding to the good heuristics for solving TSP are similar to the small-world networks. According to the conclusion, three excellent heuristics are developed and evaluated to verify the effectiveness of the method. Keywords: Solution space; Traveling salesman problem; Complex network; Heuristic; Combinatorial optimization problems 1. Introduction. The traveling salesman problem (TSP) is a classical NP-hard combinatorial optimization problem [1,2] in Operations Research’s area. The TSP has many applications, from VLSI chip fabrication [3], vehicle routing problem [4, 5], scheduling problem[6], and drilling problem [7] to X-ray crystallography [8]. In general, the heuristics are subdivided into construction heuristics and improvement heuristics [9]. Construction heuristics gradually build a tour by adding a new city or edge at each step until getting a solution, e.g., Greedy [10], Saving, The nearest neighbor and Hybrid construction heuristics[11]. The improvement heuristics start from an initial solution generated by construction heuristics, and attempt to improve the current tour iteratively by means of making some exchanges, e.g., k-opt heuristic(k ≥ 2), Lin-Kernighan heuristic [12] and Genetic algorithm [13]. Actually, the process of the improve heuristics solving TSP assemble searching a solution in solution space from a starting solution one by one. The solution space can be considered as the set of all feasible solutions. There have been some researches on solution space of combinatorial problems in last decade. Huang et al studied on the optimal solution and the solution space of newsvendor model [14]; Wang et al analyzed the solution space of job shop scheduling problem [15]; Sun researched on analyzing characteristics of scheduling problem and its solution space [16]; Yao and Johnson estimated the feasible solution space of design [17]. To our best knowledge, solution space of TSP received relatively little attention in this domain. It is found that the method capable of visualizing the solution space structure is lack in these literatures. 1 2 W.Z RAO, C. JIN However, the structure of solution space is significantly correlative with performance of the improvement heuristics [18]. The complex networks have been an important tool to analyze complex discrete systems. The success of complex networks is to a large extent a consequence of their natural suitability to represent virtually any discrete system. Nowadays, there are many applications for complex networks in various areas, such as Epidemic spreading [19], Communication [20], Economy [21], World Wide Web [22], Electric power transmission systems [23], Internet [24], Ecology [25] and Physics [26, 27], etc. To our best knowledge, however, there is shockingly little literature on analyzing solution space of TSP by using complex networks. This paper aims to analyze what properties the complex network corresponding to a good heuristic has. Then the method is able to help develop good heuristics for solving TSP. In this paper, a complex network-based model for analyzing solution space of one specified heuristic solving TSP is proposed. In the complex network, the nodes represent solutions and the edges represent the neighbor relation of two solutions. Any heuristic will correspond to a sole structure of space solution, because the heuristic can determine whether two solutions in solution space are neighbors or not. The remainder of this paper is organized as follows. Section 2 defines the TSP and presents notations used in this paper. Section 3 proposes the complex network-based method for analyzing solution space of a specified heuristic solving TSP. The experiments are reported and analyzed in Section 4. Finally, Section 5 summaries the conclusions of this paper. 2. Formulations of TSP and Notations. The TSP is that a salesman is required to visit each of n given cities once and only once, starting from any city and returning to the original starting place. The distances between any pair of cities are assumed to be known by the salesman. Which tour should he choose in order to minimize his total travel distance? The TSP is a classic routing problem in which the objective is to conduct a Hamiltonian tour with minimum total distance. Mathematically, the TSP can be stated as follows: { dij (i ̸= j) D = (dij )n×n (1) W (i = j) where D, dij and W represent distance matrix, distance of going from city i to city j and a sufficiently large weight, respectively. A permutation of integers from 1 to n (π[1], π[2], · · · , π[n]) represents a solution of TSP (n ≥ 3), Let π be a solution, and L(π) be the length of π, then L(π) = ( n−1 ∑ dπ[i]π[i+1] ) + dπ[n]π[1] (2) i=1 Let Ω = {π1 , π2 , π3 , · · · , πN } denote solution space, where πi represents a feasible solution and N is the number of all feasible solutions of a TSP with n cities. N = (n − 1)!/2 is constantly hold. Apparently, if L(π ∗ ) ≤ L(πi ), πi ∈ Ω is hold, then π ∗ is the global optimal solution. Any heuristic for solving TSP can be considered as combination of one or more than one elementary “move”. Alternatively one might allow only the exchange of subsequent cities; and this operation is called a “canonical transposition”. Lin and Kernighan suggested [12] to reverse the order of the cities in a part of the solution, and this move is called inversion, reversal, or 2-opt move. In this paper, we define the elementary “move” is 2-opt. The 2-opt is illustrated in Figure 1. Why do we choose 2-opt as “elementary move”? The main A METHOD FOR ANALYZING SOLUTION SPACE OF TSP 3 reason is that 2-opt is the element of all other heuristics. In other words, all heuristics are the combinations of many different 2-opt moves. So Lemma 2.1 constantly holds. a c b a b d c d represents edges deleted represents edges added Figure 1. 2-opt move Lemma 2.1. Any two different solutions πi and πj in solution space Ω of TSP instance with n cities, πi can be changed to πi by taking some 2-opt moves. Proof: Or-opt move is another elementary move used usually. Or-opt chooses a city and moves it to other position in solution. This means that Or-opt can arbitrarily change any city position in solution, thus it is truth that πi must be changed to πj by taking some Or-opt moves. Apparently, if we verify that Or-opt move is combination of 2-opt move, then Lemma 2.1 will be verified. Actually, Or-opt move indeed be combination of 2-opt move(s). It can be seen clearly from Figure 2. As illustrated in Figure 2, there exists two cases in Or-opt. In case 1, Or-opt is equivalent with 2-opt. In case 2, Or-opt is combinations of two 2-opt moves. The proof of Lemma 2.1 is over. a c d a c d Case 1 b u b v u v a c Case 2 a c d d Case 2 b u v b u v Figure 2. relations between Or-opt and 2-opt move Assume that ω(πi ) is the set of neighborhood πi , πi ∈ Ω. For instance, if πi can change to πj by one elementary “move”, then πi ∈ ω(πj ) and πj ∈ ω(πi ). This means that πi and πj are neighbors in solution space. If L(πi ) ≤ L(πt ), πt ∈ ω(πi ) is hold, then πi is a local optimal solution. Complex network representation: A graph G is an ordered pair G = (V, E), formed by a set V = {v1 , v2 , · · · , vN } of vertices (or nodes, or points) and a set E = {e1 , e2 , · · · , eM } of edges (or lines, or links) ek = (vi , vj ) that connect the vertices. If ek = (vi , vj ) = (vj , vi ), G is undirected graph, otherwise G is directed graph. Mathematically, G can be represented by a corresponding adjacency matrix A, which can be stated as follows. 4 W.Z RAO, C. JIN { A = (aij )N ×N aij = 1, (vi , vj ) ∈ E aij = 0, otherwise (3) It is clear that A is a symmetric matrix if G is undirected graph; otherwise A is an asymmetric matrix. A path (of length k) is a non-empty alternating sequence n1 e1 · · · ek nk+1 (ni ∈ V, 1 ≤ i ≤ k + 1) of vertices and edges in G such that ei = (ni , ni+1 ) for all i < k. 3. Proposed Method. TSP is easy to state, but hard to solve. The difficulty becomes apparent when one considers the number of all solutions in Ω. It is an astronomical figure even for a relatively small number of cities n. For a TSP instance with n cities there are N = (n − 1)!/2 feasible solutions. If n is 20, there are more than 1018 solutions. The 100city instance contains about 4.67×10155 feasible solutions (Figure 3 illustrates the trend of LgN with n). In comparison it may be noted that the number of elementary particles in the universe has been estimated to be “only” 1087 . Therefore solution space of TSP is a very complex discrete system. Furthermore, it can be exactly determined that whether any two feasible solutions in Ω are neighbors or not under a specified elementary move. 2600 2400 2200 2000 1800 LgN 1600 1400 1200 1000 800 600 400 200 0 3 100 200 300 400 500 600 700 800 900 1000 n Figure 3. LgN increasing with n Therefore, the complex network theory is comparable to analyze solution space of TSP. 3.1. The method for constructing complex network based on solution space of TSP. The solution space of TSP under specified elementary “move” can be represented by a complex network G = (V, E) in which nodes represent feasible solutions and edges represent a pair of solutions that are neighboring each other. Thus, V = {v1 , v2 , · · · , vN } = {π1 , π2 , π3 , · · · , πN }, E = (πi , πj ), πi ∈ ω(πj ). In order to determine an exact complex network according to a solution space, an approach that compute the order number i of feasible solution πi according to the permutation of integers πi [1], πi [2], · · · , πi [n], is presented. It is assumed that any feasible solution π be represented in a standard array way: π[1] = 1, · · · , π[i] = 2, · · · , π[j] = 3, · · · , π[n] = n(1 < i < j ≤ n). The computing equation is shown as follows. A METHOD FOR ANALYZING SOLUTION SPACE OF TSP n−1 ∑ N i = s[n] + [(s[j] − 1) · ] (j − 1)!/2 j=1 { 1, 1 ≤ j ≤ 3 s[j] = h, 1 ≤ h ≤ j, 4 ≤ j ≤ n N = n(n − 1)/2 5 (4) where integer array s can be determined by standard array π, and s[1] = s[2] = s[3] = 1, s[j] represents city j’s relative position to cities 1, 2, · · · , j − 1 in standard array π. For example, an feasible solution with 6 cities π[1] = 1, π[2] = 6, π[3] = 2, π[4] = 3, π[5] = 4, π[6] = 5, city 4 position in standard array π is 5, positions of cities 1, 2, 3 are 1, 3, 4, respectively. Thus s[4] = 1 because 5 is the largest among 1,3,4 and 5. It should be pointed that Eq.(4) is reversible, i.e., according to a number i ranging from 1 to N , a sole feasible solution π can be computed by Eq.(5) stated as follows. 1, 1 ≤ k ≤ 3 ⌈ (k − 1)! · i − (s[k − 1] − 1)(k − 1)⌉, 4 ≤ k < n 2 N s[k] = n−1 ∑ N i− [(s[j] − 1) · ], k = n (j − 1)!/2 (5) j=1 To display intuitively equations (4) and (5), we compute number i and πi : 2-3-1-5-4-6 according to each other information by using (4) and (5). The processes of computing them are illustrated in Figures 4 and 5, respectively. i 2 3 1 5 4 6 n=6, N=60 Standard array 1 5 1 2 3 s[1]=s[2]=s[3]=1 4 2 3 s[4]=3 2 3 s[5]=4 2 3 s[6]=3 4 1 5 4 1 5 4 6 6 According to Eq.(4) i=58, i= 58 Figure 4. The process of computing i according to πi Furthermore, the edges in complex network can be determined according to neighborhood of πi , i.e., ω(πi ). So the adjacency matrix A of complex network represented solution 6 W.Z RAO, C. JIN i=58 n=6, according to Eq.(5), then s[1]=s[2]=s[3]=1, s[4]=3, s[5]=4, s[6]=3 Insert 4 1 2 s[1]=s[2]=s[3]=1 3 s[4]=3 Insert 5 1 4 2 3 s[5]=4 Insert 6 58 1 5 4 2 3 1 5 4 6 2 s[6]=3 3 Figure 5. The process of computing πi according to i space of TSP can be stated as follows. { A = (aij )N ×N aij = 1 πi ∈ ω(πj ) aij = 0 otherwise (6) The matrix A is symmetric because πi ∈ ω(πj ) is equivalent to πj ∈ ω(πi ). As mentioned above, any solution space of TSP instance after specifying elementary move has a sole corresponding complex network. 3.2. The elementary indexes of complex network. There are many indexes measuring structure of complex network. The most traditional ones are the average node degree, the average clustering coefficient, the average shortest path length and degree correlation coefficient. The degree ki of a node i is given by its number of connections. For undirected networks, ki can be computed as Eq.(7) by using the adjacency matrix A. ki = N ∑ aij (7) j=1 The average node degree is a global measurement of the connectivity of the network, and calculated by Eq.(8). N ∑ ⟨k⟩ = ki i=1 N (8) Another measurement related to connectivity is the degree distribution P (k), which gives the probability that a node chosen uniformly at random has degree k. A METHOD FOR ANALYZING SOLUTION SPACE OF TSP 7 { 1, ki = k k ρi = 0, ki ̸= k 1 ≤ k ≤ N − 1, 1 ≤ i ≤ N (9) N ∑ ρki P (k) = i=1 N The clustering coefficient is related to the presence of triangles (cycles of order three) in the network, The clustering coefficient of a node i (with degree ki > 1) is given by the ratio between the number of edges among the neighbors of i, denoted by ei , and the maximum possible number of edges among these neighbors, given by ki (ki − 1)/2. Thus The clustering coefficient can be computed as Eq.(10). N N ∑ ∑ (aij aim amj ) 2ei j=1 m=1 ci = = (10) ki (ki − 1) ki (ki − 1) The corresponding global measurement frequently used to characterize the graph is the average clustering coefficient, which is given as Eq.(11). N ∑ ⟨c⟩ = ci i=1 (11) N The length of a path connecting the vertices i and j is given by the number of edges along that path. The shortest path (or the geodesic path) between vertices i and j is any of the paths connecting these two nodes whose length is minimal. For the whole network, it is possible to represent the geodesic distances by a distance matrix U , in which the entry uij represents the length of the shortest paths between the nodes i and j. The average shortest path length can be obtained by Eq.(12). ∑∑ 1 l= uij N (N − 1) i=1 i=1 N N (12) where the sum considers i ̸= j and disregards pairs that are not in the same connected component. Another important structural aspect of complex network characterization is the analysis of how vertices with different degrees are connected. The degree correlation coefficient can be determined from the Pearson correlation coefficient of the degrees at both ends of the edges, then it can be calculated by Eq.(13). ∑ ∑ 1 1 (ki kj aij ) − { M1 [ 2 (ki + kj )aij ]}2 M j>i j>i ∑ 1 r= 1 ∑ 1 2 (13) 1 2 2 )a ] − { + k [ (k [ (k + k )a ]} ij i j ij j i M 2 M 2 j>i j>i where M is the total number of edges and 0 ≤ r ≤ 1. If r > 0 the network is assortative (vertices with similar degrees tend to be connected); if r < 0, the network is disassortative (highly connected vertices tend to connect to those with few connections); for r = 0 there is no correlation between vertex degrees, and the network is called non-assortative. These indexes can display the prosperities of the whole complex network and they correspond to some performances of the heuristic solving TSP. Apparently, degree ki 8 W.Z RAO, C. JIN indicates that neighborhood of solution i has ki solutions, The clustering coefficient ci denotes the probability that two neighbor solutions of solution i are neighbor, The average shortest path length l indicates that any one solution in solution space can be obtained from another solution by taking l the specified elementary “moves”on average. 4. Experimental results. In this Section, firstly the solution space of 2-opt solving a TSP instance with 6 cities is analyzed by using the method proposed in Section 3, and then the indexes of complex networks corresponding to solution spaces of heuristics 2-opt, Or-opt, 3-opt and Lin-Kernihan are computed and compared. The comparison results indicate that the complex network of solution space of the excellent heuristic is similar to the small-network[28]. Base on this finding, three heuristics are developed and then their performance is evaluated by solve some benchmark TSP instances. In this Section a TSP instance with 6 cities is randomly generated. Without loss of generality, the coordinates of 6 cities in the instance are randomly generated ranging from 1 to 5. The detailed coordinates of 6 cities are (1.8, 1.5), (5.0, 4.0), (3.0, 5.0), (2.8, 3.0), (4.5, 1.5), (1.0, 3.0), respectively. 4.1. complex network corresponding to solution space of 2-opt. All 60 feasible solutions with their length and neighborhood are shown in Table 1. The adjacency matrix A and the complex network corresponding to the solution space can be exactly determined according to the method aforementioned. To visualize the solution space using the complex network, we determine position of each node using coordinates in complex network. The x coordinate of each node is the number computed by Eq.(4) according to each solution, and the y coordinate is length of each solution. The complex network is illustrated in Figure 6. Apparently, ⟨k⟩, ⟨c⟩, l and r of the complex network can be computed according equations (7)-(13). Note that the length of the shortest path between any two nodes in complex network is computed by Dikstra heuristic, the resulted matrix U is illustrated in Figure7 (matrix U is symmetric, thus it is represented by lower triangular matrix in Figure 7). The computational results of all indexes are shown in Table 2. By computing these indexes, it can be found that the complex network is a special network in which each ⟨k⟩ is 9, c of each node is zero, l is a very small value 2.10 and r is equal to zero. This means that in the solution space, a feasible solution with 6 cities has 9 neighbors, any two neighbors of one node are impossible neighboring each other, and any two feasible solutions can change to each other by taking 2.10 2-opt moves on average, and r = 1.00 > 0 indicates that the network is assortative. As shown in Table 1 and Figure 4, the local optimal solutions are π16 and π51 (the length is displayed in bold in Table 1). However, L(π16 ) = 13.00 is less than L(π51 ) = 13.38, thus π16 : 1-5-2-3-4-6 is the global optimal solution. Now, we evaluate two measures to improve 2-opt by using the method proposed in Section 3. There are two different ways to choose next better solution based on current solution, i.e., Best-find or First-find. For example, it is assumed that the current solution is π1 . The better solutions in ω(π1 ) are π5 , π6 , π20 and π31 , obviously, π20 is best. So π20 will be chosen if 2-opt involving Best-find measure, or any one of π5 , π6 , π20 and π31 probably be chosen taking First-find measure. The key problem is which measure is better? In order to evaluate the two measures, we choose 20 different initial solutions as start solutions of 2-opt by taking the two measures, respectively (note that 2-opt involving First-find measure will generate many different results if it is implemented more times, A METHOD FOR ANALYZING SOLUTION SPACE OF TSP 9 TABLE 1 Solution space of 2-opt solving a TSP instance with 6 cities All feasible solutions 1: 1-2-3-4-5-6 1-2-3-4-6-5 3 : 1-2-3-6-4-5 4 : 1-2-6-3-4-5 5 : 1-6-2-3-4-5 6 : 1-2-3-5-4-6 7 : 1-2-3-5-6-4 8 : 1-2-3-6-5-4 9 : 1-2-6-3-5-4 10: 1-6-2-3-5-4 11: 1-2-5-3-4-6 12: 1-2-5-3-6-4 13: 1-2-5-6-3-4 14: 1-2-6-5-3-4 15: 1-6-2-5-3-4 16: 1-5-2-3-4-6 !17: 1-5-2-3-6-4 !18: 1-5-2-6-3-4 !19: 1-5-6-2-3-4 !20: 1-6-5-2-3-4 !21: 1-2-4-3-5-6 !22: 1-2-4-3-6-5 !23: 1-2-4-6-3-5 !24: 1-2-6-4-3-5 !25: 1-6-2-4-3-5 !26: 1-2-4-5-3-6 !27: 1-2-4-5-6-3 !28: 1-2-4-6-5-3 !29: 1-2-6-4-5-3 !30: 1-6-2-4-5-3 !31: 1-2-5-4-3-6 !32: 1-2-5-4-6-3 !33: 1-2-5-6-4-3 !34: 1-2-6-5-4-3 !35: 1-6-2-5-4-3 !36: 1-5-2-4-3-6 !37: 1-5-2-4-6-3 !38: 1-5-2-6-4-3 !39: 1-5-6-2-4-3 !40: 1-6-5-2-4-3 !41: 1-4-2-3-5-6 !42: 1-4-2-3-6-5 !43: 1-4-2-6-3-5 !44: 1-4-6-2-3-5 !45: 1-6-4-2-3-5 !46: 1-4-2-5-3-6 !47: 1-4-2-5-6-3 !48: 1-4-2-6-5-3 !49: 1-4-6-2-5-3 !50: 1-6-4-2-5-3 !51: 1-4-5-2-3-6 !52: 1-4-5-2-6-3 !53: 1-4-5-6-2-3 !54: 1-4-6-5-2-3 !55: 1-6-4-5-2-3 !56: 1-5-4-2-3-6 !57: 1-5-4-2-6-3 !58: 1-5-4-6-2-3 !59: 1-5-6-4-2-3 !60: 1-6-5-4-2-3 2: i L( i) 16.08 16.61 15.89 17.99 15.04 15.87 17.52 17.00 18.89 15.94 15.93 16.85 17.06 19.61 15.99 13.00 13.92 16.01 16.68 14.11 17.80 17.82 17.61 18.50 16.76 17.08 19.08 19.59 19.76 18.01 15.42 17.21 17.93 19.97 16.35 14.20 15.99 16.88 18.76 16.18 15.77 15.79 17.68 16.47 14.66 15.11 17.11 19.66 17.78 15.97 13.38 17.27 17.94 15.90 14.25 14.15 18.04 16.83 16.66 16.13 Neighborhood of solution i !( i) !( 1) : { 2, 5, 6, 8, 20, 21, 31, 34, 60} !( 2) : { 1, 3, 7, 16, 19, 22, 24, 33, 59} !( 3) : { 2, 4, 6, 8, 17, 23, 32, 56, 58} !( 4) : { 3, 5, 9, 18, 22, 24, 31, 34, 57} !( 5) : { 1, 4, 10, 16, 19, 25, 35, 56, 58} !( 6) : { 1, 3, 7, 10, 11, 26, 29, 45, 55} !( 7) : { 2, 6, 8, 12, 14, 28, 41, 44, 54} !( 8) : { 1, 3, 7, 9, 13, 27, 42, 51, 53} !( 9) : { 4, 8, 10, 12, 14, 26, 29, 43, 52} !( 10): { 5, 6, 9, 15, 30, 41, 44, 51, 53} !( 11): { 6, 12, 15, 16, 21, 24, 31, 33, 50} !( 12): { 7, 9, 11, 13, 17, 23, 32, 46, 49} !( 13): { 8, 12, 14, 18, 20, 22, 31, 33, 47} !( 14): { 7, 9, 13, 15, 19, 21, 24, 34, 48} !( 15): { 10, 11, 14, 18, 20, 25, 35, 46, 49} (!16): {!2, !5, !11, !17, !20, !36, !38, !45, !55} (!17): {!3, !12, !16, !18, !37, !42, !44, !51, !54} (!18): {!4, !13, !15, !17, !19, !36, !38, !43, !52} (!19): {!2, !5, !14, !18, !20, !39, !42, !44, !53} (!20): {!1, !13, !15, !16, !19, !40, !41, !51, !54} (!21): {!1, !11, !14, !22, !25, !26, !28, !40, !41} (!22): {!2, !4, !13, !21, !23, !27, !36, !39, !42} (!23): {!3, !12, !22, !24, !26, !28, !37, !43, !45} (!24): {!2, !4, !11, !14, !23, !25, !29, !38, !44} (!25): {!5, !15, !21, !24, !30, !36, !39, !43, !45} (!26): {!6, !9, !21, !23, !27, !30, !31, !46, !56} (!27): {!8, !22, !26, !28, !32, !34, !47, !57, !60} (!28): {!7, !21, !23, !27, !29, !33, !48, !50, !59} (!29): {!6, !9, !24, !28, !30, !32, !34, !49, !58} (!30): {!10, !25, !26, !29, !35, !48, !50, !57, !60} (!31): {!1, !4, !11, !13, !26, !32, !35, !36, !51} (!32): {!3, !12, !27, !29, !31, !33, !37, !52, !55} (!33): {!2, !11, !13, !28, !32, !34, !38, !40, !54} (!34): {!1, !4, !14, !27, !29, !33, !35, !39, !53} (!35): {!5, !15, !30, !31, !34, !38, !40, !52, !55} (!36): {!16, !18, !22, !25, !31, !37, !40, !46, !56} (!37): {!17, !23, !32, !36, !38, !47, !50, !57, !59} (!38): {!16, !18, !24, !33, !35, !37, !39, !49, !58} (!39): {!19, !22, !25, !34, !38, !40, !48, !57, !59} (!40): {!20, !21, !33, !35, !36, !39, !47, !50, !60} (!41): {!7, !10, !20, !21, !42, !45, !46, !48, !60} (!42): {!8, !17, !19, !22, !41, !43, !47, !56, !59} (!43): {!9, !18, !23, !25, !42, !44, !46, !48, !57} (!44): {!7, !10, !17, !19, !24, !43, !45, !49, !58} (!45): {!6, !16, !23, !25, !41, !44, !50, !56, !59} (!46): {!12, !15, !26, !36, !41, !43, !47, !50, !51} (!47): {!13, !27, !37, !40, !42, !46, !48, !52, !54} (!48): {!14, !28, !30, !39, !41, !43, !47, !49, !53} (!49): {!12, !15, !29, !38, !44, !48, !50, !52, !54} (!50): {!11, !28, !30, !37, !40, !45, !46, !49, !55} (!51): {!8, !10, !17, !20, !31, !46, !52, !55, !56} (!52): {!9, !18, !32, !35, !47, !49, !51, !53, !57} (!53): {!8, !10, !19, !34, !48, !52, !54, !58, !60} (!54): {!7, !17, !20, !33, !47, !49, !53, !55, !59} (!55): {!6, !16, !32, !35, !50, !51, !54, !58, !60} (!56): {!3, !5, !26, !36, !42, !45, !51, !57, !60} (!57): {!4, !27, !30, !37, !39, !43, !52, !56, !58} (!58): {!3, !5, !29, !38, !44, !53, !55, !57, !59} (!59): {!2, !28, !37, !39, !42, !45, !54, !58, !60} (!60): {!1, !27, !30, !40, !41, !53, !55, !56, !59} 10 W.Z RAO, C. JIN 20 34 29 28 14 48 27 19 9 39 24 18 30 4 49 43 52 32 L( i ) 47 26 13 12 8 17 57 53 33 2122 23 7 38 19 2 58 25 59 44 35 40 1 16 3 6 1011 18 15 60 37 50 4142 54 31 46 5 15 45 55 36 20 14 56 17 51 16 13 0 10 20 30 40 50 60 i Figure 6. Complex network representing solution space of 2-opt solving a TSP instance with 6 cities 1 2 3 4 5 6 GHQRWHV 7 8 9 [GHQRWHV 10 11 12 RGHQRWHV 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 Figure 7. Matrix U of complex networks corresponding to solution space TABLE 2 Indexes values of complex network Corresponding to solution space of 2-opt Indexes ki <k> P(9) ci <c> l r Values 9 9 1 0.00 0.00 2.10 1.00 A METHOD FOR ANALYZING SOLUTION SPACE OF TSP 11 and we just record one searching path of them). Then we record all the searching paths (searching trajectory). TABLE 3 Comparison of the searching paths Num Start solution 1 1 2 3 3 5 4 7 5 9 6 11 7 13 8 15 9 17 10 19 11 21 12 23 13 25 14 30 15 35 16 40 17 45 18 50 19 55 20 60 Measures Best-find First-find Best-find First-find Best-find First-find Best-find First-find Best-find First-find Best-find First-find Best-find First-find Best-find First-find Best-find First-find Best-find First-find Best-find First-find Best-find First-find Best-find First-find Best-find First-find Best-find First-find Best-find First-find Best-find First-find Best-find First-find Best-find First-find Best-find First-find Searching paths 1- 20- 16 1- 5- 56- 51 3- 17- 16 3- 6- 45- 56- 16 5- 16 5- 56- 16 7- 41- 20- 16 7- 2- 1- 5- 56- 51 9- 10- 51 9- 4- 3- 6- 45- 16 11- 16 11- 6- 45- 56- 51 13- 20- 16 13- 8- 1- 5- 16 15- 20- 16 15- 10- 5- 56- 51 17- 16 17- 16 19- 20- 16 19- 2- 1- 5- 16 21- 41- 20- 16 21- 1- 20- 51 23- 45- 16 23- 3- 6- 45- 16 25- 36- 16 25- 5- 16 30- 10- 51 30- 10- 5- 56- 16 35- 55- 16 35- 40- 50- 46- 3640- 20- 16 40- 50- 46- 51 45- 16 45- 56- 16 50- 55- 16 50- 11- 6- 45- 16 55- 16 55- 56- 51 60- 56- 51 60- 1- 5- 16 16 Length 2 3 2 4 1 2 3 5 2 5 1 4 2 4 2 4 1 1 2 4 3 3 2 4 2 2 2 4 2 5 2 2 1 2 2 4 1 2 2 3 The computational results in Table 3 clearly indicate that the Best-find measure is better than the First-find measure. The 2-opt+Best-find found the global optimal solution in 16 cases out 20, in contrast to 13 cases out 20 of the 2-opt+First-find. More importantly, the length of searching path generated by the 2-opt+Best-find is very close to the shortest length between two end nodes of the searching path. This means that the 2-opt+Best-find is more effective and efficient than the 2-opt+First-find. 4.2. Comparison of complex networks corresponding to 4 different heuristics. Furthermore, the method proposed in this article can be applied to compare the performance of different heuristic solving TSP. The indexes of complex networks corresponding to solution spaces of 2-opt, Or-opt, 3-opt and Lin-Kernighan are computed[12], respectively. It should be pointed that 2opt, 3-opt are special cases of k-opt(k ≥ 2), where one solution is obtained from another solution by deleting k edges and replacing them with a different set of k edges(a k-opt “move”). In addition, Lin-Kernighan heuristic is a combinations of many different k-opt in which k is not a constant but a variable. In principle Lin-Kernighan can change all the edges in the solution in a single “move”[12]. 12 W.Z RAO, C. JIN TABLE 4 Indexes values of complex network corresponding to 4 heuristics Indexes Values 2-opt Or-opt 3-opt L-K ki 9 18 29 59 <k> 9 18 29 59 P(k) 1 1 1 1 <c> 0.00 0.22 0.32 1.00 l 2.10 1.65 1.32 1.00 r 1.00 1.00 1.00 1.00 The computational results in Table 4 demonstrate that the complex networks corresponding to the solution space of 2-opt, Or-opt and 3-opt are similar to the regular network in which each node has the same degree. Comparing to the regular network, the complex network corresponding to the solution space of Lin-Kernighan is more close to the smallworld network in which the average shortest path length is small and the node degree is not too large. Watts and Strogatz indicated that the regular network can transform to the small-world network by reconnecting edges with a very small probability p in their research[28]. The process is illustrated as Figure 8. Figure 8. The process of transforming the regular network to small-world network As shown in Figure 8, it is demonstrated that for p=0, the original edges are unchanged; as p increases, the network becomes increasingly disordered until for p=1, all edges are rewired randomly. However, for very small values of p(such as less than 0.1), the graph will be a small-world network [28]. The conclusion of this research motivates us that an excellent heuristic may be developed based on the three simple 2-opt, Or-opt and 3-opt by implementing the strategy, which reconnect some edges in complex networks corresponding to the solution spaces of three heuristics with a small probability p. According to the motivation, we develop three heuristics: Hybrid Neighborhood Algorithms based on 2-opt, Or-opt and 3-opt, respectively(HNA-2-opt, HNA-Or-opt and HNA-3-opt), their PSO-codes are shown in Figure 9. 4.3. Performance evaluation of the three HNAs. To further verify the conclusion, we solve 10 TSP instances with cities more than 1000 coming from TSPLIB using 2opt+Best-find (2-optBF), 2-opt+First-find (2-optFF), Or-opt, 3-opt and Lin-Kernighan A METHOD FOR ANALYZING SOLUTION SPACE OF TSP 13 1: BestSolution= InitialSolution(); 2: Set Parmeter p; 3: While IsContinueImprove() do 4: If rand()<p 5: Move=k-opt // choosing k-opt with probability p and k is greater than 4˗ 6: else 7: Move=rand(2-opt, Or-opt, 3-opt); // choosing 2-opt, Or-opt, 3-opt with probability 1- p˗ 8: EndIf 9: NextSolution= Move(BestSolution); 10: If L(NextSolution)< L(BestSolution) //determining whether the NextSolution is superior to the BestSolution˗ 11: BestSolution=NextSolution; 12: else 13 Update IsContinueImprove(); // determining whether the HNA should be over or not˗ 14: Continue do while; 15: EndIf 16: EndWhile 17: Return BestSolution; Figure 9. The PSO-codes of HNA (L-K), HNA-2-opt, HNA-Or-opt and HNA-3-opt, respectively. It should be pointed out that the parameter p is equal to 0.1 in three HNAs. The computational results are shown in Table 5. Note that (1) the procedure is written in C. The tests were carried out on a machine of Intel Q9400 2.66GHz Memory 4GB; (2) the quality of heuristic is measured as the percentage by which the solution’s length exceeds the length of an optimum solution (the optimal length of each instance can be downloaded from http: //www.iwr.uniheidelberg.de /groups/comopt/software/TSPLIB95/tsp). TABLE 5 The results of all 8 algorithms solving 10 instances Algorithms 1 2 3 4 5 6 7 8 9 10 Dsj1000 Pr1002 Rl1323 Fl1577 D1655 Vm1748 U1817 U2152 U2319 Pr2392 2-optBF 8.27 6.01 6.12 10.16 6.28 9.01 4.36 5.60 1.51 6.21 Average 6.35 Quality (%) 2-optFF 9.35 6.17 6.53 11.30 7.15 9.98 5.23 7.60 2.04 7.86 7.32 Or-opt 5.43 5.69 5.87 9.95 6.37 5.74 4.12 4.23 2.14 7.16 5.67 3-opt 4.58 3.87 5.81 9.86 6.14 4.11 4.78 5.95 1.39 5.56 5.21 L-K 2.18 3.72 5.47 9.01 3.73 1.08 3.64 4.59 0.50 3.30 3.72 HNA-2-opt 5.83 4.30 4.96 6.82 4.89 7.62 2.90 4.53 0.99 5.16 4.80 HNA-Or-opt 4.25 4.47 4.64 7.12 4.30 4.03 3.32 3.23 1.40 5.83 4.26 HNA-3-opt 3.67 2.83 4.21 8.13 4.54 3.13 3.20 4.51 1.01 3.64 3.89 2-optBF 0.15 0.15 0.17 0.32 0.35 0.42 0.49 0.61 0.68 0.73 0.41 Running Time(s) 2-optFF 0.17 0.16 0.19 0.43 0.49 0.58 0.64 0.72 0.80 0.84 0.50 Or-opt 0.26 0.29 0.33 0.52 0.55 0.67 0.71 0.96 1.10 1.19 0.66 3-opt 0.51 0.54 0.68 1.02 1.03 1.27 1.34 1.93 2.16 2.38 1.29 L-K 1.48 1.59 1.74 3.21 3.43 5.14 5.23 6.72 7.31 8.11 4.40 HNA-2-opt 0.23 0.23 0.26 0.56 0.62 0.79 0.85 1.00 1.10 1.18 0.68 HNA-Or-opt 0.31 0.35 0.39 0.64 0.68 0.87 0.91 1.22 1.38 1.50 0.83 HNA-3-opt 0.54 0.58 0.71 1.10 1.12 1.43 1.49 2.11 2.35 2.60 1.40 14 W.Z RAO, C. JIN As indicated in Table 5, it can be easily found that in all 10 instances, 2-optBF yields better solutions at smaller running time cost than 2-optFF. The average solution quality of L-K is the best and appears to be 3.72% above the optimum solution, compared to 6.35% for 2-optBF, 7.32% for 2-optFF, 5.67% for Or-opt and 5.21% for 3-opt, 4.80% for HNA-2-opt, 4.26% for HNA-Or-opt and 3.89% for HNA-3-opt. It is also significant to notice that the quality of three HNA algorithms, especially HNA-3-opt is close to that of L-K and is apparently superior to those of 2-optFF(BF), Or-opt and 3-opt, respectively. Furthermore, the three HNA algorithms generate better solutions than L-K in solving 5 benchmark instances (Pr1002, Rl1323, Fl1577,U1817 and U2152,in Table 5 bolded entries indicate where the best solutions were obtained). By comparing the running time of all 8 heuristics, it can be found that the 2-optBF consume the smallest time and L-K is the slowest one. However, the three HNA algorithms solve instances almost as quickly as 2-opt, Or-opt and 3-opt, respectively. The HNA-2-opt, HNA-Or-opt and HNA-3-opt are about 7, 5 and 3 times faster than L-K, respectively. From the computational results shown in Table 5, it can be indicated that the three HNA-algorithms developed can obtain a better tradeoff between quality and running time. Herein, based on the instance with 6 cities described in subsection 4.1, the related indexes of complex networks corresponding to the solution space of the three HNA-algorithms, are computed as shown in Table 6. TABLE 6 Indexes values of complex network corresponding to 3 HNA-heuristics Indexes Values HNA-2-opt HNA-Or-opt HNA-3-opt ki 9 18 29 <k> 9 18 29 P(k) 1 1 1 <c> 0.30 0.42 0.67 l 1.33 1.15 1.05 r 1.00 1.00 1.00 As demonstrated in Tables 4, 5 and 6, it can be further verified that the average node degree ⟨k⟩ and the average shortest path l indicate the running time and the solution quality of heuristic, respectively. So the complex network corresponding to solution space of a good heuristic is more close to small-world network. 5. Conclusions. A method for analyzing solution space of TSP by using complex networks has been studied in this paper. This method is important in evaluating the performance of heuristics and developing excellent heuristics. From our study, the following 5 conclusions are summarized: (1)The solution space of a specified heuristic is a classic complex discrete system that is appropriate and applicable to be analyzed by using complex networks. (2)There is a sole complex network that corresponds to a solution space of specified heuristic solving TSP for instance with n cities. (3)The smaller the average node degree ⟨k⟩ and average shortest path l are, the better performances of the heuristic in solution quality and running time are. (4)The solution space structures of 2-opt, Or-opt and 3-opt are the regular networks. (5)The solution space structure of one excellent heuristic is more close to the smallworld network. A METHOD FOR ANALYZING SOLUTION SPACE OF TSP 15 The solution spaces corresponding to 2-opt(with two measures Best-find and Firstfind), Or-opt, 3-opt and Lin-Kernighan are analyzed and compared by using the method proposed. According to the conclusion 4, the three HNA-algorithms are developed based on 2-opt, Or-opt and 3-opt, respectively. Experimental results indicate that the performances of the three heuristics are excellent in both quality and running time. This means that the method proposed in this paper is a useful tool to analyze solution space of heuristic for solving TSP and to develop some excellent heuristics. In our future research, we will analyze the solution space corresponding to heuristics for solving other combinatorial problems (such as VRP) by applying the method. Acknowledgment. This work is partially supported by the grants from the National Natural Science Foundation of China (No.70890080, 70890083, major project) and Ph.D. Program Foundation of Ministry of Education of China (No.20100041110024). REFERENCES [1] R. M. Karp, Reducibility among combinatorial problems. In complexity of computer computations, Plenum Press, New York, pp.85-104, 1972. [2] J. Y. Yi, G. Y, Z. Q. Zhang and Z. T, An improved elastic net method with time-dependent parameters for traveling salesman problem, International Journal of Innovative Computing, Information and Control, vol.5, no.4, pp.1089-1100, 2009. [3] B. Korte, Applications of combinatorial optimization, Talk at the 13th International Mathematical Programming Symposium, Tokyo, 1988. [4] G. Laporte, The vehicle routing problem: an overview of exact and approximate algorithms, European Journal of Operational Research, vol.59, no.3, pp.345-358, 1992. [5] X. P. Hu, M. F. Huang and A. Z. Zeng, An intelligent solution system for a vehicle routing problem in urban distribution, International Journal of Innovative Computing, Information and Control, vol.3, no.1, pp.189-198, 2007. [6] J. J. Wang, F. Liu and P. He, Rescheduling under predictive disruption of WSPT schedule for single machine scheduling, ICIC Express Letters, vol.4, no.2, pp.467-472, 2010. [7] G. C. Onwubolu, M. Clerc, Optimal path for automated drilling operations by a new heuristic approach using particle swarm optimization, International Journal of Production Research, vol.42, no.3,pp.473-491, 2004. [8] R. G. Bland, D. F. Shallcross, Large traveling salesman problems arising from experiments in X-ray crystallography: A preliminary report on computation, Operations Research, vol.8, no.3, pp.125-128, 1989. [9] M. Junger, G. Reinelt and G. Rinaldi, Handbooks in OR and MS: Chapter4 The traveling salesman problem, Elsevier Science, 1995. [10] J. L. Bentley, Fast algorithm for geometric traveling salesman problem, Operations research society of America, vol.4, no.4, pp.387-412, 1992. [11] W. Z. Rao, C. Jin and Y. Y. Huang, Hybrid algorithm of the nearest neighbor and insertion for the traveling salesman problem, Journal of Systems Engineering & Theory, vol.31, no.8, pp.1419-1428, 2011. [12] S. Lin, B. W. Kernighan, An effective heuristic algorithm for the traveling salesman problem, Operations Research, vol.21, no.2, pp.498-516, 1973. [13] F. G. Zhao, J. S. Sun and S. J. Li, A hybrid genetic algorithm for the traveling salesman problem with pickup and delivery, International Journal of Automation and Computing, vol.6, no.1, pp.97102, 2009. [14] Y. F. Huang, Y. L. Wang and X. L. Lv, Study on the Optimal Solution and the Solution Space of Newsvendor Model, Operations Research and Management Science, vol.19, no.5, pp.9-14, 2010. [15] B. Wang, Q. Zhang, F. Wang, Y. S. Wei, Quantitative Analysis of Infeasible Solution to Job Shop Scheduling Problem, Control and Decision, vol.16, no.1, pp.33-36, 2001. [16] Y. K. Sun, M. Liu and C. Wu, Analysis of Characteristics of Scheduling Problem and Its Solution Space, Acta Electronica Sinica, vol.29, no.8, pp.1042-1045, 2001. [17] Z. H. Yao, A. L. Johnson, On estimating the feasible solution space of design, Computer Aided Design, vol.29, no.9, pp.649-655, 1997. 16 W.Z RAO, C. JIN [18] D. E. Armstronga, S. H. Jacobsonb, An analysis of neighborhood functions on generic solution spaces, European Journal of Operational Research, vol.186, no.2, pp.529-541, 2008. [19] S. Gomez, J. Gomez-Gardenes, Y. Moreno and A. Arenas, Nonperturbative heterogeneous mean-field approach to epidemic spreading in complex networks , Physical Review E, vol.84, no.3, pp.036105-1036105-7, 2011. [20] H. Ebel, L. I. Mielsch and S. Bornholdt, Scale-free topology of e-mail networks, Physical Review E, vol.66, no.3, pp.35-103, 2002. [21] M. Gligor, A. Ausloos, Clusters in weighted macroeconomic networks: the eu case. Introducing the overlapping index of gdp/capita fluctuation correlations, The European Physical Journal B, vol.63, no.4, pp. 533-539, 2008. [22] T. Berners-Lee, W. Hall, J. Hendler, N. Shadbolt and D. J. Weitzner, Creating a science of the Web, Science, vol.5788, no.313, pp.769-771, 2006. [23] D. P Chassin, C. Posse, Evaluating North American electric grid reliability using the Barabsi-Albert network model, Physica A: Statistical Mechanics and its Applications, vol.355, no.2, pp.667-677, 2005. [24] G. Siganos, M. Faloutsos, P. Faloutsos and C. Faloutsos, Power laws and the AS-level internet topology, IEEE/ACM Transactions on Networking (TON), vol.11, no.4, pp.514-524, 2003. [25] D. Garlaschelli, G. Caldarelli and L. Pietronero, Universal scaling relations in food webs, Nature, vol.6936, no.423, pp.165-168, 2003. [26] A. Barrat, M. Weigt, On the properties of small-world network models, European Physics Journal B, vol.13, no.3, pp.547-560, 2000. [27] E. Estrada, N. Hatano and M. Benzi, The physics of communicability in complexnetworks, Physics Reports, vol.514, no.3, pp.89-119, 2012. [28] D. J. Watts and S. H. Strogatz, Collective dynamics of small-world networks, Nature, vol.6684, no.393, pp.440-442, 1998.