LCMFO: An Improved Moth-Flame Algorithm for Combinatorial Optimization Problems

— Combinatorial optimization problems (COPs) are challenging class of problems in the field of optimization. Permutations are preferred as solution representation scheme in most cases. Metaheuristic techniques can be used to look for good solutions for COPs with low cost. Moth-flame algorithm (MFO) is one recent population-based metaheuristic technique for continuous optimization problems. In this work improvement of MFO when used to solve COPs is studied. An improved version of MFO (called LCMFO) where Lévy-flight function is used to prepare initial solutions is proposed. Also crossover functions of genetic algorithms are used together with the basic technique of MFO to generate new solutions. Both MFO and LCMFO are tested with travelling salesman problem (TSP) as one popular COP. Experimental results show that there is a notable improvement of about 20-40% in the quality of solutions found by LCMFO over MFO only.


I. INTRODUCTION
Combinatorial optimization problems (COPs) are NP-hard problems [1], [2]. It takes time of an exponential order for an exact algorithm to find the optimal solution [3]. Many real-world instances belong to such discrete optimization class such as travelling salesman problem (TSP) [1], [4], [5], assignment problem [6], [7], constraint satisfaction problem [8], knapsack problem [9], minimum spanning trees [10], scheduling problems [11], vehicle routing problem [12], and others. For COPs it requires enumerating the whole combinatorial search space in a brute force manner if only optimal solution is required and nothing else. The most famous COP in literature is probably TSP. In TSP, one has to make a tour of cities, starting from a root city, passing by each city just once, then returning back to the root one. Solutions of TSP are best encoded as permutations of cities [13]. Here the optimal tour has the minimal total covered distance. Assuming that travels between any pair of cities are the same (i.e. symmetric TSP) and there is no constraint that may reject some tour then it easily noted that the size of the solution space is ! . This is considering the worst-case of TSP. However for large , asymmetric TSP and TSP with constraints have a search space of size Ω . Moreover, going beyond the brute force method and using tree-based algorithms [13] (commonly called branch and x methods including branch and bound, branch and cut, and branch and price) an exponential cost may result.
Besides exact methods of COPs, approximation algorithms such as metaheuristic techniques [13] found a great interest of the research community to solve different classes of optimization problems in a reasonable time. However, there is no guarantee of reporting one optimal solution by a metaheuristic algorithm but finding a near-optimal solution in a reasonable time may be accepted. Almost all metaheuristic techniques depend on real values in the range (0,1) to encode solutions of the studied problem. Also finding a new neighbourhood of a current solution follows a systematic way during the search. Thus there is a difficulty facing metaheuristic methods when solving COPs exemplified in the different encoding schemes for solutions generated by an applied technique as well as the final solutions of the problem (i.e. solutions required by the cost function to calculate the fitness). Mapping from a real-valued solution to a permutation one degrades the quality of generated solutions regardless of how much the mapping methods are good. This decreases the convergence rate of applied algorithm. Also the ability to overcome local minima areas in the search space becomes limited. Therefore it is worthy to investigate how a metaheuristic technique is improved when solving a COP.
From the dense forest of metaheuristic techniques [14], [15]and many others. We pick the Moth-flame optimization (MFO) algorithm of Seyedali Mirjalili [16] to solve various instances of TSP is selected. MFO is a recent population based algorithm that proved to have a high performance in different problems [17]- [19]. Like many metaheuristic techniques, MFO is inspired from nature. It is based on the navigation method of moths in light. Generating new candidate solutions is going through a systematic way using a mathematical equation modeling the moths' orientation. One approach of improving the quality of solutions for COPs is hybridization between metaheuristics with other metaheuristics or metaheuristics with exact methods as was well classified by Talbi [20] and Blum [21].
In this work, we adopt a different point of view to improve the performance of a technique like MFO for solving TSP problem. Instead of calling another technique for help in improving the quality of solutions generated by the original algorithm, we examine a kind of transplantation of good operators in MFO algorithm itself to get an improvement during the search process. Next subsection is illustrating our proposed approach.

