Dynamic Flying Ant Colony Optimization (DFACO) for Solving the Traveling Salesman Problem

This paper presents an adaptation of the flying ant colony optimization (FACO) algorithm to solve the traveling salesman problem (TSP). This new modification is called dynamic flying ant colony optimization (DFACO). FACO was originally proposed to solve the quality of service (QoS)-aware web service selection problem. Many researchers have addressed the TSP, but most solutions could not avoid the stagnation problem. In FACO, a flying ant deposits a pheromone by injecting it from a distance; therefore, not only the nodes on the path but also the neighboring nodes receive the pheromone. The amount of pheromone a neighboring node receives is inversely proportional to the distance between it and the node on the path. In this work, we modified the FACO algorithm to make it suitable for TSP in several ways. For example, the number of neighboring nodes that received pheromones varied depending on the quality of the solution compared to the rest of the solutions. This helped to balance the exploration and exploitation strategies. We also embedded the 3-Opt algorithm to improve the solution by mitigating the effect of the stagnation problem. Moreover, the colony contained a combination of regular and flying ants. These modifications aim to help the DFACO algorithm obtain better solutions in less processing time and avoid getting stuck in local minima. This work compared DFACO with (1) ACO and five different methods using 24 TSP datasets and (2) parallel ACO (PACO)-3Opt using 22 TSP datasets. The empirical results showed that DFACO achieved the best results compared with ACO and the five different methods for most of the datasets (23 out of 24) in terms of the quality of the solutions. Further, it achieved better results compared with PACO-3Opt for most of the datasets (20 out of 21) in terms of solution quality and execution time.


Introduction
The traveling salesman problem (TSP) [1] involves finding the shortest tour distance for a salesperson who wants to visit each city in a group of fully connected cities exactly once. TSP is a discrete optimization problem. It is a classic example of a category of computing problems known as NP-hard problems [2,3]. Although there are simple algorithms for solving these problems, these algorithms require exponential time, which makes them impractical for solving large-size problems. Hence, metaheuristic optimization algorithms are usually applied to find good solutions, although these solutions may not be optimal.
The TSP problem can be used for modeling several wireless sensor network (WSN) problems [4]. In a WSN, the sensors are located in a sensing field to collect data, and send these data to the source node wirelessly. There are two ways to increase the lifetime of the sensors: first, by reducing the size and number of data [5,6], and second, by reducing the cost of transferring the data [4]. For example, a good solution to the TSP problem can also be considered an efficient diffusion method for reducing the transferring cost. Many methods, including heuristic or hybrid, have been proposed for solving the TSP, but most of them were unable to avoid the stagnation problem, or they may have obtained good solutions but took a long execution time to do so [7]. In this work, we enhanced the ant colony optimization (ACO) algorithm based on imaginary ants that can fly. These ants deposit their pheromones with neighboring nodes while flying by injecting them from a distance. This allows not only the nodes on a good path to receive some pheromones but also the neighboring nodes. The algorithm also makes use of the 3-Opt algorithm to help avoid reaching a local minimum.
The main contributions of this work on the flying ACO (FACO) algorithm are as follows: (1) proposing a dynamic neighboring selection mechanism to balance between exploration and exploitation, (2) reducing the execution time of FACO by making flying ants equal to half the ants, and (3) adapting the flying process to work with the TSP problem.
The main contributions of this work in general are as follows: (1) obtaining better-quality solutions, (2) significantly reducing the execution time, and (3) avoiding getting stuck at a local minimum.
The paper is organized as follows: in Section 2, we discuss related works; Section 3 presents the proposed enhancement of the ACO algorithm; Section 4 shows the experimental results; and the conclusion is shown in Section 5.

Related Work
This section reviews some important and more recent works in this area.

