Application of Imperialist Competitive Algorithm on Solving the Traveling Salesman Problem

The imperialist competitive algorithm (ICA) is a new heuristic algorithm proposed for continuous optimization problems. The research about its application on solving the traveling salesman problem (TSP) is still very limited. Aiming to explore its ability on solving TSP, we present a discrete imperialist competitive algorithm in this paper. The proposed algorithm modifies the original rules of the assimilation and introduces the 2-opt algorithm into the revolution process. To examine its performance, we tested the proposed algorithm on 10 small-scale and 2 large-scale standard benchmark instances from the TSPLIB and compared the experimental results with that obtained by two other ICA-based algorithms and six other existing algorithms. The proposed algorithm shows excellent performance in the experiments and comparisons.


Introduction
Because of its widespread application and significant research value, the traveling salesman problem (TSP) has probably become the most classical, famous and extensively studied problem in the field of combinatorial optimization [1][2][3].It can be simply described as to find out the shortest tour OPEN ACCESS that starts from one city from the set of given cities, visits every given city once, and returns to the original finally.As a typical NP-hard combinatorial optimization problem, it is extremely difficult to solve [4].Compared with the exact algorithms for solving TSP, the approximate algorithms are simpler.Although they cannot guarantee to find the optimal solution, often they can obtain a satisfactory solution.They are more suitable to be used to solve larger-scale TSP [5].Many approximate algorithms have been applied to solve the TSP .
Imperialist competitive algorithm (ICA) is a new socio-politically motivated meta-heuristic algorithm proposed by Atashpaz-Gargari and Lucas in 2007, inspired by the colonial phenomenon in human society and history [27].Although it has been successfully applied to many different optimization tasks and has shown great performance in both the convergence rate and the global optimal achievement [28][29][30][31][32][33], its application on solving TSP is still very limited.The literature [34] gives some results obtained by ICA, but the description about how to use ICA to solve TSP is ambiguous.The literature [35] submits a new approach, but in our test experiments, the approach cannot produce the results given in the literature.Mohammad Ahmadvand et al. [36] proposed a hybrid algorithm based on ICA and tabu search, using ICA to solve TSP at first and using a tabu search to improve the solution, however, the results obtained by the hybrid algorithm are not yet good enough.
Seeking to explore the potential of ICA and to find a novel and efficient way for solving TSP, we present a novel discrete ICA in this paper.
The rest of this paper is organized as follows.In Section 2, a brief introduction about the basic ICA is given.In Section 3, the proposed algorithm is set out in detail.In Section 4, the numerical experiments, results and related discussion are given.In Section 5, we conclude the paper and put forward the future works.

Basic Imperialist Competitive Algorithm
The ICA simulates the process of competition between empires in human society.It starts with a randomly generated initial population of size N, which are called countries, just like the chromosomes in the genetic algorithm.The cost of each country is calculated by the equation specific for the problem to be optimized.Then, countries are divided into imperialists and colonies.Imperialists are the best countries in the population, and colonies are the others left.Then the colonies are randomly distributed to the imperialists.The number of colonies that an imperialist obtains is proportional to its power.Here the power of each imperialist is calculated and normalized depended on its cost.The imperialist with bigger power value is better.One imperialist and its colonies consist of an empire together, thus several empires are initialized.
After, within each empire group, the colonies are moved to the position of the imperialist according to a certain rule.This process is called "assimilation", simulates the assimilation process the imperialist implements on its colonies in a realistic society.Meanwhile, some colonies are randomly selected out and replaced with new randomly generated countries.This process is called "revolution", just like the mutation in the genetic algorithm, simulates the sudden change in the socio-political characteristics of a colony in a realistic society.In the process of assimilation and revolution, if a colony becomes better than the imperialist, the colony and the imperialist will exchange their roles.
The competitive behavior between the empires is the core of the ICA.In this stage, all empires try to occupy colonies from others.Firstly, the total cost of every empire is calculated and normalized according to the formulas (1) and (2) [27], in where the T.C. n and the N.T.C. n stand for the total cost and the normalized total cost of the nth empire, respectively, and the ξ is a little positive number, whose value determines the role of the colonies in determining the total cost of the empire.
. . . . .max{ . .} Then, the weakest colony of the weakest empire is picked out.Other empires try to obtain it through competition.The success probability of each empire is given by the formula (3) [27] and form the vector P as the formula (4) [27].A vector R with the same size as P whose elements are uniformly distributed random numbers is created as the formula (5) [27].Then vector D is created by subtracting R from P, as the formula (6) [27].The empire whose relevant index in D is maximized will obtain the mentioned colony at the end.

