Finding the best tour for travelling salesman problem using artificial ecosystem optimization

This paper presents a new method based on the artificial ecosystem optimization (AEO) algorithm for finding the shortest tour of the travelling salesman problem (TSP). Wherein, AEO is a newly developed algorithm based on the idea of the energy flow of living organisms in the ecosystem consisting of production, consumption and decomposition mechanisms. In order to improve the efficiency of the AEO for the TSP problem, the 2-opt movement technique is equipped to enhance the quality of the solutions created by the AEO. The effectiveness of AEO for the TSP problem has been verified on four TSP instances consisting of the 14, 30, 48 and 52 cities. Based on the calculated results and the compared results with the previous methods, the proposed AEO method is one of the effective approaches for solving the TSP problem.


INTRODUCTION
The travelling salesman problem (TSP) problem is one of the famous optimization problems that arms to find the shortest tour among cities. The result of the TSP problem is the path that has the shortest length. Wherein, the best tour includes the starting and ending cities and passing cities, but all of them appear only once in the tour. The idea of the TSP problem has been applied in many fields such as paper cutting, computer wiring, routing, scheduling, social networking [1], [2]. However, the TSP problem is a complex problem with the number of feasible solutions up to n! for the problem with n cities. Therefore, it is required to have effective solutions for finding the optimal solution for the problem.  [3], the TSP problem has been solved by difference approaches consisting of the exacting methods such as branch-and-cut [4], branch-and-bound [5], Lagrangian [6] and the methods relied on the metaheuristic algorithms such as genetic algorithm (GA) [7]- [9], particle swarm optimization (PSO) [10]- [12], ant colony optimization (ACO) [13]- [16] cuckoo search (CS) [17], [18]. Generally, each group of approaches has certain advantages and limitations. For the exacting methods, the optimal solution can be obtained but it usually takes long running time while using the optimization algorithms, the near optimal solution can be gained with the relatively short computation time [19]. In addition, a point that deserves attention when using the optimization algorithms is the influence of control parameters on the obtained results. For each population-based optimization algorithm, the main control parameters to be set are the population size and the maximum number of iterations. These two parameters are usually chosen based on the size of the problem.
However, many algorithms need to adjust additional parameters other than the above aforementioned parameters such as GA, PSO and CS. In GA, the rates of selection and mutation needs to be set or in PSO the proportional coefficients related to the velocity of the individual must also be chosen, while the rate of mutation in CS has also to determine before executing to find the optimal solution for the TSP problem. Furthermore, choosing inappropriate values of these parameters can affect the calculation results. Therefore, when using these methods for the specific optimization problems, examining the effect of these parameters is a requirement that cannot be almost ignored. In this aspect, to eliminate the effects of additional parameters, using the algorithms with no additional control parameters is one of the solutions that deserves attention. In addition, an algorithm is not able to have the highly performance for all of problems. It can work well for a given problem, but it may get a bad result for another ones. Therefore, adding new approaches to difficult optimization problems like TSP should also be welcome.
This paper shows a new method for solving the TSP problem based on artificial ecosystem optimization (AEO). The AEO is inspired from the idea of the flow of energy in living organisms including production, consumption, and decomposition [20]. In comparisons with other algorithms, AEO has no additional control parameters and its performance compared to other methods has been demonstrated over the benchmark functions [20]. In order to improve the efficient of AEO for the TSP problem, the 2-opt local search technique has been equipped to adjust the created solutions. The proposed AEO method is used to find the shortest path of the instances including 14, 30, 48 and 52 cities. The obtained results are compared with the published studies. The novelty and the contribution of the paper can be summarized as: − AEO is the first proposed for solving the TSP problem. − The 2-opt local search technique has been added for AEO to improve quality of the candidate solutions. − The effectiveness of AEO has validated on the difference instances consisting of 14, 30, 48 and 52 cities. − The proposed AEO method is effective for the TSP problem compared with some previous methods in the literature. The paper is organized as follows: The introduction is discussed in this section. The TSP problem is presented in section 2. The application of AEO for the TSP problem is shown in section 3. Section 4 presents the experiment results of AEO for the instances. Finally, the conclusion is demonstrated.

TRAVELLING SALESMAN PROBLEM
Given cities and the coordinates of each city, the tour length among cities ] is determined as (1): where, ( , +1 ) is the Euler distance between the i th and ( + 1) th cities that is calculated as (2):

APPLICATION AEO FOR FINDING THE SHORTEST TOUR OF THE TSP 3.1. Solution description
In order to find the shortest tour for the TSP problem, each individual in the population is treated as a tour and each variable of the individual represents for a city. However, since each city can only be visited once or in other words, each city can only appear once in the candidate solution. Therefore, if each city is represented directly by the value of a variable, the random initialization and solution generation processes will not guarantee to create feasible variables. Therefore, in this study, each tour will be encoded as (3) where, is the th tour in the population with N candidate tours. is the real value of the th control variable in the range of [dow, up]. Noted that, the limit of all variables of the is the same. To determine the corresponding city of the variable , the variables of the are sorted based on their value. At that time, their order in the array that is sorted in ascending order represent the cities. For example the consisting 6 cities has the values of = [1.5, 6.3, 4.6, 5.7, 8.9, 4.0], the real tour of the is determined by _ = [1,6,3,4,2,5]. In which, the 1 st city is assigned for the first variable because it has the smallest value in the . The second variable of the has the highest value so its corresponding value in the _ is 6. This rule is applied for the rest of the variables.

