A New Approach Based on Collective Intelligence to Solve Traveling Salesman Problems

This paper presents a novel approach based on the ant system algorithm for solving discrete optimization problems. The proposed method is based on path construction, path improvement techniques, and the footprint mechanism. Some information about the optimization problem and collective intelligence is used in order to create solutions in the path construction phase. In the path improvement phase, neighborhood operations are applied to the solution, which is the best of the population and is obtained from the path construction phase. The collective intelligence in the path construction phase is based on a footprint mechanism, and more footprints on the arc improve the selection chance of this arc. A selection probability is also balanced by using information about the problem (e.g., the distance between nodes for a traveling salesman problem). The performance of the proposed method has been investigated on 25 traveling salesman problems and compared with state-of-the-art algorithms. The experimental comparisons show that the proposed method produced comparable results for the problems dealt with in this study.


Introduction
The solution of optimization problems with different characteristics, such as singleobjective and multi-objective discrete problems [1,2] or continuous problems [3,4], with meta-heuristic algorithms, is becoming increasingly common.Recently, swarm intelligencebased intelligent optimization algorithms have been proposed and successfully used.Swarm-based intelligent optimization algorithms are often the product of collective intelligence and populational behaviors.The ant system (AS) algorithm, which is a prominent type of swarm intelligence algorithm, was introduced by Dorigo, inspired by behaviors demonstrated by real ants between their nest and food source [5,6].The particle swarm optimization (PSO) algorithm was investigated by Eberhart and Kennedy in 1995, who were inspired by bird flocking and fish schooling [7,8].In 2005, Karaboga [9] introduced an artificial bee colony (ABC) algorithm that simulates the foraging and dancing behaviors of real honey bee colonies [10] for solving continuous optimization problems.In 2015, a tree-seed algorithm inspired by relationships between trees and their seeds was proposed for solving continuous optimization problems [11].A common feature of these algorithms is information sharing about solutions among individuals in the swarm while optimization problems are solved.For instance, artificial agents in AS leave pheromones for other following ants to track, and bees in ABC perform a peculiar dance in order to share position information about good-quality solutions.Potential solutions, called particles in PSO, are affected by the global best solution of the population for producing new solutions.While seeds are produced by trees, the relation between trees is used in the production procedure.Thus, the collective intelligence in these algorithms consists of sharing information and some peculiar behaviors.
The traveling salesman problem (TSP) is a well-known NP-hard problem in the operations research field which requires exponential time due to its solution depending on the number of nodes in the graph, and it can be simply described as follows: there is one salesman who visits n cities, and their aim to find out the shortest Hamilton cycle through which they can visit all the cities once and only once and finally return to the start [12].
x i,j is the arc between the i th and j th node, and the mathematical model of the problem is as follows: subject to ∑ n i=1 x i,j = 1, j = 0, 1, ..., n − 1 (3) x i,j ∈ {0, 1} and ∀i, j ∈ E where Equation ( 1) is the objective function, which is the minimization of the total distance for the problem, Equation (2) provides only one incoming edge to a node, Equation (3) provides only one outgoing edge to a node, Equation ( 4) prevents the occurrence of the subtours in the solution, and Equation (5) shows the integer variables.
The TSP is widespread in many applications, especially in engineering and operations research such as machine scheduling, cellular manufacturing, and frequency assignment problems [13].The literature on the TSP and its variants is extensive, and the reader is referred to the surveys in [14][15][16][17][18][19][20] and to the book [21].In order to solve TSPs, two different strategies in swarm intelligence or evolutionary computation algorithms have been used: path construction (PC) and path improvement (PI) strategies.PC-based methods, such as the greedy algorithm and Christofides algorithm, create solutions step by step.PIbased methods improve randomly generated initial solutions step by step such as k-opt, v-opt, and genetic algorithms [22,23].While the ant system uses a PC-based strategy for finding the optimum tour of the traveling salesman problem, ABC [24] and PSO [25] try to improve solutions with a PI-based strategy.In recent years, some other swarm intelligence algorithms have also been proposed for solving traveling salesman problems.Some of these algorithms are as follows: chicken swarm optimization [26], grey wolf optimizer [27], Jaya algorithm [2], bat algorithm [28], social spider algorithm [29], sparrow search algorithm [30], earthworm optimization algorithm [31], and Komodo algorithm [32].These studies show that traveling discrete optimization algorithms based on swarm intelligence still attract the attention of researchers.
Akhand et al. [33] proposed the discrete spider monkey optimization (DSMO) algorithm to solve the TSP in their study.They compared the results of their proposed DSMO method with the results of other methods in the literature.They stated that the experimental results show the effectiveness of the proposed DSMO method on TSP and that it is a suitable method for solving this problem.Mzili et al. [34] proposed the discrete rat swarm optimization (DRSO) algorithm for solving the TSP in their study.They compared the performance of the proposed DRSO method with the results of some meta-heuristic algorithms.As a result of the comparisons, they stated that the proposed DRSO method has a better performance.Zhang et al. [35] proposed an opposition-based ant colony optimization algorithm for solving the TSP in their study.They compared the results of their proposed method with the original ant colony (ACO).According to the results of the comparison, they stated that the ant colony optimization algorithm performed better.Gharehchopogh and Abdullahzadeh [36] proposed three new discrete crow-inspired algorithms to improve the performance of the original crow search algorithm for solving TSP.They compared the performance of the three proposed algorithms with the results of other algorithms in the literature.According to the results of the comparison, the proposed algorithms have significantly better performance.Al-Gafari et al. [37] proposed three new discrete crow-inspired algorithms to improve the performance of the basic crow search algorithm for solving TSP.They compared the performance of the three proposed algorithms with the results of other algorithms in the literature.According to the results of the comparison, the proposed algorithms have a significantly better performance.Liu et al. [26] proposed the discrete chicken swarm optimization (DCSO) algorithm for solving the TSP in their study.They compared the results of the proposed method with the results of basic ant colony optimization (ACO) and genetic algorithm (GA).According to the comparison results, they confirmed the applicability and effectiveness of their proposed method.Krishna et al. [38] proposed a spotted hyena optimizer (MH-SHO) algorithm hybridized with MapReduce for TSP.They compared the results of the proposed method with the results of the basic spotted hyena optimization (SHO), particle swarm optimization (PSO), ant colony optimization (ACO) and black hole (BH) algorithms.As a result, they concluded that the proposed method is a suitable alternative for solving the TSP.Gündüz and Aslan [2] used a nearest neighbor and random permutation approach on the Jaya algorithm.They also transformed it into a form suitable for solving discrete problems.They applied the proposed Jaya algorithm to fourteen different traveling salesman problems frequently used in the literature.The experimental results show that the proposed method is a competitive and robust solver for TSP.Zhang and Yang [39] proposed the random walk discrete cuckoo search (RW-DCS) algorithm for TSP.They compared the proposed method with state-of-the-art algorithms.They stated that the experimental results show that the proposed method is stable and superior to the compared algorithms.Almazini et al. [40] solved the TSP using the plant propagation algorithm (PPA) due to the inadequacy of traditional algorithms.However, they stated that the basic version of this method was insufficient in solution quality and proposed PPGA by making improvements such as crossover and mutation on the algorithm.They stated that PPGA has a good performance compared to its basic form.They also stated that they obtained good solutions by comparing the same method with other algorithms in the literature.Jati et al. [32] proposed the discrete Komodo algorithm (DKA) for solving the TSP.They compared the performance of the proposed DKA method with some state-of-theart algorithms and classical algorithms.As a result of the comparison, they concluded that the proposed DKA performs better.Zheng et al. [41] proposed a hybrid genetic algorithm (RHGA) for solving TSP by hybridizing the edge-assembly crossover genetic algorithm (EAX-GA) with the Lin-Kernighan-Helsgaun (LKH) local search approach.According to the experimental results, the proposed RHGA algorithm shows a superior performance compared to the compared algorithms for TSP.Zhang and Han [30] proposed the discrete sparrow search algorithm (DSSA) for solving the TSP.In order to balance the exploration and exploitation capabilities of the proposed DSSA, they integrated various strategies such as mutation and swap operators into the algorithm.They compared the performance of the proposed method with state-of-the-art algorithms.As a result, they concluded that the proposed DSSA method is a competitive and robust method.Nayyef et al. [42] proposed the HJSPSO algorithm by hybridizing jellyfish search (JSO) and particle swarm optimization (PSO) for solving TSPs.They compared the performance of their proposed hybrid method with other algorithms, as well as their baseline, by solving 20 different TSPs.They stated that HJSPSO is a robust technique that can produce promising solutions.In the work presented by Goel et al. [43], the ACO was modified using pheromone mutations.The modified ACO was named M-ACO.They used M-ACO to solve TSP, which is a wellknown NP-hard problem.They also examined it in two groups as evaporation-based ACO (E-ACO) and population-based ACO (P-ACO).When they compared all these proposed methods with the basic ACO, they said that M-ACO and P-ACO obtained better results.
Swarm intelligence-based algorithms have some disadvantages such as stagnation and running time while solving TSPs.Due to the fact that all artificial agents in AS follow the same path due to pheromone intensification and the short distance among some nodes, AS shows stagnation behavior after a while.The stagnation behavior originates from the pheromone mechanism and the evaporation of the pheromone.Generally, the pheromone evaporation is much greater than the pheromone addition by the ants to the arcs.Thus, the heuristic factor or visibility term in the transfer rule of the AS causes the selection of the shorter arcs.If the nodes of the problem are very close to each other, the AS constructs paths by using only collective intelligence.The ABC algorithm and PSO start to work with random initial solutions and use an improvement-based strategy during the iterations.The PI techniques used in these methods are quite important and it also takes a long time to achieve an optimal or near-optimal solution due to starting with random solutions and they do not use the information in the problem.For eliminating the disadvantages of ABC, PSO, and AS, a new approach is proposed in this study by considering collective intelligence having a footprint mechanism in the path construction phase and path improvement technique to solve TSPs.The new approach consists of two phases named PC and PI.In the first phase, while solution space is explored by artificial constructor agents, the collective intelligence consists of footprints left on the paths.In the second phase, the artificial improver agents select and try to improve the global best solution in the population obtained by the constructors by using the neighborhood operators.By using these strategies and information sharing between the phases, a new approach has been studied in the present work.
The rest of the paper is organized as follows: Section 2 presents the proposed method for solving TSPs, and the experimental results and comparisons on TSPs are given in Section 3. The obtained results are discussed in Section 4, and the conclusion and future works are given in Section 5.

