A Hybrid Firefly Algorithm â€“ Ant Colony Optimization for Traveling Salesman Problem

. In this paper, we develop a novel method hybrid firefly algorithm-ant colony optimization for solving traveling salesman problem. The ACO has distributed computation to avoid premature convergence and the FA has a very great ability to search solutions with a fast speed to converge. To improve the result and convergence time, we used hybrid method. The hybrid approach involves local search by the FA and global search by the ACO. Local solution of FA is normalized and is used to initialize the pheromone for the global solution search using the ACO. The outcome are compared with FA and ACO itself. The experiment showed that the proposed method can find the solution much better without trapped into local optimum with shorter computation time.


Introduction
The traveling salesman problem (TSP) is a problem in combinatorial optimization studied in operational research, computational mathematics, and artificial intelligence.It can be described simply: a salesman need to find the shortest tour of visiting a set of cities and return to starting city such that each city is visited exactly once.An exact solution can be obtained by finding the possibility of all existing solutions.When a large number of cities is given, it will be hard to get the exact solution, thus, the TSP is NP hard problem.There has not been a reliable method to ensure the optimal solution.
Many methods have been developed to solve TSP such as branch and bound (Land and Doig, 1960), Lin Kernighan local search (Lin & Kernighan, 1973), heuristic search (Jiang et al., 2005), and dynamic programming (Jellouli, 2001).Besides, there are meta-heuristic methods have been proposed, such that GA (Braun, 1991), PSO (Clerc, 2004), ACO (Dorigo et al., 1996), and FA (Jati & Suyanto, 2011).These minimization problems of meta-heuristic methods allow solutions to be found closer to the optimum but with high cost in time.
One of meta-heurisctic methods is Ant Colony Optimization (ACO).ACO is an algorithm that mimics the behavior of ant colonies.ACO was first developed to solve TSP.ACO has distributed computation to avoid premature convergence.But, the more number of cities, the more number of ants and iterations required.Therefore, it converges to the optimal solution slowly.
Several methods are proposed to improve the convergence time of ACO method.Hlaing and Khine (Hlaing & Khine, 2011) adopted candidate set strategy and a dynamic updating rule to improve the convergence time of conventional ACO.While Hassan, et al (Hassan, et al., 2013) proposed a method that uses the concept of ant colony system together with the parallel search of genetic algorithm to obtain the optimal solution quickly for larger TSP problems.
Another method to solve TSP is using Firefly Algorithm (FA).FA is based on the flashing behavior of fireflies.On the application of TSP, each firefly represents one permutation solution.Each firefly moves toward a brighter firefly.Since, a firefly moves with no direction, FA easily trapped into local optimum.
In this regards to improve results and convergence time for solving TSP, we developed a practical combination strategy for two evolutionary algorithms (FA-ACO) based on the ant colony algorithm (ACO) and firefly algorithm (FA).FA is used for local search because of its fast convergence time to find the local solution.While ACO is used for global search to avoid the local optimum and find the optimal solution based on the local solutions by FA.In this way, we not only avoid local optimum situation but also get the better result with faster convergence time.

Traveling Salesman Problem
TSP can be stated formally as follows (Lenstra & Rinnooy, 1975).Given a finite set of cities N and element of distance matrix cij(i,j ϵ N) be the distance from city-i to city-j.The objective function is formulated by Equation (1), where π runs over cyclic permutation of N and π k (i) is k-th city reached by the salesman from city-i.If N={1,2,...,n} then an equivalent formulation is Equation (2), where v runs over all permutation of N and v(k) is k-th city of a tour.

Firefly Algorithm
Firefly algorithm (FA) is a meta-heuristic optimization algorithm and nature-inspired algorithm based on the flashing behavior of fireflies.FA was first developed by Yang (Yang, 2010) for solving continuous optimization problem.FA has adapted by discretizing to solve permutation problem.The evolutionary discrete firefly algorithm (EDFA) has been developed for solving TSP by Jati and Suyanto (2011).
FA uses the following three idealized rules: (1) All firefly are unisex.
(2) Attractiveness is proportional to their brightness and decreases as the distance increases.For any two flashing fireflies, the less bright one will move towards the brighter one.If there is no brighter one, then a firefly will move randomly.(3) The brightness (light intensity) of a firefly depends on the objective function.
The intensity of the light emitted by fireflies is affected by distance and the light absorption by air.Light intensity will decrease if the distance is farther.Similarly, the air will also absorb the light so that the light intensity will decrease again.These two factors that cause fireflies limited vision.