Metaheuristic Solutions
The TSP has been widely used as a benchmark problem to evaluate many metaheuristic and nature-inspired algorithms. Chen and Chien [8] presented a hybrid method using simulated genetic annealing, ACO, and particle swarm optimization. Each algorithm performs a specific task, where ACO generates the initial solutions for the genetic simulated annealing algorithm, which searches for better solutions based on the initial solutions. Then, the better solutions are used to update the pheromone trails. Finally, the particle swarm optimization algorithm exchanges the pheromone information after a predefined number of cycles. Deng et al. [9] presented a hybrid method that combined a genetic algorithm and ACO. They used a multipopulation strategy to enhance the local search. In addition, they used chaotic optimization to avoid the ACO slow convergence problem. They controlled the trade-off between exploration and exploitation by using an adaptive control strategy to distribute the pheromones uniformly. Eskandari et al. [10] proposed a local solution enhancement for ACO based on mutation operators. The local solution is mutated to generate a new solution and keeps it if it is better than the original solution. The mutation operators include swap, insertion, and reversion. A comparison between ACO and cuckoo search (CS) algorithms was conducted in [11] for solving the TSP. In this comparison, only five city plans were used. Mavrovouniotis et al. [12] used local search operators to support the ACO algorithm. This new method was used for dynamic TSP. The best solution from ACO is passed to local search operators for removing and inserting cities to generate a new solution. Alves et al. [13] introduced an adapted ACO algorithm based on social interaction called social interaction ant colony optimization (SIACO). The social interaction was introduced to enhance pheromone deposition. Han et al. [14] proposed a niching ant colony system (NACS) algorithm. This algorithm enhances the ACO algorithm in two ways: it applies a niching strategy and uses multiple pheromone deposition. Pintea et al. [15] introduced an enhancement for ACO based on clustering, where the cities are divided into clusters and ACO is used to find the minimum cost for each cluster. Xiao et al. [16] proposed a multistage ACO algorithm that reduces the initial pheromone concentration based on the nearest-neighbor method. Then, the mean cross-evolution strategy is used to enhance the solution space. Zhou et al. [17] proposed an ACO algorithm for large-scale problems that utilizes graphics processing units.
The 3-Opt algorithm is widely used to enhance the local search of metaheuristic algorithms. Mahi et al. [18] presented a hybrid algorithm using particle swarm optimization and ACO. The particle optimizes the α and β parameters, which affect the performance of ACO. The 3-Opt algorithm is then used to avoid the stagnation problem. Gülcü et al. [7] introduced a parallel cooperative method, which is a hybridization of the parallel ACO (PACO) and the 3-Opt algorithm. The proposed algorithm is named as PACO-3Opt and it uses a parallel set of colonies. These multiple colonies have a master-slave paradigm. The 3-Opt algorithm is used by these colonies based on a predefined number of iterations. Khan et al. [19] used 2-Opt and 3-Opt with an artificial bee colony (ABC) algorithm. Also, they created a new different path by combing swap sequences with ABC.
Ouaarab et al. [20] proposed a discretized version of the CS algorithm and also added a new cuckoo category. This new category aims to manage the exploration and exploitation by using Lévy flights and multiple searching methods. Osaba et al. [21] presented a discrete version of the bat algorithm where each bat moves based on the best bat. If a bat is located far from the best bat, then the movement will be large, but if it is close to the best bat, the step will be small. Choong et al. [22] introduced a hybrid algorithm of the ABC algorithm and modified choice function. The modified choice function is used to regulate the neighborhood selection of employed and onlooker bees.
Many works in the literature present improvements on existing algorithms by suggesting methods to control the tradeoff between exploitation and exploration, which are the two main steps that form the basis of many metaheuristic approaches and nature-inspired algorithms. In exploitation, the accumulated knowledge about the search space is used to guide the search, while in exploration, risk is taken to explore the unfamiliar region of the search space, in the hope that this region may contain a solution better than the known solutions [23].
Researchers usually use hybrid methods to merge different algorithms' capabilities; however, new methods can become too complex and sometimes even incomprehensible. By contrast, we aimed in this work to enhance the ACO algorithm by adding extra procedures while keeping the method understandable and easy to use.