Material and Methods
The proposed method in this paper has two types of agents.The first type of the agents is in the path construction phase, and the other type of the agents is in the path improvement phase of the algorithm.It is assumed that the number of agents in the two phases is equal, and the method also tries to achieve the optimal or near-optimal solution for the optimization problem iteratively.

Path Construction Phase
The path construction strategy used in the proposed method is based on the footprint mechanism and distance between nodes.Agents in this phase are called "constructors".Initially, all the constructor agents are located at the nodes of the TSP.The selection probability of other nodes to be visited, which is the same transition rule of the ACO, is calculated as follows: where, while artificial agent is on i th node, P ij is the selection probability of j th node, F ij is the number of footprints leaved on the arc, D ij is the distance between i th and j th , N is the number of unvisited nodes, and a and b are significant parameters.Equation ( 1) is known as the transition rule in the ant colony optimization technique [5].At a certain time, the selection of the next node is performed by using the roulette wheel and Equation (1).After all nodes of a TSP are visited, the artificial agent comes back to the first position.When Equation ( 1) is analyzed, the selection mechanism for the path construction uses both the collective intelligence (number of footprints) and the information of the problem (distance between nodes).Differently from the basic ant system, the collective intelligence in the algorithm does not consist of any evaporation.The footprint mechanism is an important factor for collective intelligence occurring.At the beginning of the search, some footprints are left on all arcs.After the constructor agents have completed self TSP tours, the number of footprints on the visited arcs is increased by 1.In other words, the artificial agents left a footprint to the arc visited.But all constructors do not leave footprints on the arcs, and agents, those solutions of these agents are better than the mean solution quality of the population, leave footprints on self-paths.Therefore, when we compare the proposed algorithm and the basic ant system, the occurrence of the collective intelligence in the algorithm is different from the basic ant system algorithm because there is no evaporation in the proposed algorithm, and the solutions better than the mean of the population leave footprint on the arcs.