A. Main idea of the proposed algorithm
In order to increase the ability of investigating new areas in the search space we think of using a perturbation operator from a totally different approach like the genetic algorithm. A crossover function [22]- [25] is used to move from current solutions to next stage solutions together with the systematic equations of MFO. Emerging generated solutions by a crossover function helps to escape from local minima which are highly expected if we follow the same method to look for new solutions during each iteration of the algorithm. We also use Lévyflight distribution function [26], [27] to reduce the effect of any probable bad initialization on the final reported solution. Lévy-flight function has proved effectiveness when used with many optimization algorithms [28]- [30]. In view of this, the proposed new technique is called Lévy-Crossover-MFO or LCMFO.
This paper is organized as follows. In section 2 the basic version of MFO algorithm is introduced. Section 3 sheds light on TSP. The proposed LCMFO technique is explained in section 4. Section 5 shows the experimental results of testing both MFO and LCMFO against standard TSP datasets. Finally Section 6 contains the paper conclusions

II. MOTH-FLAME OPTIMIZATION ALGORITHM
MFO is one recent member in the family of population-based metaheuristic techniques. As well introduced in [16], the main inspiration of the algorithm is the navigation method of moths at night. In MFO the candidate solutions are moths (i.e., moths form the search space) and the problem's variables are the position of moths in space. Best positions or best solutions so far are known as the flames. The set of moths is represented in a matrix as shown in Eq. 1 where is the number of moths and is the problem dimension. The corresponding fitness values for all moths are stored in an array as shown in Eq. 2. Flames are stored in a similar matrix as shown in Eq. 3. Also the array of Eq. 4 is used to store the corresponding fitness values of flames. The logarithmic spiral mechanism used to update moths with respect to a flame is illustrated by Eq. 5 that updates the -th moth, Eq. 6 that indicates the distance between the -th moth and -th flame, and Eq. 7 determines the decrement rate of flames along the search depending on the maximum number of flames , the maximum number of iterations and current iteration number . MFO has a few internal parameters that control the shape of the search path like a constant and a random number in the range 1,1 . Fig. 1 summarizes the general steps of MFO (as given in [16]) which incorporates initialization of solution, updating solutions and the termination criteria. Update flames positions and their fitness. end Update the positions of best flame so far and its fitness. Set the moths as the previous population. for all population of moths Calculate the distance to the corresponding flame using Eq. 6. Update moth positions with respect to its corresponding flame using Eq. 5. end end

III. Traveling salesman problem (tsp)
This problem has various formulations in literature. Probably, the most famous one is representing the problem as a graph [31]. A non-directed graph representation means that there is symmetry in distance between each pair of connected cities. If distances differ when reversing the direction between any pair of cities then this is equivalent to a directed graph. Also, it is obvious to consider this problem as a permutation-based one as we are looking for the optimal order of cities.
Whatever the current dataset of the problem represents a directed or undirected graph, the solution of TSP can be always expressed as a permutation. The optimal solution is that one with a minimal length of a complete tour or a Hamiltonian cycle. TSP starts from a node called depot and salesman visits all cities (each city visited only once) and returns back to the starting node [32]. Adjacency matrix (square matrix) is used to represent TSP instances. Given cities and the distance between each pair of cities where = (undirected graph). Distance between each pair of connected cities is Euclidean distance and is computed in Eq. 8.
are the dimensions of the -th city in dataset. Let denote a permutation of cities then the cost of a TSP solution as ≔ ₁ , ₂ , ₃ , … . is computed in the cost function [33] as given in Eq. 9: , , Eq. 9 In Eq. 9, the distances between adjacent cities in the solution, i.e. , starting from , until , , sum up to the total cost of the current feasible solution. Thus, the minimal tells about the optimal solution.

