The dynamic traveling salesman problem (DTSP) is significant in logistics distribution in real-world applications in smart cities, but it is uncertain and difficult to solve. This paper proposes a scheme library-based ant colony optimization (ACO) with a two-optimization (2-opt) strategy to solve the DTSP efficiently. The work is novel and contributes to three aspects: problem model, optimization framework, and algorithm design. Firstly, in the problem model, traditional DTSP models often consider the change of travel distance between two nodes over time, while this paper focuses on a special DTSP model in that the node locations change dynamically over time. Secondly, in the optimization framework, the ACO algorithm is carried out in an offline optimization and online application framework to efficiently reuse the historical information to help fast respond to the dynamic environment. The framework of offline optimization and online application is proposed due to the fact that the environmental change in DTSP is caused by the change of node location, and therefore the new environment is somehow similar to certain previous environments. This way, in the offline optimization, the solutions for possible environmental changes are optimized in advance, and are stored in a mode scheme library. In the online application, when an environmental change is detected, the candidate solutions stored in the mode scheme library are reused via ACO to improve search efficiency and reduce computational complexity. Thirdly, in the algorithm design, the ACO cooperates with the 2-opt strategy to enhance search efficiency. To evaluate the performance of ACO with 2-opt, we design two challenging DTSP cases with up to 200 and 1379 nodes and compare them with other ACO and genetic algorithms. The experimental results show that ACO with 2-opt can solve the DTSPs effectively.