Path Improvement Phase
The best solution obtained in the path construction phase in the iteration is compared with the best solution obtained thus far.One of them is selected and given to "improver" agents in this phase and artificial agents use neighborhood operators to improve this solution.According to Kıran et al. [44], three neighborhood operators are used for making a better tour than the best tour obtained thus far and these operators are randomly applied to the solution.If the new one obtained from the operation is better than the old one, solutions are replaced.In brief, the product of collective intelligence is used in order to obtain better solutions in this phase.The neighborhood operators used in the proposed method are random insertion of a point (RI) in Figure 1, random insertion of subsequences (RIS) in Figure 2, and reverse random insertion of subsequences (RRIS) given in Figure 3.These operators are applied to the best solution with an equal probability by each improver agent.
The RI operator adds a randomly chosen element to a randomly chosen position and shifts the rest of the sequence.If a randomly chosen point is i = 2 and a randomly chosen element is j = 5 (i ̸ = j), the operation is as follows: At the beginning of the search, some footprints are left on all arcs.After the constructor agents have completed self TSP tours, the number of footprints on the visited arcs is increased by 1.In other words, the artificial agents left a footprint to the arc visited.But all constructors do not leave footprints on the arcs, and agents, those solutions of these agents are better than the mean solution quality of the population, leave footprints on self-paths.Therefore, when we compare the proposed algorithm and the basic ant system, the occurrence of the collective intelligence in the algorithm is different from the basic ant system algorithm because there is no evaporation in the proposed algorithm, and the solutions better than the mean of the population leave footprint on the arcs.