Representation of firefly
A firefly represents one permutation solution of TSP as illustrated in Figure 2. In the representation, an element of an array represents a city and the index represents the order of a tour.3 4 2 8 9 7 5 10 1 6  City  1 2 3 4 5 6 7 8 9

Light intensity
Light intensity is a value that represents the objective function of a problem.Since the objective function of TSP is to find a route with minimum distance, the light intensity is the invers of total distance produced by a firefly.A firefly which has less distance route, will have a brighter light intensity.Light intensity of a firefly x is calculated as Equation (3).

 
 

Distance
The distance between firefly-i and firefly-j can be defined as the number of different edges between them.The distance can be calculated by using Equation ( 4), where r is the distance between any two fireflies, A is the total number of different edges between two fireflies, and N is the number of cities. Equation (4) scales r in the interval [0,10] (Jati, et al., 2013).In Figure 3, four edges 2-8, 8-9, 9-7, 5-10 in firefly-i do not exist in firefly-j.By using Equation (4), we get the distance between firefly-i and firefly-j is 4.

Attractiveness
The attractiveness of firefly-j seen by firefly-i β(i,j) can be any monotonic decreasing function shown as Equation ( 5), where β(i,j) is the attractiveness of a firefly when seen by other firefly at distance r, β0 is the brightness (light intensity) of a brighter firefly, and γ is a fixed light absorption coefficient.

Light Absorption
Light absorption coefficient γ determine how fast the convergence of EDFA.It also determines the characteristics of the problems.If γ→0, then β(i,j) = β0.Thus, the attractiveness of a firefly will not decrease when viewed by another.Whereas if γ→∞, then the attractiveness of a firefly will be close to zero.In this case, a firefly cannot be seen.Hence, the selection of γ plays an important role because it will affect the attractiveness of fireflies.In the EDFA, the coefficient γ is in the interval [0.01, 0.15] (Jati, et al., 2013).

Movement
The movement of a firefly-i attracted to another more attractive firefly-j is determined by Equation ( 6), where i x is the step that must be taken by firefly-i to move toward firefly-j and A is the total number of different edges between two fireflies i and j.
  Since a firefly in EDFA has no direction to move and represents a permutation solution, it moves using inversion mutation.Thus, it does not deform the previous permutation.This movement makes existing solutions in the firefly are changed.Each firefly will move using inversion mutation for m times.It means, each firefly has m new solutions.After p fireflies move and produce pm new solutions, then the p best fireflies will be selected as the new population.
Figure 4 shows the inversion mutation of a firefly.Point P1 is start point of the inversion mutation.If a firefly moves randomly, P1 is determined randomly.If a firefly move towards another, P1 is determined by the first different edges of both fireflies.

Ant Colony Optimization
Ant Colony Optimization (ACO) is an optimization algorithm that mimics the behaviorof ant colonies.ACO was first developed by Dorigo (Dorigo, et.al, 1996) to find the shortest path.In the ACO, a total of m ants cooperate and communicate using pheromones.In order to solve TSP, each artificial ant has the following characteristics: (1) Ant chooses the city that will be visited based on the probability function called transition rules.The function depends on the cities distance and the amount of trail present on the connecting edge.(2) Ant is not allowed to visit the same city before a tour is completed.This will be controlled by the tabu list.(3) When an ant finish a tour, it lays a trail of pheromones on each edge (i, j) which have been visited.
Ants use substances called pheromones in communication among individuals.Ants would leave pheromones on the ground thus marking the path with pheromones trail.When there are other ants running randomly, the ants will be able to detect pheromones trail and decide a way that will be passed through the magnitude of probability.Then, the ants also left a trail of pheromones that magnifies the pheromone levels on the path.The more number of ants follow the trail, the more attractive the trail to be followed.Probability ants choose the path increase with the number of ants before choosing the path.Figure 5 represents the ants' movement.

Transition rule
Each ant is placed in a random departure city.Ants will visit one by one city using transition rule and produce a tour.Given N is the set of cities that N = {1, 2, …, n} and m be the total number of ants.Probability for ant-k from the city-i to city-j is defined as Equation ( 7), where τij (t) is the intensity of trail on edge (i,j) at time t, visibility ηij is the inverse distance (ηij = 1/dij) and Uk is the set of cities that have not been visited by ant-k.
The visited cities of each ant are saved in the tabu list.When a tour is completed, the tabu list is used to compute the ant's current solution.The tabu list is then emptied and the trail intensity is updated using global pheromone update rule.