Opt Algorithm
The 3-Opt algorithm was introduced to solve the TSP. It exchanges three edges from the old tour by another three edges to produce a new tour [24] and retains the new tour if it is better. The process is repeated until no further improvement is found. 3-Opt is a local search algorithm; therefore, it is used to help ACO avoid local minima [7] by optimizing the solutions locally [25]. There are n 3 . possible combinations to replace three edges from the tour with n cities [26].
For instance, from three edges, we can obtain eight possible combinations, as shown in Figure 1 where (a) to (h) represent these eight combinations [27]. The 3-Opt algorithm is widely used to enhance the local search of metaheuristic algorithms. Mahi et al. [18] presented a hybrid algorithm using particle swarm optimization and ACO. The particle optimizes the α and β parameters, which affect the performance of ACO. The 3-Opt algorithm is then used to avoid the stagnation problem. Gülcü et al. [7] introduced a parallel cooperative method, which is a hybridization of the parallel ACO (PACO) and the 3-Opt algorithm. The proposed algorithm is named as PACO-3Opt and it uses a parallel set of colonies. These multiple colonies have a master-slave paradigm. The 3-Opt algorithm is used by these colonies based on a predefined number of iterations. Khan et al. [19] used 2-Opt and 3-Opt with an artificial bee colony (ABC) algorithm. Also, they created a new different path by combing swap sequences with ABC.
Ouaarab et al. [20] proposed a discretized version of the CS algorithm and also added a new cuckoo category. This new category aims to manage the exploration and exploitation by using Lévy flights and multiple searching methods. Osaba et al. [21] presented a discrete version of the bat algorithm where each bat moves based on the best bat. If a bat is located far from the best bat, then the movement will be large, but if it is close to the best bat, the step will be small. Choong et al. [22] introduced a hybrid algorithm of the ABC algorithm and modified choice function. The modified choice function is used to regulate the neighborhood selection of employed and onlooker bees.
Many works in the literature present improvements on existing algorithms by suggesting methods to control the tradeoff between exploitation and exploration, which are the two main steps that form the basis of many metaheuristic approaches and nature-inspired algorithms. In exploitation, the accumulated knowledge about the search space is used to guide the search, while in exploration, risk is taken to explore the unfamiliar region of the search space, in the hope that this region may contain a solution better than the known solutions [23].
Researchers usually use hybrid methods to merge different algorithms' capabilities; however, new methods can become too complex and sometimes even incomprehensible. By contrast, we aimed in this work to enhance the ACO algorithm by adding extra procedures while keeping the method understandable and easy to use.

Opt Algorithm
The 3-Opt algorithm was introduced to solve the TSP. It exchanges three edges from the old tour by another three edges to produce a new tour [24] and retains the new tour if it is better. The process is repeated until no further improvement is found. 3-Opt is a local search algorithm; therefore, it is used to help ACO avoid local minima [7] by optimizing the solutions locally [25].
There are 3 possible combinations to replace three edges from the tour with n cities [26]. For instance, from three edges, we can obtain eight possible combinations, as shown in Figure 1 where (a) to (h) represent these eight combinations [27]. The experiments reported in [26,28] show that combining the 3-Opt algorithm with other metaheuristic algorithms improves the solutions found by these algorithms. This is because the 3-Opt algorithm mitigates the effect of local minima [28].

Ant Colony Optimization
ACO was inspired by the way real ants forage for food. Initially, real ants forage for food randomly, depositing a chemical substances called pheromones on their paths. The path between the colony and the nearest food source tends to receive more pheromones, which attracts more ants to The experiments reported in [26,28] show that combining the 3-Opt algorithm with other metaheuristic algorithms improves the solutions found by these algorithms. This is because the 3-Opt algorithm mitigates the effect of local minima [28].