Path Improvement Phase
The best solution obtained in the path construction phase in the iteration is compared with the best solution obtained thus far.One of them is selected and given to "improver" agents in this phase and artificial agents use neighborhood operators to improve this solution.According to Kıran et al. [44], three neighborhood operators are used for making a better tour than the best tour obtained thus far and these operators are randomly applied to the solution.If the new one obtained from the operation is better than the old one, solutions are replaced.In brief, the product of collective intelligence is used in order to obtain better solutions in this phase.The neighborhood operators used in the proposed method are random insertion of a point (RI) in Figure 1, random insertion of subsequences (RIS) in Figure 2, and reverse random insertion of subsequences (RRIS) given in Figure 3.These operators are applied to the best solution with an equal probability by each improver agent.
The RI operator adds a randomly chosen element to a randomly chosen position and shifts the rest of the sequence.If a randomly chosen point is i = 2 and a randomly chosen element is j = 5 (i ≠ j), the operation is as follows: The RIS operator adds a subsequence randomly chosen from the subsequence to a point randomly chosen and shifts the rest of the sequence.The operation is shown as follows: In the RRIS operator, the subsequence randomly chosen from the sequence is added to the randomly chosen point and the rest of the sequence is shifted to the right until the size of the subsequence.Before the addition, the subsequence may be inverted with a probability 50%.The function of this operator is given in Figure 3.The RIS operator adds a subsequence randomly chosen from the subsequence to a point randomly chosen and shifts the rest of the sequence.The operation is shown as follows: agents have completed self TSP tours, the number of footprints on the visited arcs is increased by 1.In other words, the artificial agents left a footprint to the arc visited.But all constructors do not leave footprints on the arcs, and agents, those solutions of these agents are better than the mean solution quality of the population, leave footprints on self-paths.Therefore, when we compare the proposed algorithm and the basic ant system, the occurrence of the collective intelligence in the algorithm is different from the basic ant system algorithm because there is no evaporation in the proposed algorithm, and the solutions better than the mean of the population leave footprint on the arcs.

