Solving TSP Using Various Meta-Heuristic Algorithms

—Real world problems like Travelling Salesman Problem (TSP) belong to NP-hard optimization problems which are difficult to solve using classical mathematical methods. Therefore, many alternate solutions have been developed to find the optimal solution in shortest possible time. Nature-inspired algorithms are one of the proposed solutions which are successful in finding the solutions that are very near to the optimal. In this paper, Classical TSP (CTSP) along with its variant Random TSP (RTSP) are solved using various meta-heuristic algorithms and their performance is compared on the basis of tour length. Results show that the Nature-inspired algorithms outperform both Traditional and Evolutionary algorithms and obtain optimal solutions.

The Travelling Salesman Problem (TSP) [1] is a wellknown NP-hard Optimization problem whose goal is to find the shortest route possible for a salesperson to take in visiting N cities. This type of problem appears in many forms with some engineering applications that include Vehicle routing [2], scheduling problems [3], integrated circuit designs [4], physical mapping problems [5], and constructing phylo-genetic trees [6].
A large number of methods have been developed for solving TSPs. Few of them are Simulated Annealing [7], Tabu-Search Algorithm [8], Genetic Algorithm [9], Memetic Algorithm [10], Ant Colony Optimization Algorithm [11], Bee Colony Optimization Algorithm [12], Firefly Algorithm [13], Cuckoo Search Algorithm [14] and many more. Although Evolutionary Algorithms (EA) such as Genetic Algorithm (GA) and Memetic Algorithm (MA) are appropriate for solving difficult optimization problems, for which the traditional algorithms such as Simulated Annealing (SA) and Tabu-Search (TS) algorithms are less efficient, the EAs remain inefficient to find the optimal solution to TSPs.
Many approaches such as designing TSP-specific operators, incorporating local searches, and maintaining population diversity are considered to be promising ways to solve TSPs. These methods have been incorporated in Nature-Inspired algorithms such as Ant Colony Optimization Algorithm (ACO), Bee Colony Optimization Algorithm (BCO), Firefly Algorithm (FA) and Cuckoo Search Algorithm (CS) which efficiently prevent premature convergence of TSP.
This paper examines two classical, two evolutionary and four nature-inspired algorithms based on their qualities of their solutions and mechanisms by which edges that appear in a known optimal tour are preserved and added to obtain the minimized and optimized tour length.
Rest of the paper is organized as follows: Section II gives a detailed description of the Travelling Salesman Problem and its variant; Section III briefly discusses all eight algorithms used in this work; experimental results are shown in Section IV and finally in Section V the work is concluded.
TRAVELLING SALESMAN PROBLEM II.
The Travelling Salesman Problem (TSP) represents a large class of problems known as combinatorial optimization problems. These are difficult to solve using traditional methods and if solvable, computations tend to be very time consuming. Hence we settle for approximated results which in less time, end up giving a result that isn't necessarily the best tour, but instead a tour that is close to the best tour.
A form of the TSP was introduced by Euler in 1759 and later in 1948 Rand Corporation formally named and introduced it [15]. It defined the Classical Travelling Salesman Problem (CTSP) as a problem where starting from one city it is required by the salesman to visit every other city only once in a way that the total distance covered is minimized. As the number of cities increases, the complexity of the problem increases exponentially due to the number of possible solutions increased very heavily.
In this paper, CTSP and a variant of TSP named as Random Travelling Salesman Problem (RTSP) are solved using conventional, evolutionary and bio-inspired algorithms. The performances are compared on the basis of tour length. For CTSP, six available datasets on TSPLIB [16] are used and for RTSP, four datasets are randomly generated having all the city coordinates generated in a pre-defined range from 0 to 100.

META-HEURISTIC ALGORITHMS III.
Two classical (Tabu-search and Simulated Annealing), two evolutionary (Genetic and Memetic), and four nature-inspired algorithms (Ant Colony Optimization, Bee Colony Optimization, Firefly and Cuckoo-Search) have been used for comparison in this work. These are briefly described along with their pseudo codes in following section.

Simulated Annealing (SA) A.
Simulated Annealing (SA) is the oldest probabilistic meta-heuristic algorithm and one of the first algorithms having ability to avoid being trapped in local minima. It is inspired by the process of annealing in metallurgy. In this process a material is heated and slowly cooled into solid crystal state with minimum energy and larger crystal size to reduce defects in metallic structures. Once the system has cooled, the configuration will represent a sample at or close to a global optimum. Pseudo code of SA [17] for solving TSP is given as follows: Pseudo Code for SA-TSP Tabu search is an optimization technique for solving permutation problems. In this technique, we start with an arbitrary permutation and make a succession of moves to transform this permutation into an optimal one (or as close to the optimum as possible). In this particular setting, it is equivalent to starting with a randomly generated tour and making a succession of edge swaps trying to reduce the cost of the tour until we can find the minimum cost. Pseudo code of TS [18] for solving TSP is given as follows: Pseudo Code for TS-TSP 1. Generate a random dataset or add a standard dataset from TSPLIB; 2. Initialize population and clear the tabu list; 3. While (termination criteria not met) 4. Generate neighbours of the current seed solution by a neighbourhood structure 5. If aspiration criteria is not satisfied 6. Select the "best" neighbour which is not tabu is as new seed 7. Update the tabu list 8. Else Store the aspiration solution as the new seed and the best solution 9. Output Optimization result Genetic Algorithm (GA) C.
A genetic algorithm (GA) is a method for solving both constrained and unconstrained optimization problems based on a natural selection process that mimics biological evolution. The algorithm repeatedly modifies a population of individual solutions. At each step, the genetic algorithm randomly selects individuals from the current population and uses them as parents to produce the children for the next generation. Over successive generations, the population "evolves" toward an optimal solution. Pseudo code of GA [19] for solving TSP is given as follows: Pseudo Code for GA-TSP A Memetic Algorithm is a search technique inspired by Darwin's principles of natural evolution [19] and Dawkin's notion of a meme [20]. Meme is a unit of cultural evolution capable of individual learning. Every meme gains some experience through a local search before going in to evolution of new generations. Memetic Algorithm is also known as hybrid GA as it uses techniques inspired by natural selection such as mutation, selection, and crossover with the addition of local search. These techniques use same parameters as in GA added with the parameters of local search. Pseudo code of MA [21] for solving TSP is given as follows: Pseudo Code for MA-TSP 1. Generate a random dataset or add a standard dataset from TSPLIB; 2. Initialize the population of memes; 3. Optimize the population (apply local search); 4. Evaluate the population; 5. While (termination criteria not met) 6. Apply Selection; 7. Apply Crossover; 8. Apply Mutation; 9. Optimize population; 10. Evaluate and Update population;

