Modified Discrete Firefly Algorithm Combining Genetic Algorithm for Traveling Salesman Problem

The Firefly Algorithm (FA) has a few disadvantages in solving the constrained global optimization problem, including that it is difficult to produce initial population, the size of relative attractiveness has nothing to do with the absolute brightness of fireflies, the inertia weight does not take full advantage of the information of objective function, and it cannot better control and constrain the mobile distance of firefly. In this paper, we propose a novel method based on discrete firefly algorithm combining genetic algorithm for traveling salesman problem. We redefine the distance of firefly algorithm by introducing swap operator and swap sequence to avoid algorithm easily falling into local solution and accelerate convergence speed. In addition, we adopt dynamic mechanism based on neighborhood search algorithm. Finally, the comparison experiment results show that the novel algorithm can search perfect solution within a short time, and greatly improve the effectiveness of solving the traveling salesman problem, it also significantly improves computing speed and reduces iteration number. also adopts


Introduction
Traveling salesman problem (it is abbreviated in TSP) [1] is an important combinational optimization problem in the area of mathematics. It belongs to Non-Deterministic Polynomial (NP) problem. Although there are some precise algorithms which can be used to solve the problem, the principle of precise algorithms is complex, and it can produce "combination explosion problem" along with the increase number of city, therefore, the domestic and foreign scholars have been trying to seek a highly efficient and stable algorithm for solving this complex problem. For small size TSP [2], Branch and bound method, greedy method and cutting plane method are often used to solve these problems. But for big size TSP, it is difficult to use above methods. Therefore, the domestic and foreign scholars have been trying to seek a highly efficient and stable algorithm for solving this complex problem. Firefly algorithm (FA) [3] is one of heuristic search algorithms based on swarm intelligence, which was proposed by YANG [4] in 2010. FA [5] is based on the self-organization of the swarm simulation model with the advantages of less setting parameters, strong robustness, and has been applied in many fields. Li et al. [6] showed that firefly algorithm was introduced to solve this problem, and a series of discrete operations were conducted to adapt to it. Yin et al. [7] proposed discrete artificial bee colony algorithm for TSP. Zhang [8] presented a novel firefly algorithm for solving the nonlinear equations problem.
The above methods almost are used for solving continuous domain optimization problems. However, FA is relatively few used in the aspect of discrete domain application. To improve the performance of TSP solution, we propose improved discrete FA through redefining distance of firefly algorithm by introducing swap operator and swap sequence which better coordinates and balances the search process of FA algorithm. To facilitate the description, this paper also gives some definitions. We present a new dis crete FA with genetic algorithm (GA) for traveling salesman problem. This new scheme takes neighborhood search algorithm into consideration. Finally, we conduct some experiments to verify its performance. The results show that the new algorithm has a good effect on solving TSP.

The Firefly Algorithm
Fireflies emit fluorescence signal in the nature. From the point of biology view, its role is to attract the opposite sex and get copulation, reproduction chance, sometimes for predation. Firefly uses fluorescence signal within a certain range to attract companion in FA, eventually it makes most fireflies gather in one or more locations, and realize the position optimization.
Fireflies attract companies mainly depending on fluorescence intensity and att raction degree. Fluorescence intensity depends on the target value of its own location. The better target value is, the high fluorescence intensity is. Attraction degree has closely relationship with fluorescence intensity. Brighter fireflies have higher attraction intensity, which can attract weaker fireflies moving towards to it. In addition, it should take physical properties into consideration in FA. Fluorescence intensity and attraction degree are in inverse proportion of the distance among fireflies. Namely, fluorescence intensity and attraction degree will decrease with the increase of distance.
Fireflies mainly obey the following rules: a. firefly moving direction is determined by the fluorescence intensity, it always move towards to the brighter fireflies. b. the firefly moving distance is determined by the attraction degree.
This paper defines firefly fluorescence intensity and attraction degree as follows.  Where 0  (maximum attraction degree) is attraction degree of firefly when 0  r . According to definition 1, every firefly uses roulette method to move towards to the individual with higher fluorescence intensity. On the basis of definition 2, each firefly can determine the movement distance. By constantly updating its location, it ac hieves the purpose of optimization. Definition 3. Location updating formula of firefly i attracted by firefly j .
This formula is composed of three parts. First part, i x denotes current position of firefly i . Second part, denotes the distance firefly i moving to j . Third part, there is disturbance mechanism when location updating to avoid fireflies prematurely falling into local optimal solution.
is random factor and obeys uniform distribution.