Path Improvement Phase
The best solution obtained in the path construction phase in the iteration is compared with the best solution obtained thus far.One of them is selected and given to "improver" agents in this phase and artificial agents use neighborhood operators to improve this solution.According to Kıran et al. [44], three neighborhood operators are used for making a better tour than the best tour obtained thus far and these operators are randomly applied to the solution.If the new one obtained from the operation is better than the old one, solutions are replaced.In brief, the product of collective intelligence is used in order to obtain better solutions in this phase.The neighborhood operators used in the proposed method are random insertion of a point (RI) in Figure 1, random insertion of subsequences (RIS) in Figure 2, and reverse random insertion of subsequences (RRIS) given in Figure 3.These operators are applied to the best solution with an equal probability by each improver agent.
The RI operator adds a randomly chosen element to a randomly chosen position and shifts the rest of the sequence.If a randomly chosen point is i = 2 and a randomly chosen element is j = 5 (i ≠ j), the operation is as follows: The RIS operator adds a subsequence randomly chosen from the subsequence to a point randomly chosen and shifts the rest of the sequence.The operation is shown as follows: In the RRIS operator, the subsequence randomly chosen from the sequence is added to the randomly chosen point and the rest of the sequence is shifted to the right until the size of the subsequence.Before the addition, the subsequence may be inverted with a probability 50%.The function of this operator is given in Figure 3.In the RRIS operator, the subsequence randomly chosen from the sequence is added to the randomly chosen point and the rest of the sequence is shifted to the right until the size of the subsequence.Before the addition, the subsequence may be inverted with a probability 50%.The function of this operator is given in Figure 3. Based on the aforementioned explanations, the steps of the proposed algorithm are given in Figure 4. Based on the aforementioned explanations, the steps of the proposed algorithm are given in Figure 4. Based on the aforementioned explanations, the steps of the proposed algorithm are given in Figure 4.In the initialization of the algorithm, half of the population are constructor agents, and the rest of the population are improvers.While the algorithm is run, a potential solution is created for each constructor by using the transfer rule and the best solution obtained by the constructors have been improved in the second phase of the algorithm by the improver agents.The relation between the constructors and the improver agents is provided by the best solution in the population and footprint mechanism.The proposed algorithm can be seen like ACO, and the same transfer rule of ACO is used to create solutions in the constructor phase of the proposed algorithm.However, the evaporation In the initialization of the algorithm, half of the population are constructor agents, and the rest of the population are improvers.While the algorithm is run, a potential solution is created for each constructor by using the transfer rule and the best solution obtained by the constructors have been improved in the second phase of the algorithm by the improver agents.The relation between the constructors and the improver agents is provided by the best solution in the population and footprint mechanism.The proposed algorithm can be seen like ACO, and the same transfer rule of ACO is used to create solutions in the constructor phase of the proposed algorithm.However, the evaporation mechanism is not used in our study because while the problem size is increased, the artificial agents tend to select the shortest distance among the nodes.Thus, the evaporation mechanism does not work in the transfer rule because it is too low.To overcome this issue, we used the footprint mechanism without evaporation.The second novelty is to use constructors and improvers in an algorithmic framework.As we know, all the agents in the ACO are constructors, and the best solution is only used to report at the end of algorithm.