IV. PROPOSED LÉVY -CROSS MOTH-FLAME OPTIMIZATION(LCMFO)
LCMFO used Lévy-flight function to produce a population of initial solutions. Lévy-flight function as suggested in [34] is implemented. Lévy-flights are another kind of random walks whose step lengths are drawn from Lévy distribution. Lévy-flights are more efficient than Brownian random walks in exploring a large-scale search space. This is due to the variance of Lévy flights [26]. We are also encoding a scheme to pass from a continuous space (real numbers) to a combinatorial space (a solution is expressed as a permutation of integer numbers [35]). Then fitness function is applied to generated permutations. We are using a crossover method as a perturbation operator to reproduce new solutions. Besides using the systematic way (or equations of update solutions) of MFO algorithm alone to generate new candidate solutions, crossover operator provides a totally different neighborhood generator. This makes a variance in solutions so as to increase exploration of the solution space for next generation [20], [36]. When applying crossover method to generated solutions by MFO we aim to escape from local minima that is highly expected due to following same steps for navigating search space. This leads to new promising areas in the solution space and allows for improvement of best solution so far.
Step length is 0 2 and Lévy-function is used to produce a set of candidate solutions as initial ones using gamma function as in Eq. 10.

B. Crossover Operation
Crossover operation means mating between a pair of solutions to generate a new pair [38]. A randomly selected cut point in parent solutions is determined and the tails of two parents are swapped to get new offspring [39] as in Fig. 2.

Parents
Off C. LCMFO Algorithm Figure. 3 summarizes general steps of proposed LCMFO. Initial population is generated using Lévy-flight function. Then initial population of moths is sent to the fitness function that applies required mapping steps to obtain a permutation-based solution and calculates the fitness.
In the first iteration of the algorithm, moths are the generated initial population. This population is sorted to form the flames. Moths represent the so-called previous population in the next iteration. The best solution so far is determined as the best candidate in the flames. Lastly, positions of moths are updated according to the corresponding flames. Next iteration starts by updating population size in terms of reducing the number of flames for the purposes of convergence. After that a crossover function is applied to flames with a predetermined probability 0 which decides whether to generate a third population or not. In the crossover function, a random value in 0,1 is generated each iteration and if then crossover operation is taking place between each two consecutive flames. The third generated population in the search travel is called crossflames. Now, a triple-population matrix of previous population, flames and cross-flames is sorted according to fitness. Only the top population can survive to be the new flames. The best solution so far is updated to the top one of the flames. Updated moths from first iteration become the previous population. And so on until the number of search iterations is exhausted. for all moths in current population Calculate the distance to the corresponding flame using Eq. 6. Update the moth positions with respect to its corresponding flame using Eq. 5. end end   POP_size in TABLE I). Real values of a solution were generated between two bounds, namely lower bound of -10 and upper bound of 10 (denoted as lb and ub in TABLE I respectively). A crossover probability of 0.01 was used (denoted as in TABLE I) and the step length of Lévy distribution β was set to 1.5. Each experiment is repeated for 10 of computer runs.
Fitness value of average of solutions and best solution in each run were reported as shown in  Reported results in TABLE VVI were also graphically plotted for more clarification about LCMFO algorithm behaviour. Fig. 4 shows a comparison between absolute fitness values of the average of solutions obtained by both techniques (column Value of Average in TABLE VIIVIII). Fig. 5 shows a plot of improvement ratio for both average of solutions and best solution (columns Improvement ratio of Average and Best in TABLE IXX) by LCMFO algorithm. Such figures also tell that the proposed algorithm behaves reasonably where the dataset with minimum improvement ratio on average has also the minimum improvement ratio for its best solution (namely Ulysses 16). Same observation holds for that dataset with maximum reported improvement ratio (namely Bayg 29).

VI. CONCLUSION
Although LCMFO algorithm decreased the speed of convergence rate of MFO yet there is still a change in solution with the increase of the number of iterations. LCMFO leads to obtaining more efficient solutions which are more close to the optimal one. In other words, LCMFO algorithm reduces the gap between quality of reported solutions and optimal one on the cost of speed of convergence. But this result may be considered quite fair regarding the difficulty of the problem under study like TSP. Moreover, mapping form continuous space to discrete space increase the challenge of applied search technique. It is obvious that the quality of an obtained continuous-values solution degrades after mapping it to a discrete form. It will be motivating to investigate other permutations-based problems in the class of NP-hard problems using LCMFO algorithm. Also, testing LCMFO with other mapping techniques (from continuous values into permutations) is of interest.