R = [
] where U(0,1) and 1 There is just one empire left or a preset maximum number of iterations is reached is usually utilized as the termination condition of the algorithm.The competition proceeds until the termination condition is met.The weak empire gradually loses its colonies and the mighty empire occupies more and more colonies.The empire loses all its colonies will be collapsed.The final residual imperialist stands for the solution.
The pseudo code of the basic ICA is shown in Figure 1.

Approach to Discretize the ICA for TSP
Since the basic ICA is proposed for numerical function optimization, when it is utilized to solve TSP, some detail rules in the algorithm should be modified.

Generate Initial Population and Initiate Empires
The discrete ICA we propose starts with a randomly generated initial population of size N also.The only difference is that here a country represents a tour.We use a randomly arranged integer sequence to represent a country.There are n integers from 1 to n in the sequence, each integer represents a city, appears only once and the order of them represents the order of the visited cities.For example, in a 4-cities-TSP, the sequence (1,4,3,2) implies that the tour starts from the city 1 to city 4, then goes from city 4 to city 3, then goes to city 2, finally returning from city 2 to city 1.The cost of a country is the total length of the tour it represents.Because of the aim is to find out the shortest tour, a country which represents a shorter tour is better, so the power of a country can be directly defined as the reciprocal of its cost.
At the process of forming initial empires, we are required to assign the colonies to the imperialists.here we define that this assignment is according to the formula (7), in where the N denotes the size of the initial population, the m denotes the number of imperialists, N and m can be set freely according to the size of the TSP to be solved, the k j denotes the number of colonies assigned to the jth imperialist and the f j denotes the cost of the jth imperialist.

The Modified Assimilation Process
In the assimilation process, colonies obtain information from and adjust themselves to keep consistent with the relevant imperialist.This process can be viewed as a learning process of the colonies from the imperialist.Basing on the country encoding method, we redefine the detail rule of the assimilation process as follows: A subsequence is randomly chosen from the relevant imperialist, and a position is randomly chosen from the colony.Then, the mentioned subsequence is inserted to the mentioned position.Finally, the cities which are included in the subsequence are deleted from the part coming from the previous colony.This process is shown by Figure 2, in where the tour (3, 1, 5, 2, 4, 6) is a hypothetical tour just used as an example.The subsequence (1 5 2) is chosen from the imperialist and the position between city 5 and city 3 is chosen from the colony.The subsequence (1 5 2) which may include effective information, is transferred from the imperialist to its colony after the assimilation process.The imperialist: The colony before: The colony after:

The Modified Revolution Process
Obviously, we can achieve the revolution process by replacing the randomly selected colonies with an equal number of new randomly generated countries, like the method in the basic ICA.However, here, in order to enhance the ability of the proposed algorithm further, we introduce the 2-opt algorithm [37] into the revolution process.
Due to its simplicity and effectiveness, the 2-opt algorithm is probably the most widely used local search approach for solving TSP.It can be applied to an arbitrary initial tour, and searches the shortest tour by changing the visiting order of cities, but the 2-opt algorithm often takes a very long time, especially when it is applied in a larger number of candidate tours.
Figure 3 shows an illustration of the 2-opt algorithm.Here, the tour (A-B-F-E-C-D-H-I-G-A) presents an example tour before using 2-opt algorithm.Firstly, the length of this tour is calculated.Then a link A-B and another link C-D are selected out.A new tour is generated by linking A and C, B and D, respectively.If the new tour ( A-C-E-F-B-D-H-I-G-A) is shorter than the old tour, then, the new tour is accepted.The above procedure is replicated for all links between each two cities until there is no more decrease of the total tour length.Our way goes as follows: for every empire, take out a part of colonies randomly from its colonies, apply the 2-opt algorithm to them, and replace them with the improved.Because the revolution process is applied to a few countries, introducing the 2-opt algorithm into it will not take a very long time.
The pseudo code of the proposed algorithm is shown in Figure 4.It is similar to the pseudo code of the basic ICA, but is different on the specific operations of the step 1, step 2 and step 3.

