Analysis of a Hybrid Whale Optimization Algorithm for Traveling Salesman Problem

DEMİRAL

Population-based meta-heuristics generally start with a random population or an initial heuristic and improve this population with the algorithm principle.Diversification and intensification are the fundamental features that try to diversify and intensify the algorithm to search for finding alternative solutions in the discrete space.Diversification means that the algorithm would hopefully find new solutions.Intensification expresses that the algorithm escapes from local-optima solutions, and finds near-optimal solutions.Meta-heuristics can be hybridized with other heuristics or be improved in new formats.Nature-inspired algorithms have been applicable in computer engineering, information technology, logistics, combinatorial problems, mathematics, and other fields of science (Kota and Jarmai, 2015;Cherkesly et al., 2016;Long et al., 2019) The whale optimization algorithm mimics the hunting behavior of humpback whales.In the exploration phase, humpback whales search for prey randomly.In the exploitation phase, humpback whales use the bubble-net behavior of humpback whales.Thus, the bubble-net attacking method is investigated in two distinct mechanisms.They are shrinking encircling mechanism and spiral updating position.WOA is an approach that was proposed for engineering applications in previous researches.It was successfully applied to the 0-1 knapsack problems, job-shop scheduling problems, traveling salesman problem, and discrete optimization problems (Algabalawy et al., 2010;Ahmed and Kahramanlı, 2018;Abdel-Basset et al., 2019;Hussein et al., 2019;Jiang et al., 2019;Luan et al., 2019).Although hybrid whale optimization algorithms have engineering applications in various fields, here includes a new application of WOA (WOA+NN) on TSP in this study.In this study, the WOA+NN is carried out to solve the traveling salesman problem (TSP).The traveling salesman problem is a challenging benchmark problem for evaluating the performance of the optimization algorithms.The discrete problem optimizes the tour length, visiting all cities exactly once and returning to the initial city (Hoffman et al., 2013).
The rest of the paper is organized as follows: In Sect.
2, the discrete problem (TSP) is clearly explained.The HWOA is briefly described in Sect.3. In Sect.4, the computational results of the algorithm are given in short, and lastly, Sect. 5 includes conclusion and future work.

TRAVELING SALESMAN PROBLEM
The traveling salesman problem (TSP) is an optimization problem that is widely applicable in engineering, mathematics, and other fields of science.Scientists have been working on the problem to solve it efficiently in competitive times (Elloumi et al., 2014).Various methodologies are proposed for the traveling salesman problem in which a salesman visits all the cities at once and comes back to the home at an optimal distance, optimal time, optimal budget, or other objectives.TSP is generally analyzed in two types that are defined by symmetric and asymmetric distance matrices (Osaba et al., 2016).In symmetric type (s-TSP), is valid for all points.In asymmetric type (a-TSP), the distance inequality   find optimal results in a polynomial time.In literature, there exist various exact, heuristic, meta-heuristic, improved, and hybrid methods to solve the variants of TSPs in reasonable times (Lin et al., 2003;Wei et al., 2014;Hatamlou, 2018).
To define TSP in a short form, the problem can be described as: N is the set of m cities, E is the set of the edges, and is the distance matrix that presents the Euclidean distance between cities i and j.
  is the permutation of the constructed tours.
1 n represents the first node (ver- tex); m n represents the last node (vertex) of all the per- mutations.Then, the mathematical model of the combinatorial problem is briefly given in Eq.1.
  The Euclidean distance is carried out to calculate the distance between nodes (vertices) using Eq.2.