Ant Colony Optimization
ACO was inspired by the way real ants forage for food. Initially, real ants forage for food randomly, depositing a chemical substances called pheromones on their paths. The path between the colony and the nearest food source tends to receive more pheromones, which attracts more ants to follow the same path. Once the food source is exhausted, the ants abandon the path and the pheromones evaporate, forcing the ants to start searching for another food source randomly.
The ACO algorithm [28][29][30] simulates the foraging behavior of real ants. It initializes all ants randomly, and each ant searches for a potential solution. In addition, ACO assigns an amount of pheromone to each edge of the solution path that is proportional to the quality of the solution.
In each iteration, each ant moves to unvisited nodes in order to construct a potential solution. The next node to visit is selected according to a probability distribution that favors the nodes with large amounts of pheromones (τ ij ). ACO also takes into account a local heuristic function (η ij ). Equation (1) shows the solution generation formula which computes the probability of selecting the edge from nodes i to j: where α and β are coefficient parameters that determine the importance of the pheromone value (τ ij ) and the value of the local heuristic (η ij ). The local heuristic η ij is problem dependent. For the TSP, it is defined as 1 divided by the length of the edge between nodes i and j. N i k is the list of unvisited nodes from node i by ant k.
The ants update the pheromones locally using Equation (2). This update is called the local pheromone update: where τ 0 is the initial pheromone value, and ρ is the evaporation rate. ACO selects the best solution greedily. The best ant updates the pheromone trails on its path using Equation (3). This process is called the global pheromone update: where L gb (t) is the tour length for the best ant. These ACO algorithm processes are illustrated in Figure 2 [31]. The ACO algorithm suffers from a stagnation problem [32] because the amounts of pheromone are accumulated on the explored paths, and as a result, the chances of exploring other paths decrease. The FACO algorithm, discussed next, addresses this issue.

Flying Ant Colony Optimization
In [33], a flying ant colony algorithm was proposed to solve the quality of service (QoS)-aware web service composition problem. Web service composition involves selecting the best combination of web services, where each service is selected from a set of candidate services that fulfill a certain task. The solutions are evaluated according to a set of QoS properties, such as reliability, cost, response time, and availability.
The algorithm assumes that, in addition to walking normal ants, there are also flying ants. Flying ants inject their pheromones from a distance, so that not only the nodes on the path receive some pheromones but also their neighboring nodes. The amount of pheromone a neighboring node receives is inversely proportional to the distance between it and the node on the path. This makes the ants more likely to explore these nodes during future iterations, which encourages exploration.
Since determining the nearest nodes might be an expensive iteration in terms of execution time, we only considered the ant that finds the best solution as a flying ant in each iteration. The rest of the ants are dealt with in the usual way. The flying ant then determines the nearest neighboring nodes (web services) by using Equation (5) to calculate the distance between two web services and . Equation

Flying Ant Colony Optimization
In [33], a flying ant colony algorithm was proposed to solve the quality of service (QoS)-aware web service composition problem. Web service composition involves selecting the best combination of web services, where each service is selected from a set of candidate services that fulfill a certain task. The solutions are evaluated according to a set of QoS properties, such as reliability, cost, response time, and availability.
The algorithm assumes that, in addition to walking normal ants, there are also flying ants. Flying ants inject their pheromones from a distance, so that not only the nodes on the path receive some pheromones but also their neighboring nodes. The amount of pheromone a neighboring node receives is inversely proportional to the distance between it and the node on the path. This makes the ants more likely to explore these nodes during future iterations, which encourages exploration.
Since determining the nearest nodes might be an expensive iteration in terms of execution time, we only considered the ant that finds the best solution as a flying ant in each iteration. The rest of the ants are dealt with in the usual way. The flying ant then determines the nearest neighboring nodes (web services) by using Equation (5) to calculate the distance between two web services x and y. Equation (5) considers two web services that are similar (close to each other) if they have similar QoS properties: where C, RT, A, and R are the cost, response time, availability, and reliability, respectively; x is the best web service obtained by the best ant in task t i+1 ; y is one of the neighboring web services to x in task t i+1 ; and x y. The nearest neighbors receive an amount of pheromone that is inversely proportional to their distance from the best node. Equation (6) describes how much pheromone a node receives: represents the pheromone trails from the global pheromone update. d η (i,x )(i,l) is the normalized distance between web services in task i + 1 and its neighbor web service l in the same task.
The distance (local heuristic) η ij . is normalized according to Equation (7): Figure 3 illustrates the process of the FACO algorithm [33], which was added to the process of ACO.