Initialization
In order to find the shortest tour, the population of tours of AEO is randomly created as (4): where, , is the variable that represents for the th city in the th tour. Based on the , the value of the _ is determined as (5): where, is a function that sorts the array in ascending order. The equation (5) shows that the index of the variables in the tour is the corresponding city while , is the value of the variable in sorted in ascending order.

Move in the search space of the TSP
Since the coordinates of the cities are fixed, the search space of the control variables in the TSP problem is the order of the cities. In this paper, to create high quality solutions, AEO's solution generation process is combined with 2-opt technique [21]. The main idea of this technique is to cut the two edges of the tour and reconnect the two parts of the tour. If the length of the two lines connecting the two parts of the tour is less than the length of the two edges removed, the new tour will be selected to replace the current one. The detailed implementation steps of the 2-opt technique for creating a new solution are described by using pseudo-code. End if 8: For j = i + 2 to do 9: Set 2 = j and 2 = 2 − 1 10: If < then 12: Set = 13: Save 1 , 1 , 2 and 2 as the positions to swap the current tour 14: End if 15: End for j 16: End for i 17: Generate the new tour by swapping the current tour ( 1 : 2 ) = reverse ( ( 2 : 1 )) 18: Output: The new tour After performing the 2-opt procedure for adjusting the _ , the candidate tour is updated as (6): Each tour created and updated using the 2-opt technique is evaluated by the fitness function using the corresponding _ and (1) to calculate the length of the tour. Then the best so far tour with the shortest length is determined.

Generation of new tours
In the process of finding the best tour, AEO has two times of generating new population of tours. Wherein, in the first new population creation, the first new tour is generated as (7): where, 1,new is the first tour in the new population. is a randomly tour created by using (4). The new tours from 2 nd to N th are produced by using one of three ways as described in (8), (9) or (10). The probability that each equation used to create a new solution is equal to 1/3.
where, is a random tour selected randomly in the current population. The coefficient 1 is calculated as (11): where (0,1) is the standard distribution factor that has the average of 0 and the standard deviation of 1.
Then the new population of tours is validated by the fitness function (1). If the new tours are better than the corresponding ones, they are replaced for the current ones. The result is that the current population is updated. Whereas in the first new population creation, tours are produced using different techniques, at the second generation, all new tours ae created by the same mechanism as (12): where, 2~( 0,1). 1 and 2 are determined by (13): Then the new population of tours is validated by the fitness function (1) and the current population is updated one more time. Furthermore, the best so far tour is also updated at the end of this stage.

The steps of AEO for finding the best tour
The process of generating new populations, adjusting relied on the 2-opt procedure and updating the current population are implemented until the maximum number of iterations reaches. The details of steps for finding the best tour are presented below.

1:
Input: population size N, number of cities , maximum number of iterations 2: For i = 1 to do 3: Produce the ith current tour by using (4) 4: Determine the corresponding real tour by using (5) 5: Adjust the real tour by using the 2-opt procedure in Algoritm 1 6: Adjust the ith current tour by using (6) 7: Calculate the fitness value of the ith current tour by using (1) 8: End for 9: Set the current iteration k = 0 10: While < do 11: Produce the first new tour by using (7) 12: Adjust the first new tour by using (5), the 2-opt procedure and (6), respectively 13: For i = 2 to do 14: If rand < 1/3 then 15: Produce the ith tour by using (8)  16: Else if 1/3 < rand < 2/3 then 17: Produce the ith tour by using (9)  Produce the ith tour by using (10) 20: End if 21: Adjust the ith new tour by using (5), the 2-opt procedure and (6), respectively 22: Calculate the fitness value of the ith new tour by using (1) 23: End for 24: Update the current tours by comparing the fitness value of the current tours and the corresponding new tours in the population 25: For i = 1 to do 26: Produce the ith tour by using (12) 27: Adjust the ith new tour by using (5), the 2-opt procedure and (6), respectively 28: Calculate the fitness value of the ith new tour by using (1) 29: End for 30: Update the current tours by comparing the fitness value of the current tours and the corresponding new tours in the population 31: Update the best tour by comparing the fitness value of the best so far tour and the best one in the current population 32: End while 33: Output: The best so far tour

CONCLUSION
This paper presents the application of the AEO algorithm to the TSP problem. In which, to improve the search efficiency of AEO in finding the shortest tour for the instances, the 2-opt local search algorithm has been added for AEO to adjust solutions obtained from AEO. The effectiveness of AEO is verified on the instances consisting of Burma14, Oliver30, Att48 and Berlin52. Results obtained by the AEO are compared with the previous methods in the literature. The results show that, AEO has the better performance than PSO, ABC, ABC-RS, DIWO, SOS-SA, GA-PSO-ACO, LBSA, DFACO, DTSA and DSOS. Thus, AEO is a method that deserves attention in finding the shortest tour length to the TSP problem. For the future work, the AEO can be applied to larger-scale instances and real world applications.