HYBRID WHALE OPTIMIZATION ALGORITHM
The whale optimization algorithm (WOA) is one of the interesting algorithms in the literature.It is based on the hunting behavior of humpback whales.In the whale optimization algorithm, the humpback whales (whale population) are searching for the best positions and looking for the candidate preys in different ways (Mirjalili and Lewis, 2016).Therefore, they try to converge the near-optimal positions from random locations in the exploration phase using Eq. 3 and Eq.4.
(3) (4) where t declares the iteration number, C are defined in the following using Eq. 5 and Eq. 6.
(5) (6) where a is decreased from 2 to 0 depending on the iteration number.
is a random vector defined in [0,1].In the exploitation phase, the bubble-net attacking method is achieved by two mechanisms using the mathematical model described in Eq. 7. (7) The vectors  D and  ' D are defined according to the ex- pressions using Eq. 8. (8 where p is a random number in [0,1]. In discrete optimization as well as traveling salesman problem, the pure whale optimization algorithm does not give well-quality solutions by using Eq.3-8.Therefore, it is a need for improvement with a logical heuristic (Nearest neighbor algorithm-NN).Here, the k=1 is taken for the TSP application (k-NN) because of the most common use and sufficient optimal results for the optimization.In addition, the further analysis will be needed for the optimal "k" in the TSP application for these datasets.The comparison and results are very stunning when all the algorithms are compared with the WOA+NN for medium-scale traveling salesman problems.
In the light of Eq. 3-8, the pseudo-code of the WOA+NN with a dimensional space is shown in Figure 1 (Bozorgi and Yazdani, 2019).The new solutions are produced by the multiple neighborhoods during the optimization process of the algorithm.The logical operators generate candidate solutions (Szeto et al., 2011;Halim and Ismail, 2019;Demiral and Işik, 2020).In this study, two operators; swap and reverse are relatively intensified operators than insert and swap_reverse operators.Thus, insert and swap_reverse cause diversification in discrete solution space.Each operator is chosen and applied sequentially in each step.As literature declares, the use of multiple structures can be convergent and search feasible regions of the discrete space (Szeto et al., 2011;Halim and Ismail, 2019).To sum up, instead of using a single structure, it is expected to give optimal solutions when multiple structures are used.Then, the use of the best one is defined by the minimal result of the four neighborhoods using Eq. 9.
The hybrid algorithm (WOA+NN) converges to the optimal solution in short iteration numbers.That shows the use of combined structures is a robust, clear, and intelligent approach: random swaps (swap), random insertions (insert), reversing a subsequence (reverse), and random swaps of reversed subsequences (swap_reverse) at 200-3000 iterations.

COMPUTATIONAL RESULTS
The ten datasets ranged from 51 to 150 cities were selected from the TSPLIB library in the implementation.In this section, all the experiments were run on Intel® Core™ i7 3520-M CPU 2.9 GHz speed with 8 GB RAM by using Matlab.The algorithms which are WOA+NN, AS, WOA, GA, and SA are compared to demonstrate the performance of the WOA+NN.All the algorithms were run 10 times independently for optimal parameters and 200-3000 iterations for each run.The fundamental parameters are used in the application.In the SA algorithm, initial temperature (T0 =40000), cooling rate (r=0.80), and the iteration limit for temperature change (L=10-30) are sufficient for optimization.In GA, the crossover rate is 0.80, the mutation rate is 0.02.In WOA, the dimension of space (dim=10), a=2-(2*t/Tmax) is linearly decreasing function in both exploration and exploitation phases, random number for spiral updating position (l=[-1,1]), logarithmic spiral shape constant (b=0.1),coefficient vectors for updating position of whales; C=(r+0.9) 2 and A=a*(C-1) are chosen as optimal parameters.In AS (Ant System), # of ants=20, alfa=1, beta=5, evaporation rate ( = 0.7), Initial-Fer-emon=25.The population size is set to 100 for all the population-based meta-heuristics (GA, WOA, and WOA+NN).
Table 1 shows the experimental results and comparison between WOA+NN, AS, WOA, GA, and SA.In this table, the results are given as best, worst, average solution, standard deviation, and CPU Time.
As inferred from Table 1, it can be observed that the quality of the hybrid algorithm (WOA+NN) solutions is better compared to AS, WOA, GA, and SA for 50% of all datasets.Ant system (AS) is the alternative algorithm that outperforms other meta-heuristics for 40% of all datasets.Genetic algorithm (GA) is the optimal algorithm for only one dataset; pr76.Besides, in Table 2, the hybrid algorithm finds 21 optimal, AS finds 16 optimal, GA finds 3 optimal, SA finds never optimal solutions among 40 best results.In summary, Table 2 shows that the hybrid algorithm (WOA+NN) outperforms AS, WOA, GA, and SA for 53% of all optimal solutions.
at least one edge.Symmetric TSPs are solved in shorter times than asymmetric TSPs.Besides, there exist many variants of TSP, such as double TSP (d-TSP), multiple TSP (m-TSP), the traveling repairman problem, traveling purchaser problem, and vehicle routing problem.The traveling salesman problem (TSP) is non-deterministic and requires exponential CPU time during the optimization process.If large data size is used, the number of possible solutions increases and it will be impossible to

Figure 2 .
Figure 2. A set of optimal results found by the hybrid algorithm (WOA+NN)

Table 1 .
Computational results of algorithms on the medium-scale TSP instances