Experimental Results
For experiments, an IBM compatible PC with a Pentium 3.4 GHz microprocessor and 2 GB of RAM was used.The algorithms we are run 30 times with random seeds for each problem, and the obtained results were reported as the best, worst, and mean.The test problems [45] used in experiments, except Oliver30 [46], and their optimum costs are displayed in Table 1, the parameters of the methods are given in Table 2, and the obtained results for these problems are given in Table 3.
In the results tables, the relative errors (RE) calculated by using the means of results are as follows: where O k is the optimum tour length of the k th problem and B k is the mean tour length obtained by 30 runs of the algorithm for the k th problem.Under these conditions, the obtained results by the proposed method and ant system are reported in Table 3, and the better solutions according to RE are written in boldface font type.Based on Table 3, the proposed method is better than the AS algorithm in terms of solution quality on 20 of 25 TSPs.Because half of the population in the proposed method are improvers, all of the solutions are not re-constructed in the improvement stage and the method consumes less time than the AS algorithm.In addition, the stagnation has been prevented by the improvers and the higher-quality solution has been obtained by a new approach.Moreover, to show the search behavior of the proposed algorithm, the convergence to the global optimum of the proposed algorithm is given in Figure 5.The convergence of the algorithm to the global optimum is at an acceptable level due to using both the footprint mechanism and information about the problem.The evolution graphics of the population are shown in Figure 5 during the iterations.According to the evolution graphics on some test problems, the search space of the problem is continuously searched by the population of the proposed method effectively.In addition, the convergence graphics of the method to the optimum or near-optimum of the problems are shown in this figure.The proposed method has been also compared with the ABC, ACO, DTSA, and a hierarchic approach, briefly HA, in Table 4, in which the results of the compared algorithms (ACO, ABC, and HA) are directly taken from [47], and the results of DTSA are directly taken from [48].The results given in Table 4 show that the hierarchic approach is better than the other algorithms in the small-sized TSP instances.The DTSA produced better results on the PR76 and Kroa100 problems than the other algorithms, and the proposed algorithm called PM in Table 4 is better than the compared algorithms in the Eil101 and Tsp225 instances.In accordance with the mean rank comparisons of the algorithms given in Figure 6, the HA is in the first rank, and the proposed algorithm is in the second rank in the comparison.
Another comparison has been conducted on the Kro series (KroA, KroB, KroC, KroD, KroE) TSP instances.In this experiment, the proposed method has been compared with simulated annealing (SA), DTSA, and discrete state transition algorithm (DSTA) and its variants.The results of these algorithms are directly taken from the study of [48] and the termination condition is the maximum number of function evaluations, and it was 90,000 The proposed method has been also compared with the ABC, ACO, DTSA, and a hierarchic approach, briefly HA, in Table 4, in which the results of the compared algorithms (ACO, ABC, and HA) are directly taken from [47], and the results of DTSA are directly taken from [48].The results given in Table 4 show that the hierarchic approach is better than the other algorithms in the small-sized TSP instances.The DTSA produced better results on the PR76 and Kroa100 problems than the other algorithms, and the proposed algorithm called PM in Table 4 is better than the compared algorithms in the Eil101 and Tsp225 instances.In accordance with the mean rank comparisons of the algorithms given in Figure 6, the HA is in the first rank, and the proposed algorithm is in the second rank in the comparison.Another comparison has been conducted on the Kro series (KroA, KroB, KroC, KroD, KroE) TSP instances.In this experiment, the proposed method has been compared with simulated annealing (SA), DTSA, and discrete state transition algorithm (DSTA) and its variants.The results of these algorithms are directly taken from the study of [48] and the termination condition is the maximum number of function evaluations, and it was 90,000 in the referenced study.In the run of the proposed method, it was adjusted according to the number of TSPs, and because the number of nodes is 100 in Kro series problems, the number of function evaluations is calculated as 50,000.The comparison results and mean ranks are given in Table 5 and Figure 7, respectively.At the same time, Table 6 shows the comparison of the results obtained by the proposed method with the variants of ACO.When Table 6 is analyzed, it is seen that the proposed method obtains the best average results in some TSPs according to the variants of ACO.

Figure 1 .
Figure 1.The function of RI operator.

Figure 2 .
Figure 2. The function of RIS operator.

Figure 1 .
Figure 1.The function of RI operator.

Figure 1 .
Figure 1.The function of RI operator.

Figure 2 .
Figure 2. The function of RIS operator.

Figure 2 .
Figure 2. The function of RIS operator.

Figure 4 .
Figure 4.The detailed algorithmic framework of the proposed method.

Figure 4 .
Figure 4.The detailed algorithmic framework of the proposed method.

Figure 5 .
Figure 5.The evolution of population in the proposed approach on some test problems.

Figure 5 .
Figure 5.The evolution of population in the proposed approach on some test problems.

Figure 6 .
Figure 6.Comparison of mean ranks of the ACO, ABC, HA, DTSA, and PM in some TSP instances.

Figure 6 .
Figure 6.Comparison of mean ranks of the ACO, ABC, HA, DTSA, and PM in some TSP instances.

Figure 7 .
Figure 7.Comparison of mean ranks of the PM, SA, DTSA, and DSTAs on KRO series problems.

Figure 7 .
Figure 7.Comparison of mean ranks of the PM, SA, DTSA, and DSTAs on KRO series problems.

Table 1 .
The TSP instances used in the experiments.

Table 2 .
Parameter setting of ACO and the proposed method.
* D is the number of nodes in the traveling salesman problem.

Table 3 .
The comparison of the ant system algorithm and the proposed method on the 25 TSPs.

Table 4 .
The comparison of ACO, ABC, HA, DTSA, and PM in some TSP instances.

Table 5 .
The comparison of PM, SA, DTSA, and DSTA variants in Kro series TSP instances.

Table 5 .
The comparison of PM, SA, DTSA, and DSTA variants in Kro series TSP instances.

Table 6 .
The comparison of the proposed method with ACO variants in TSP instances.