The Modified Firefly Algorithm for TSP
We first use genetic algorithm to initialize population generation. Assuming that initial group size is m , and it randomly generates m individuals. The i-th is t i X . For each individual, When we solve TSP by FA, we should know distance and light intensity absorption coefficient. Then it updates location through formula (1,2,3) to realize optimizing. We apply serial number coding method into FA to solve TSP in this paper. Because TSP is a combinatorial optimization problem, we should first definite discrete variable distance, then we present discrete variable location updating formula and its disturbance mechanism. Finally, we give the solution step based on discrete firefly algorithm for solving TSP.
In this section, we introduce the following new definitions.
Definition 4. Assuming that solution sequence of n nodes TSP is ) ( is the new solution after operation with swap operator. Example 1. There is a five nodes TSP, its solution is Definition 5. Ordered queue of one or multiple swap operators is called a swap sequence.
 is swap operator. Definition 6. Different swap sequences act on the sane solution that may generate the common new solution. Therefore, all the same effect swap sequences set is called equivalent set of swap sequence. Definition 7. In the equivalent set of swap sequence, the swap sequence with minimum swap operators is the basic swap sequence in equivalent set.
Space distance between fireflies can be calculated by Euclidean distance when solving optimization problems of continuous variables. However, when solving TSP, solution is discrete variable, so it cannot use Euclidean distance. In this paper, we definite space distance: Where A is swap operator number of two fireflies in solution vector basic swap sequence. N is the cities number. After getting r , fluorescent brightness of firefly can be calculated by formula (1). Therefore, each firefly can move towards to other individuals with higher fluorescent brightness based on roulette wheel method. Firefly movement distance can be calculated according to attraction degree when solving optimization problems of continuous variables. However, when solving TSP, movement is discrete variable, so we definite the distance between firefly i and j : Location updating by formula (6): When solving the TSP, in order to avoid the firefly algorithm falling into local optimum, this paper defines the disturbance mechanism of discrete variables based on variable neighborhood search algorithm. It adopts several neighborhood structure forms to search optimization solution, systematacially changes its neighborhood so as to expand the search scope, enhance the ability to jump out of local optimal.
In this paper, we adopt three neighborhood structures to solve TSP.
The detailed process of the proposed discrete firefly algorithm is as follows: Step 1. Initializing the swarm. Set parameter firefly number m , light intensity absorption coefficient  , maximum iteration number max T .
Step 2. Randomly initializing solution sequence of each firefly. Calculating objective function i P and maximum fluorescent brightness 0 Where g P is the current searched optimal solution.
Step 5. Choosing the three neighborhood in variable neighborhood search method based on a certain probability. Repeat executing n iteration. Selecting position with optimal objective function as the current position of firefly.
Step 6. According to updated position of firefly, re-compute objective function i P and make a comparison with current optimal position g P . If function is better, then update g P .
Step 7. Whether the process satisfies termination conditions or not. If YES, then finish and output results. If NO, return back step3.

The effect of Light Intensity Absorption Coefficient  on New Firefly Algorithm
The light intensity absorption coefficient  is the main parameter in new firefly algorithm with GA (abbreviate in FGA). We make simulation experiments to analyze the effect of  on performances of algorithm solution under the MATLAB platform. We adopt different  to conduct experiments under the other same parameters conditions. Setting maximum iterations   Table 1 we can know that when  gradually increases, the solution performance is little-changed. When  =0.01, 0.02, 0.03, 0.04, 0.06, 0.09 and 0.11, FGA gets the best solution, 7.53436×10 3 . And  =0.03, average value is 8.00774×10 3 and standard value 2.07446×10 2 which is the minimum value. But as a whole, when  =0.03, FA has a better solving performance, which is the best value for FGA. The effect of different  on FA is not obvious. So this is one of advantages for FGA.

The Comparison Experiment
In order to further verify the feasibility and effectiveness of this paper's method, we choose multiple instances in international universal test library for testing, and use testing results to make a comparison to spanning tree algorithm (STA) [9], Improved Ant Colony Optimization [10](IACO).
In  Table 2.  Table 2, STA algorithm gets the known optimal solutions in Berlin52, Oliver30 and Eil51, which is close to FGA. But iteration number of FGA has reduced by 98percent. What's more, steps of FGA are not complicated. The average value has increased by 0.6% (Not exceed 0.6%). Compared with IABC algorithm, the best value and average value is relatively small, and for Bays29, Oliver30 and Dantzig42, the standard deviation is smaller. For the four instances, the running time of FGA has saved by 97.1%, 98.2%, 98.8% and 98.99% respectively.
FGA algorithm also can obtain the results closely to known optimal solutions for all instances. For Oliver30 and Bays29, FGA algorithm gets t he same results as known optimal solutions. For Dantzig42, calculation result of FA algorithm has decreased by 19.3% compared with IABC algorithm. Figure 1-3 show the experimental simulation diagram of Oliver30, Dantzig42 and Berlin52.
The average value of FGA algorithm is relatively small compared with IABC algorithm for Oliver30, Dantzig42 and Bays29. IABC algorithm is mainly based on the STA algorithm and has combined with other operations. When the number of population in IABC is equal to that in STA, the running time in IABC is closely to that of STA at least. Nevertheless, the running time

Conclusion
This paper proposes a new discrete firefly algorithm for solving TSP problem. It extends continuous artificial swarm (especially FA) optimization algorithm to discrete domain. The new algorithm makes some definitions based on swap operator and swap sequence. It also adopts disturbance strategy based on variable neighborhood search method to increase search areas and improve the local refinement ability of the algorithm and the optimal speed. The experimental results show that the algorithm can find relatively s atisfactory solution in a short time and improve the efficiency of solving the TSP. In the future, we would find more effective firefly algorithms to improve optimum searching method and solve other combinatorial optimization problems.