Experiments Settings
In order to verify its effectiveness, we test the proposed algorithm on 12 standard benchmark instances (listed in the Table 1) from the TSPLIB [38].The first 10 instances are small-scale problems, with sizes ranging from 51 to 150 cities, and the last two are large-scale problems, whose size is 1323 and 1400 respectively.To avoid the effects caused by the randomness of the algorithm, the experiments for the former eight instances are repeated 20 times independently, the experiments for KroA150 and KroB150 are repeated 10 times independently, and the experiments for the last two instances are repeated 5 times independently, considering the consumption of time.As the calculation method of the TSPLIB, the distance between two cities is computed using Euclidean distance equation and rounded to an integer.The proposed algorithm is coded in MATLAB R2010b.All the experiments are finished on a PC with Core 2 Duo at 2.2 GHZ, 2 GB RAM and Windows Vista Home Basic Operating system.In our tests, the revolution rate is set to 0.3 and the ξ is set to 0.1.We specify a maximum number of iterations for each test.The algorithm stopped after getting to the iterations number.The number of initial countries, initial empires and iterations set for every instance are shown in Table 1, represented by "Num.C", "Num.E" and "Num.Ite" respectively.Larger scale TSP means higher solving difficulty, so we set more population size, more empire numbers and more iterations numbers for the larger scale TSP.Note that the parameters we listed here may be not the best.Actually, in our previous experiments, we found that the proposed algorithm is not very sensitive to the initial parameters.
In order to examine the role of 2-opt algorithm in the proposed algorithm (abbreviated as DICA1 in the following), another discrete ICA (abbreviated as DICA2 in the following) is also tested on the mentioned instances for making a comparison.In the DICA2, the assimilation process is the same as that in the DICA1, but the revolution process is achieved by replacing the randomly selected colonies with an equal number of new randomly generated countries.For fairness, the parameters set in the DICA2 are same as those in the DICA1.
Table 2 shows the experimental results.The column "opt" represents the length of the known optimal solution of every instance.The columns "Best", "Worst", "Ave" and "StD" represent the best, the worst found result, the average and the stand deviation of the results for every instance, respectively.The column "N 1% " denotes the number of the found results that are within 1% deviation of the optimality over the experiments for every instance.The last column "Ave.time"represents the average running time for every instance.The bold data in the table are better.

Discussions of the Results Obtained by the Proposed Algorithm
It can be seen from Table 2, for the former nine instances, the proposed algorithm (DICA1) found the known optimal solution, and for last three instances, though the known optimal solutions are not found, the best result found by the proposed algorithm are very close to the known optimal solutions.Their deviations with the corresponding known optimal solution are only 0.0421%, 1.0311% and 2.4544%, respectively.The average of the results for every instance is also quite close to the known optimal solution.Only for eil101, pr1323 and fl1400, the deviation with the known optimal solution exceeds 1%.For all the former ten instances except eil101, the probability of finding a solution which is within 1% deviation with the known optimal solution can reach more than 80%, especially, for berlin52, pr76, kroA100 and kroB150, it reaches 100%.In addition, for berlin52, the proposed algorithm found the known optimal solution in every test.

Discussions of the Role of 2-opt Algorithm
From Table 2, Figures 5 and 6, it can be seen that, compared with the DICA1, the convergence rate of the DICA2 is slower, and the results it obtained are also worse.In the earlier stage of iterations, the convergence rate of the DICA2 is acceptable, but in the later stage of iterations, it stagnated at a solution which is very poor.The cause of this phenomenon is that in the earlier stage of the iterations, the individuals in the population are diverse and generally bad, it is very easy to find a solution which is better than the current best solution in the assimilation process, in the revolution process and in the competition process; but with the increase of the number of iterations, all the individuals in the population become more and more similar with the imperialist, the diversity of population decline, relying on the revolution process which using randomly generated countries to obtain a solution which is better than the current best solution is very difficult, so the DICA2 very easily stagnates at a very poor solution.
In DICA1, the revolution process is achieved by improved some randomly selected colonies by the 2-opt algorithm.Due to its strong local search ability, the 2-opt algorithm can greatly improve the quality of a colony, using this mechanism can easily find a solution which is greatly better than the current best solution.Meanwhile, the mechanism of the DICA1 can quickly replace the new find best solution to the position of the imperialist, and then to guide the further evolution of the entire population.So its convergence rate is very fast and the solutions it obtained are very good.
The revised assimilation makes it possible that utilizing the original ICA to solve TSP, and the revised revolution combined with 2-opt algorithm ensures the algorithm to find a superior solution quickly.
Furthermore, it can be seen from the last column "Ave.time", when the scale of TSP is small, using 2-opt algorithm would not significantly increase the time consumption.When the scale of TSP is large, the time consumption increases obviously.The main reason is that the 2-opt algorithm costs more time when applied to solve large-scale TSP.