Dynamic Flying Ant Colony Optimization (DFACO) Algorithm
Many methods, including heuristic or hybrid, have been proposed for solving the TSP, but most of them cannot avoid the stagnation problem, or they may obtain solutions but take a long execution time [7]. In this work, we proposed an enhanced ACO algorithm that finds better solutions in less computation time and a robustness mechanism to avoid the stagnation problem.
In this section, we present a modification of the FACO algorithm to make it suitable for the TSP

Dynamic Flying Ant Colony Optimization (DFACO) Algorithm
Many methods, including heuristic or hybrid, have been proposed for solving the TSP, but most of them cannot avoid the stagnation problem, or they may obtain solutions but take a long execution time [7]. In this work, we proposed an enhanced ACO algorithm that finds better solutions in less computation time and a robustness mechanism to avoid the stagnation problem.
In this section, we present a modification of the FACO algorithm to make it suitable for the TSP problem in the following ways.
First, the number of neighboring nodes in FACO were static based on the experiments. However, the number of neighbors in DFACO that may be injected with pheromones was dynamic. The number of neighboring nodes varied in each iteration depending on the quality of the best solution reached so far compared to the other solutions. The number of neighbors was determined based on two cases: (1) If the best solution is slightly better than the other solutions, then the number of neighbors should be large to obtain more neighbors. This encourages exploration in future iterations. (2) If the best solution is considerably better than the other solutions, then the number of neighbors should be small to encourage exploitation in future iterations.
The number of nearest neighbors, NS, was determined according to the following formula: where L gb (t) is the tour length of the global best tour at time t, L kl (t) is the tour length of ant k at time t, S is the number of ants, and N is the number of cities. The second modification aimed to reduce the execution time. If all ants were flying ants (such as in FACO), we would have to determine many neighbors for each node on the best path, which may substantially increase the execution time. Therefore, here, only 50% of the ants were flying ants and the rest were normal walking ants.
The third modification aimed to encourage exploration at early stages and exploitation at later stages. This modification is similar to the FACO algorithm, but we modified the process to adapt it to the TSP problem. The intuition behind this is that at early stages, we have no idea about the location of the best solution in the search space; and therefore, ants should be encouraged to explore the search space. On the other hand, at later iterations, the region that contains the best solution is more likely to have been located, and therefore, exploitation should be encouraged. This was achieved by injecting pheromones at farther neighbors during early iterations, while at later iterations, we injected the pheromones at only the nearest neighbors. Equation (6) was used to determine the amount of pheromone for each neighbor.
As a final modification, we embedded the 3-Opt algorithm in FACO to reduce the chances of getting stuck at a local minimum. Figure 4 shows the complete algorithm in detail, and Figure 5 illustrates the process of the DFACO algorithm.