The traveling salesman problem (TSP) is one of the most fundamental and intensely studied NP-complete combinatorial optimization problems [

In short, DTSP can be regarded as a series of different static TSPs over time. Therefore, the methods used to solve TSP can also show their efficiency in solving DTSP. Since the search space of TSP and DTSP is the full arrangement of all vertices (i.e., the nodes or the cities), a combinatorial explosion can occur with the increase in the number of vertices. Some existing studies used deterministic algorithms [

Various ACO algorithms have been proposed for NP-hard optimization problems [

Therefore, this paper focuses on proposing an efficient scheme library-based ACO algorithm with a two-optimization (2-opt) strategy to solve a novel and special DTSP model. The novelties and contributions of this paper mainly include three aspects in terms of problem model, optimization framework, and algorithm design.

Firstly, this paper proposes a novel dynamic change fashion in the problem model to build the DTSP. In most of the existing studies on DTSP, the dynamic factors mainly include the change of weights or the change of distance between two nodes. To solve this kind of DTSP, researchers focus on developing local search operators to optimize the route after the environmental changes quickly. Unlike these DTSP models, this paper proposes to solve a novel and special DTSP model, which mainly focuses on the environmental change of node positions. In this DTSP model, the environmental change is known in advance, and the new environment can be similar to certain previous environments. The new path should be quickly optimized after the nodes’ locations change.

Second, in the optimization framework, this paper proposes an idea of offline optimization and online application framework to efficiently reuse the historical information to help fast respond to the dynamic environment. In offline optimization, several candidate solutions are optimized in advance and stored in a mode scheme library, while in the online application, the candidate solutions stored in the mode scheme library are reused to solve the DTSP in a new similar environment. In DTSP, since the environmental changes can be similar, i.e., after the environmental change, the new environment can be similar to a certain previous environment, the idea of offline optimization and online application that reuses the previous solutions stored in the mode scheme library can help to solve DTSP and reduce the computational complexity effectively. In this paper, a path constructed by each ant is called a solution.

Third, this paper proposes combining ACO and the 2-opt strategy in the algorithm design to find the optimal route after an environmental change efficiently. Many existing studies show that the ACO is efficient in solving the TSP. In ACO, each ant can change the surrounding environment by releasing pheromones, perceiving the changes in the surrounding environment, and communicating indirectly through the environment, which is suitable for solving optimization problems in a dynamic environment. Moreover, this heuristic probability search method does not easily fall into local optimization and is shown to find the optimal global solution of TSP efficiently. Based on these advantages, ACO is adopted as the optimization method for solving the special DTSP. However, the uncertainty of DTSP makes it more complex than traditional TSP. It has been shown that the integration of local search operators can significantly improve the performance of ACO. Therefore, this paper embedded the 2-opt strategy into the ACO to solve this type of DTSP.

The remainder of this paper is organized as follows:

This section presents previous scholars’ research on TSP and DTSP and elaborates on the proposed DTSP model.

In recent studies on DTSP, Siemiński et al. [

ACO algorithm is one of the most commonly used methods to solve the TSP. Liu [

In addition to the ACO, researchers also use other evolutionary algorithms and heuristic algorithms to solve the DTSP. Meng et al. [

According to the survey, previous studies on DTSP mainly focused on improving algorithms and developing local search operators to address the difficulties of real-time response to environmental changes and route optimization caused by the addition of dynamic factors. Unlike the previous studies, this paper focuses not only on the improvement of the algorithm but also on the development of the DTSP model and the optimization framework.

The TSP is one of the most popular and well-researched NP-hard combinatorial optimization problems. In most real-world applications, the TSP exists in a dynamic environment rather than a static one. The TSP in a dynamic environment, called DTSP, is more challenging and uncertain. As the environment changes over time, the optimal solution of DTSP will change, and the problem’s search space (called the landscape) will also change, which brings challenges. To solve DTSP efficiently, the algorithm is required to detect the change of optimization problem promptly, respond to the change quickly, and find a new optimal solution efficiently. However, it is difficult for classic evolutionary algorithms to satisfy these conditions, which leads to challenges in solving DTSP.

This paper designs a new DTSP model, where the environmental change is the change of the node position, and the environment is regularly changed. This DTSP model considers two conditions in real-world applications. First, the position of a node will change due to road or traffic problems. This change is temporal, and only one node will change in each period (a period corresponds to an environmental change). Second, since traffic jams are usually regular, the environmental changes can also be regular. Therefore, some new environments can be similar to certain previous environments.

Mathematically, the model of DTSP in this paper can be formulated as follows: Given a list of nodes, a salesman must traverse each node once and only once to build a Hamilton path. First, suppose the road map is an undirected graph _{ij}_{ij}_{ij}_{ij}_{i}

The objective of DTSP is to find the shortest Hamilton path when the location of a node changes over time. The Hamilton path can be formulated as permutation Φ (denoted by the node indices). Then, DTSP finds the shortest length in all feasible permutations. More precisely, this paper formulates it as follows:

The constraints for DTSP are formulated as follows:

In this DTSP model, the environmental change is the change of node position. When the location of a node changes in a new environment, the path must be re-optimized. Note that, in this DTSP model, the starting node is fixed, and its position remains unchanged. When a new environment starts, the position of a node will change. The location change rule is as follows:
_{0}(_{0}, _{0}) is the position of the original location of the changing node, and Δ

The objective of DTSP is to find the optimal Hamilton path of the salesman to minimize the total distance after the environmental change. This type of DTSP widely exists in daily life. For example, in logistics distribution, the target location may change in some real-world scenarios. After the position of a node is changed, the optimal solution in the previous environment may not be the optimal solution in the current environment. Thus, the algorithm is required to quickly find an optimal path after the change of node position. Therefore, research on this type of problem is of great practical significance. The problem will become more complex by changing some variables, such as increasing the number of salesmen or the number of nodes with changed locations.

Different from existing studies, in the proposed DTSP model, the environmental changes can be regular. That is, the new environment can be similar to some previous environments. To enhance the performance according to this property, this paper proposes an interesting and effective idea of offline optimization and online application strategy, which stores the optimized solutions in the scheme library and reuses the solutions after the environmental change. When users encounter similar environmental changes, they can directly call the corresponding scheme stored in the scheme library for online application. If a change in the scheme library requires no optimization scheme, the proposed ACO with 2-opt algorithm is called for optimization and placing the optimized solution into the scheme library. Herein, this paper chooses ACO as the optimization algorithm. Many researchers use ACO because of its flexibility and strong adaptability in solving TSP and DTSP. Furthermore, this paper integrates the 2-opt strategy into ACO, dramatically improving local search ability [

The offline optimization and online application strategy flowchart is shown in

ACO [

In the beginning, each ant selects a node as its starting node (In this paper, the starting node is set as node 0) and maintains a visited nodes sequence to store the visited nodes. In each step of path construction, the ant selects the next node to visit. Specifically, if the current node of ant _{k}_{k}_{ij}_{ij}

In ACO, the pheromone is updated after all ants complete the travel operation. As shown in _{k}_{b}_{b}_{k} _{k}^{k}_{b}

The 2-opt operation, first proposed by Croes et al. [

Based on the above description of ACO and 2-opt strategy, the pseudocode of the proposed ACO with 2-opt algorithm is given in Algorithm 1. At the beginning of the algorithm, initialize the ants and the pheromone on each edge. The starting node (i.e., the first node of each path) of each ant is set as node 0. Then, the roulette selection method selects the next visiting node for each ant according to the probability calculated by

To evaluate the performance of ACO with 2-opt in the special DTSP, this paper set the number of modes (i.e., number of environmental changes) to eight. The DTSP benchmark instance kroA200 is adopted as the benchmark DTSP from the classic TSP library (TSPLIB) [

Parameter | Description | Value |
---|---|---|

Number of ants | 30 | |

Pheromone weight | 1 | |

Heuristic information weight | 5 | |

Pheromone evaporation rate | 0.1 | |

_{0} |
Initial pheromone quantity | 1 |

Edge weight of Δ_{b} |
200 in kroA200 | |

1379 in nrw1379 |

In the experiments, this paper defines eight types of environmental changes and denotes the eight periods corresponding to eight different environments as _{1}–_{8}. In each period, the position of a pre-defined node is changed. Specifically, the eight indexes of the changed node corresponding to the eight periods _{1}–_{8} are 100, 140, 120, 160, 40, 80, 20, and 60 in the instance kroA200. For example, when the period reaches _{5}, the location of node 40 will change. Besides, the eight indexes of the changed node corresponding to the eight periods _{1}–_{8} are 900, 150, 450, 300, 1050, 600, 750, and 1200 in the instance nrw1379. These types of environmental changes cyclically occur until the algorithm meets the termination condition.

Firstly, to show the effectiveness and efficiency of the ACO with 2-opt in solving the DTSP proposed in this paper, this paper conduct the comparison between the proposed ACO with 2-opt, ACO, and GA on the DTSP model. The results with respect to the best value and the mean value on kroA200 and nrw1379 are shown in

Envir. | Change-index | GA | ACO | ACO with 2-opt | |||
---|---|---|---|---|---|---|---|

Best | Mean | Best | Mean | Best | Mean | ||

_{1} |
100 | 34808.78 | 38037.03 | 30918.18 | 31738.51 | ||

_{2} |
140 | 35578.34 | 39702.48 | 30732.48 | 31812.35 | ||

_{3} |
120 | 34129.78 | 38267.25 | 30713.68 | 31207.09 | ||

_{4} |
160 | 35845.55 | 39683.07 | 30567.65 | 31481.35 | ||

_{5} |
40 | 35958.55 | 37671.29 | 30210.45 | 31418.82 | ||

_{6} |
80 | 35134.52 | 37700.04 | 30450.60 | 31284.21 | ||

_{7} |
20 | 36694.34 | 40444.58 | 30108.26 | 31205.17 | ||

_{8} |
60 | 35274.57 | 38741.69 | 30888.61 | 31561.85 |

Envir. | Change-index | GA | ACO | ACO with 2-opt | |||
---|---|---|---|---|---|---|---|

Best | Mean | Best | Mean | Best | Mean | ||

_{1} |
900 | 315134.52 | 318019.91 | 76678.01 | 78461.06 | ||

_{2} |
150 | 310808.78 | 312326.39 | 76937.54 | 79562.62 | ||

_{3} |
450 | 306226.08 | 308267.25 | 76516.83 | 78956.03 | ||

_{4} |
300 | 305003.86 | 311108.47 | 78818.21 | 75562.46 | ||

_{5} |
1050 | 301207.02 | 311016.88 | 76531.58 | 78942.07 | ||

_{6} |
600 | 305845.55 | 313601.06 | 78327.40 | 76137.45 | ||

_{7} |
750 | 300334.99 | 307671.29 | 78346.01 | 75107.18 | ||

_{8} |
1200 | 305274.57 | 315016.15 | 76465.90 | 78523.15 |

Secondly, to show the effect of the local search operation 2-opt, this paper conducts a comparison between the proposed ACO with 2-opt and the ACO without 2-opt, and the results of the comparison are also shown in

The route optimization diagrams of the eight modes on kroA200 and nrw1379 are shown in

In this paper, a new DTSP model is proposed and solved, focusing on the change in node positions over time. In this type of DTSP, a node will regularly change its location due to traffic or other factors during a certain period. This change occurs randomly. Second, this paper proposes an idea of offline optimization and online application. Several solutions are optimized in advance and stored in the scheme library in offline optimization. In the online application, when the environment has changed, and some roads are not feasible, this paper uses the solutions in the scheme library to provide optimal routes to the new similar environment. Third, to effectively solve DTSP via the development of the algorithm, this paper proposes an ACO with a 2-opt strategy. Because ACO is shown to be one of the most effective algorithms in solving TSP, ACO is adopted as the basic optimization method in the special DTSP model and carried out experiments to show its effectiveness of ACO. Our goal is that when the node positions change during this period, the algorithm can provide a new route in advance and minimize the total path length. The experimental results on the DTSP show that this strategy greatly improves the efficiency of the ACO.

Based on this paper, additional versions of DTSP can be extended for future work, and the solution will be more complex. Determining methods to balance the algorithm’s effectiveness and efficiency is a worthy research topic.