Compared with Other Two ICA-Based Algorithms
The results obtained by the DICA1 are compared with that obtained by other two ICA-based algorithms for solving TSP.One is proposed in literature [34] (abbreviated as OICA in the following) and another is proposed in literature [36], combined with tabu search (abbreviated as ICATS in the following).The comparison is arranged in Table 3, in where the column "Best.Err" and "Ave.Err" represent the percentage deviation of the best result and the average of the results over the known optimal solution, respectively, calculated as the formula 8, the "NA" represents that the data is not given in the corresponding literature.The bold data in the From Table 3, it can be seen that the performance of the OICA is the worst in the three algorithms.On every instance, it cannot obtain the known optimal solution.The performance of the ICATS is centered in the three algorithms, though it can obtain the known optimal solution for every instance, but the average of the results obtained by it for every instance except pr76 is worse than that obtained by the DICA1.The performance of the DICA1 is the best in the three algorithms.

Compared with Other Six Heuristic Algorithms
Meanwhile, the results are compared with that obtained by the particle swarm optimization (PSO) [19], the bee colony optimization (BCO) [6], the self-organizing Neural Network (NN) [20], the improved ACO with Pheromone Correction Strategy (ACO+SEE) [14], the generalized chromosome genetic algorithm (GCGA) [25] and the genetic simulated annealing ant colony system with particle swarm optimization techniques (GSAP) [22], shown in Tables 4 and 5.The meanings of the fields in Tables 4  and 5 are same as those in Table 3.More intuitive comparisons are shown in Figures 7 and 8. From Table 4, Table 5, Figure 7 and Figure 8, it can be seen that, when compared with the PSO, the BCO, the ACO+SEE, the NN and the GCGA, the proposed algorithm not only found the known optimal solution that others succeeded, but also found that the others failed.In addition, for kroB150, though all the four algorithms (the PSO and the ACO + SEE have not been tested on kroB150 in the literatures) failed to find the known optimal solution, the proposed algorithm obtained a best result.For rl1323 and fl1400, the proposed algorithm shows greater performance than the NN (other four algorithms have not been tested on rl1323 and fl1400 in the literatures).Furthermore, for every instance, the deviation between the average of the results obtained by the proposed algorithm and the known optimal solution is much lower.When compared with the GSAP, for eil76, all the two algorithms found the known optimal solution while the average of the results obtained by the GSAP is slightly better.For eil101, the proposed algorithm found the known optimal solution while the GSAP failed, but the average of the results obtained by the GSAP is slightly better.For kroB150, the proposed algorithm failed to find the known optimal solution while the GSAP succeeded, but the average of the results obtained by the proposed algorithm is better.For fl1400, the best solution obtained by the GSAP is slightly better, but the average of the results obtained by the GSAP is worse.For the remaining instances, the proposed algorithm shows better performance on the best result and the average of the results than the GSAP.Comprehensively speaking, the performance of the proposed algorithm is much better than the PSO, the BCO, the NN and the GCGA, and slightly better than the GSAP.The proposed algorithm is excellent.

Conclusions and Further Works
A discrete imperialist competitive algorithm for TSP is proposed.It retains the basic flow of the original, redefines the assimilation and the revolution and introduces the 2-opt algorithm into the revolution process.The proposed algorithm is excellent, proved by the experiments on some benchmark problems and the comparisons with other six algorithms.Future research should be focused on enhancing its performance and applying it on larger-scale TSP and other combinational optimization problems.
. = Cost imperialist + ξ mean Cost colonies of empire 

Figure 1 .
Figure 1.The pseudo code of the basic imperialist competitive algorithm (ICA).

Figure 2 .
Figure 2.An example of the redefined assimilation.

Figure 4 .
Figure 4.The pseudo code of the proposed algorithm.

Figure 5 .
Figure 5. Trend lines of the two algorithms on rl1323.

Figure 6 .
Figure 6.Trend lines of the two algorithms on fl1400.

Figure 7 .
Figure 7.Comparison between the best results obtained by several algorithms.

Figure 8 .
Figure 8.Comparison between the average results obtained by several algorithms.

Table 1 .
The parameters set for every instance.

Table 2 .
The results of the experiments.

Table 3 .
table are best.Compared with two other ICA-based algorithms.

Table 4 .
Compared with the particle swarm optimization (PSO), the bee colony optimization (BCO) and the Neural Network (NN).

Table 5 .
Compared with the improved ACO with Pheromone Correction Strategy (ACO + SEE), the generalized chromosome genetic algorithm (GCGA) and the genetic simulated annealing ant colony system with particle swarm optimization techniques (GSAP).