Ant Colony Optimization Algorithm (ACO) E.
ACO algorithm mimics the behavior of real life ants and on how they interact with each other. The basic philosophy of the algorithm involves the movement of a colony of ants through the different states of the problem influenced by two local decision policies, viz., trails and attractiveness and two mechanisms, viz., trail evaporation and daemon actions. The algorithm aims to search for an optimal path based on the behavior of ants seeking a path PAPER SOLVING TSP USING VARIOUS META-HEURISTIC ALGORITHMS between their colony and a source of food. Thereby, each such ant incrementally constructs a solution to the problem. Pseudo code of ACO [22] for solving TSP is given as follows: Pseudo Code for ACO-TSP BCO algorithm is based on the food foraging behavior of swarms of honey bees. Honey bee colonies have a decentralized system to collect food and can adjust the searching pattern precisely in order to enhance the collection of nectar. The basic idea concerning the algorithm is that foraging bees have a potential solution to an optimization problem in their memory and this potential solution corresponds to the location of a food source and has an aggregated quality measure (i.e., value of the objective function). Pseudo code of BCO [23] for solving TSP is given as follows: Pseudo Code for BCO-TSP FA is a swarm-based algorithm based on the flashing behavior of fireflies. Fireflies or lightning bugs belong to a family of insects that are capable to produce natural light to attract a mate or prey. In firefly algorithm, a firefly population is placed in random locations in the search space where the fireflies represent a candidate solution. The flashing light of the fireflies is formulated in such a way that it gets associated with the objective function to be optimized. Pseudo code of FA [24] for solving TSP is given as follows: Pseudo Code for FA-TSP 1. Generate a random dataset or add a standard dataset from TSPLIB (as a part of initializing population of fireflies); 2. While (termination criteria is not met) 3. Find the most attractive firefly; 4. Move other fireflies towards it if in range; 5. Else move fireflies randomly; 6. Select the brightest fireflies representing the solution;

Cuckoo-Search Algorithm (CS) H.
CS is a population based optimization algorithm influenced by the parasitic behavior of the cuckoo bird whose female lays their eggs in the nests of other birds. In CS algorithm, a set of nests with one egg each are placed in random locations in the search space where the eggs represent a candidate solution. A search pattern called Levy Flights is used which is considered more efficient than random walks or Brownian motions. Pseudo code of CS [25] for solving TSP is given as follows: Pseudo Code for CS-TSP 1. Generate a random dataset or add a standard dataset from TSPLIB (as a part of initializing population of cuckoo nests); 2. While (termination criteria is not met) 3. Get a cuckoo randomly (say, i) and replace its solution by performing Lévy flights; 4. Evaluate its quality/fitness; 5. Choose a nest among n (say, j) randomly; 6. Replace j by the new solution if fitness value of i is more than fitness of j; 7. Abandon worse nests build new ones; 8. Keep the best solutions/nests; 9. Select the best nests representing the solution; EXPERIMENTAL RESULTS

IV.
All the eight meta-heuristic algorithms are implemented with some modifications in few parameters in order to adapt it to solve travelling Salesman problem. The experimental environment is implemented in MATLAB programs and executed on a DELL Studio15 Computer with the configuration of Intel Core I3 CPU M370 at 2.40 GHz and 4GB RAM. TSP datasets are standard TSP instances downloaded from TSPLIB for solving CTSP. For RTSP datasets are randomly generated. The algorithms run till the termination criteria are satisfied. More than one termination criteria in the model such as predefined number of iterations, stagnations in the result, time-limit etc. can be used but here stagnation in the result is used as the termination criteria. Results obtained are shown in table 1 and table 2 and are averaged over 25 runs of all the models for each data set. Table 1 and Table 2 show performance comparison of all the eight meta-heuristic algorithms for CTSP and RTSP respectively. For both the problems Cuckoo Search Algorithm emerged as a winner with best solutions. Also the bio-inspired algorithms performed much better than the other two traditional and evolutionary algorithms. Searching an optimal route for a TSP is very important to save time and cost. In this work, two classical, two evolutionary and four bio-inspired algorithms were implemented to find the best route for a classical and a random TSP. It was observed that the bio-inspired algorithms provide feasible methods for TSPs and can attain better performance than other methods. Results obtained also showed that the Cuckoo Search algorithm produces the best solutions in terms of tour length. It was also observed that further improvement in the bio-inspired algorithms could be done by fine-tuning their selfadaptive parameters and by using hybrid coding.

ACKNOWLEDGMENT
The author is thankful to Director, MSIT for his constant support and motivation for continuing the research work.