Experimental Results
We conducted empirical experiments using TSP datasets from TSPLIB [34] to test the performance of the proposed algorithm. We performed three comparisons. First, we compared DFACO combined with the 3-Opt algorithm with ACO combined with the 3-Opt algorithm using 24 datasets. Second, we compared DFACO performance with PACO-3Opt [7] in detail using 21 datasets. Third, we compared DFACO performance with five more recent methods [8,9,18,20,21] using 24 datasets.
We compared the methods with respect to the average of the best solutions for all runs (Mean), the standard deviation (SD), and the best solution for each run (Best). We also compared DFACO, PACO-3Opt, and ACO with respect to execution time in seconds. Table 1 lists the parameter values of both algorithms, which were empirically determined. These values were also used to compare DFACO to all of the other methods. Both ACO and DFACO were run for 100 iterations (Z) and each dataset was used in 30 independent experiments. Table 2 lists the comparison results for DFACO and ACO. The first column shows the name of the TSP datasets. The second column shows the best-known solution (BKS) as reported on the TSPLIB website (http://comopt.ifi.uni-heidelberg.de/software/TSPLIB95/STSP.html). Bold font indicates the best results.  Table 2 indicates that DFACO was able to find the BKS in all runs for 16 datasets with zero SD, while ACO was able to find the BKS in all runs for 15 datasets with zero SD. However, the proposed method obtained the BKS in all runs faster than ACO for four datasets (bier127, ch130, kroB150, and kroA200), while ACO obtained the BKS faster than DFACO for two datasets (eil101 and ch150). Figure 6 shows the average of the best solutions, while Figure 7 presents the execution time in seconds for all datasets in the table. As can be seen in Figure 6, DFACO was better than ACO in terms of the average of the best solutions and obtains a shorter distance on average for all datasets. Also, DFACO was faster than ACO by 54.7 s for all datasets.  Table 2 indicates that DFACO was able to find the BKS in all runs for 16 datasets with zero SD, while ACO was able to find the BKS in all runs for 15 datasets with zero SD. However, the proposed method obtained the BKS in all runs faster than ACO for four datasets (bier127, ch130, kroB150, and kroA200), while ACO obtained the BKS faster than DFACO for two datasets (eil101 and ch150). Figure 6 shows the average of the best solutions, while Figure 7 presents the execution time in seconds for all datasets in the table. As can be seen in Figure 6, DFACO was better than ACO in terms of the average of the best solutions and obtains a shorter distance on average for all datasets. Also, DFACO was faster than ACO by 54.7 s for all datasets.   Table 2.
For the remaining eight datasets, DFACO found the best Mean solution for seven datasets, while ACO found the best Mean solution for one dataset (fl1400). These results were found to be statistically significant according to the Wilcoxon signed-rank test, with N = 8 and p ≤ 0.05. A t-test was used to see if the results were statistically significant in the 30 independent runs for each one of the eight datasets. The results indicate that the proposed method's results were statistically significant for four out of eight datasets, namely, for the datasets rat575, rat783, rl1323, and d1655. We did not perform a t-test for the remaining 16 datasets because both algorithms achieved the BKS.  Table 2.  Table 2 indicates that DFACO was able to find the BKS in all runs for 16 datasets with zero SD, while ACO was able to find the BKS in all runs for 15 datasets with zero SD. However, the proposed method obtained the BKS in all runs faster than ACO for four datasets (bier127, ch130, kroB150, and kroA200), while ACO obtained the BKS faster than DFACO for two datasets (eil101 and ch150). Figure 6 shows the average of the best solutions, while Figure 7 presents the execution time in seconds for all datasets in the table. As can be seen in Figure 6, DFACO was better than ACO in terms of the average of the best solutions and obtains a shorter distance on average for all datasets. Also, DFACO was faster than ACO by 54.7 s for all datasets.   Table 2.
For the remaining eight datasets, DFACO found the best Mean solution for seven datasets, while ACO found the best Mean solution for one dataset (fl1400). These results were found to be statistically significant according to the Wilcoxon signed-rank test, with N = 8 and p ≤ 0.05. A t-test was used to see if the results were statistically significant in the 30 independent runs for each one of the eight datasets. The results indicate that the proposed method's results were statistically significant for four out of eight datasets, namely, for the datasets rat575, rat783, rl1323, and d1655. We did not perform a t-test for the remaining 16 datasets because both algorithms achieved the BKS.  Table 2.
For the remaining eight datasets, DFACO found the best Mean solution for seven datasets, while ACO found the best Mean solution for one dataset (fl1400). These results were found to be statistically significant according to the Wilcoxon signed-rank test, with N = 8 and p ≤ 0.05. A t-test was used to see if the results were statistically significant in the 30 independent runs for each one of the eight datasets.
The results indicate that the proposed method's results were statistically significant for four out of eight datasets, namely, for the datasets rat575, rat783, rl1323, and d1655. We did not perform a t-test for the remaining 16 datasets because both algorithms achieved the BKS.
For the second set of comparisons, we followed the comparison method of PACO-3Opt [7]. In the PACO-3Opt experiments, the TSP datasets were divided based on the problem size into small-scale and large-scale datasets (the size of the large-scale datasets was between 400 and 600). The small-size datasets used 10 TSP datasets (shown in Table 3), and for the large size, 11 TSP datasets were used (shown in Table 4). Table 3 presents the experimental results of comparing DFACO with PACO-3Opt for small-scale TSP instances. The table shows the best, worst, and average values of both algorithms for comparison. Boldface text indicates the better results for both algorithms. The results reveal that the DFACO obtained the optimum distances for all datasets in terms of best, worst, and average values. Meanwhile, PACO-3Opt obtained the optimum distances for only six datasets, one dataset, and one dataset in terms of best, worst, and average, respectively. With regard to execution time, Table 3 shows that DFACO significantly reduced the execution time and obtained better results faster than PACO-3Opt for all TSP instances.    Table 4 presents the results of comparing DFACO with PACO-3Opt for large-scale TSP instances. It also shows the best, worst, and average values of both algorithms for comparison. Boldface text indicates the better results for both algorithms. The results reveal that DFACO obtained better distances for all datasets in terms of best, worst, and average values, except for rat783. With regard to execution time, Table 4 shows that DFACO significantly reduced the execution time and obtained better results faster than PACO-3Opt for all TSP instances except for rat783, where DFACO was faster than PACO-3Opt but did not obtain better results. Table 5 shows the third type of comparison between DFACO and five recent methods [5][6][7][8][9]. In this set of experiments, we used 24 TSP datasets and 30 independent runs.
The table reveals that the proposed algorithm achieved the best results for all datasets except one (rat783), for which Deng's method [9] achieved the best result. Also, DFACO found the BKS for 18 datasets, and for one dataset (rat575), it found an even better solution than the BKS. Figures 8-31 show the average of the best solutions for each TSP instance obtained by different algorithms. These figures visualize the results of the 24 datasets shown in Table 5. From these figures, it is clear that DFACO's performance was better than that of the other algorithms for most datasets except rat783.                          Table 6 compares DFACO with five recent methods with respect to the percentage deviation of the average solution to the BKS value (PDav) and the percentage deviation of the best solution to the BKS value (PDbest) in the experimental results. PDav and PDbest were calculated using Equations (9) and (10), respectively: 100.   Table 6 compares DFACO with five recent methods with respect to the percentage deviation of the average solution to the BKS value (PDav) and the percentage deviation of the best solution to the BKS value (PDbest) in the experimental results. PDav and PDbest were calculated using Equations (9) and (10), respectively: 100, 100.  Table 6 compares DFACO with five recent methods with respect to the percentage deviation of the average solution to the BKS value (PDav) and the percentage deviation of the best solution to the BKS value (PDbest) in the experimental results. PDav and PDbest were calculated using Equations (9) and (10), respectively: The results revealed that the values of PDav and PDbest for DFACO were better than those for the other methods on all datasets except one (rat783), for which Deng's method [9] was better.

Conclusions
This paper proposed a modified FACO algorithm for the TSP. We modified FACO in several ways to reduce the execution time and to better balance exploration and exploitation. For example, the number of neighboring nodes receiving pheromones varied depending on the quality of the solution compared to the other solutions. This helped to balance the exploration and exploitation strategies. We also embedded the 3-Opt algorithm to improve the solution by mitigating the effect of the stagnation problem. Moreover, the colony contained a combination of normal and flying ants. These modifications aimed to achieve better solutions with less processing time and to avoid getting stuck in local minima.
DFACO was compared with (1) ACO and five recent methods for the TSP [8,9,18,20,21] using 24 TSP datasets and (2) PACO-3Opt using 22 TSP datasets. Our empirical results showed that DFACO achieved the best results compared to ACO and the five different methods for most datasets (23 out of 24) in terms of solution quality. Also, DFACO achieved the best results compared with PACO-3Opt for most datasets (20 out of 21) in terms of solution quality and the execution time. Furthermore, for one dataset, DFACO achieved a better solution than the best-known solution.