Pheromone update
The pheromone update rule includes the evaporation on all edges and the addition of pheromones on the edges that are part of the tour.The shorter tour is produced, the more pheromones left by ants on the edges.It implies the edges with a lot of pheromones would be more desirable in the next tours.
After each ant produces a tour of n cities, the intensity of trail will be updated with the global pheromone update rules defined as Equation ( 8), where ρ is the coefficient such that (1ρ) represents the evaporation of trail between time t and t+n, and k ij   is the quantity of pheromones laid by ant-k on the edge (i, j) is formulated by Equation ( 9), where Q is a constant and Lk is the tour length of ant-k.The shortest route found by the ants is saved and the tabu list is emptied to save the cities on the next tour.This process will be repeated until maximum condition.

Hybrid FA-ACO
To minimize the time of convergence which is due to the high number of the agents and iterations, we proposed a hybrid method with the combination of FA and ACO with a lower number of ants and fireflies as possible.In this method, FA plays as local search and ACO used to find the global solution.FA is implemented to find a local solution because the FA has fast convergence capability.
Figure 6 shows the phase of the proposed method and explained as follows.Firstly, FA is implemented to find p local solutions of pm + p solutions.The local solutions is obtained by generating p random firefly as first population.Then, calculate the attractiveness of each firefly when seen by another firefly.Before that, calculate the light intensity and the distance between two fireflies.Each firefly finds the most attractive firefly and moves toward.A firefly will move m times using inversion mutation.Finally, there are pm + p solutions.Choose p best fireflies from pm + p solutions as a new population for next iteration.Secondly, in the end of FA's iteration, there will be p local solutions.From the p local solutions, do normalization by finding q different representations of firefly as candidate tours.Fireflies which have the same permutation solution will be counted as a single solution.Then, set initial trail of pheromone by adding the pheromone on the edges which are part of the q candidate tours.Edges that belong to best solution normalization will get the most pheromone addition.Edges on second best solution get less pheromone than the first one.Thus, the most frequently passed edges on candidate tour will get the most pheromone addition.This initial trail will be used to run ACO.By setting the initial trail, it will be minimize the agents and iterations for ACO.Third, ACO implemented to find the global solution.The output is the shortest tour.The pseudocode of the proposed method is shown as Code 1. Table 2 shows the average solution and average time converge after running the experiments 10 times.From Table 2, average solution by FA is higher than ACO.To the fact that FA is easily trapped into local optimum.Meanwhile, hybrid FA-ACO get the lowest average solution for all problems.Related to average computation time, hybrid FA-ACO runs faster than ACO, but slower than FA.
For oliver30 problem, the parameter settings are described as follows: light absorption γ = 0.05, α = 1, β = 5, ρ = 0.05, and Q = 100.For running FA, we used 7 fireflies with 7 movements and 700 iterations.For runnning ACO, 30 ants and 500 iterations are required.While for hybrid FA-ACO, the local search by FA needs 4 fireflies with 4 movements and 400 iterations, the global search by ACO requires 20 ants and 300 iterations.
Figure 7 shows the comparison of convergence time among three methods for oliver30 problem and more detailed shown as Figure 8. FA has the fastest time convergence but the worst solution while hybrid FA-ACO get the best solution and faster convergence time than ACO.It means that FA has fast speed to converge but easy trapped into local optimum.These results clearly showed that hybrid FA-ACO can find the solution much better without trapped into local optimum with shorter computation time.

Conclusion
In this paper, we presented the hybrid FA-ACO method for solving the traveling salesman problem.The proposed method tries to combine FA for local search and ACO for global search.The local solution obtained by FA is used to initialize the pheromone for global search by ACO.The goal is to minimize the time of convergence with minimum number of the agents and iterations.
The experiment results showed that the hybrid FA-ACO is able to provide the better solution than FA and ACO.In our experiment, the proposed method can find the best solution without trapped into local optimum.In addition, it performs well with shorter computation time.

Figure 1
Figure 1 illustrated fireflies's movement.Each firefly represents one different solution initially.The closer to the optimum solution, the brighter the light emmited by fireflies.A firefly moves toward the brightest one.In the end, fireflies gather at the same solution.

Figure 1 .
Figure 1.Illustration of fireflies' movement 10 Order Figure 2. Permutation representation of TSP solution

Figure 3 .
Figure 3. Permutation representation of TSP solution

Figure 6 .
Figure 6.Phase of proposed method

Figure 7 .
Figure 7.Comparison of convergence time for oliver30