Keywords

1 Introduction

One of the common combinatorial optimization problems is the traveling salesman problem (TSP) [6]. Given distances (edges) connecting cities, the TSP finds the shortest routes to visit all cities. The TSP is applied to various problems, such as vehicle routing and job-shop scheduling [5]. However, optimization problems in the real world are considered more complicated than the TSP. For example, in a transportation company’s delivery plans, even if the company constructs the shortest circuits to access cities, these routes may become inaccessible due to road damage or accidents.

In this study, we consider constructing mutually independent circuits with no shared edges to improve reliability and propose a K-independent average TSP (KI-Average-TSP) that minimizes the weighted sum of the average and standard deviations of \(K\) circuits’ costs, where the circuits are mutually independent, that is, there are no shared edges among the circuits. Compared to a study to find multiple independent Hamiltonian paths in a graph [12], this study minimizes the cost by considering the standard deviation in a complete graph so that the \(K\) circuits act as backup routes. Figure 1 shows an example of \(K=2\) circuits in a complete graph of \(N=8\) vertices.

Fig. 1.
figure 1

An example of K-Independent paths (with \(K=2\)), where multiple paths do not share the same edge in \(N=8\) complete graph.

To solve the problem, we propose an ant colony optimization (ACO)-based K-independent average ACO (KI-Average-ACO). ACO [2, 7] is known as a metaheuristic solution to the TSP using ant swarm characteristics and simulates the pheromone communication of ants on a graph to find the approximate shortest path. In our optimization algorithm, \(K\) ants move simultaneously, making it possible for \(K\) ants to use equally favorable edges and reducing the standard deviation. However, as the ants move, the number of reachable vertices for the ants decreases, and the circuit construction failure rate increases. Therefore, we introduce two heuristics to reduce the failure rate of circuit construction. The key concept of the first heuristic is a degree of possible options that represents the number of vertices an ant can reach from its current vertex. The destination of ants is stochastically determined by this number to reduce the circuit construction failure rate. The second heuristic, called 2-best-opt, is an algorithm based on the idea of 2-opt [3, 6]. It uses a greedy algorithm in reconstructing a better path to obtain \(K\) circuits if circuit construction fails.

In this paper, we evaluated our proposed method by comparing the approximate solution obtained using KI-Average-ACO with the solution obtained using a quadratic programming method for a binary search. Comparison results showed that the number of circuits for KI-Average-ACO was higher, and KI-Average-ACO obtained a better approximate solution than the quadratic programming method.

Related Work. ACO is a search algorithm that is inspired by the process by which ants use pheromones to discover the shortest path to food [2]. In particular, it is known as metaheuristics for finding approximate solutions to shortest path problems, as typified by the TSP. An application of ACO is the vehicle routing problem [11], which delivers resources from a depot to customers through delivery vehicles. Another application is the multiple TSP [4], which builds a partial traveling circuit in which multiple salesmen share each other’s visits to cities from a depot.

On the other hand, a few studies have been conducted on algorithms to find multiple independent circuits in a complete graph. Teng [12] reported properties such as the conditions for establishing multiple Hamiltonian paths in a given graph. However, algorithms for constructing circuits that are independent of each other have not yet been investigated.

Paper Organization. The organization of this paper is as follows. Section 2 defines KI-Average-TSP and a related problem named KI-Total-TSP. Section 3 introduces our optimization algorithm named KI-Average-ACO. Section 4 presents experimental results. Finally, Sect. 5 concludes the paper and presents future work.

2 Problem Description

In this section, we give the definition of our target problem named K-independent average traveling salesman problem (KI-Average-TSP). In addition, although not directly dealt with in this study, we also define K-independent total traveling salesman problem (KI-Total-TSP), which is another optimization problem related to KI-Average-TSP. The former is the problem of finding the K-independent circuits that minimize the weighted sum of average and standard deviation in a given complete graph, while the latter is the problem that removes the term of standard deviation from the objective function in KI-Average-TSP and minimizes only the total cost of K-independent circuits.

Here, let \(G = (V, E, d)\) (with \( |V| = N, |E| = \frac{N(N-1)}{2})\) be a weighted undirected complete graph, where \(d_{ij}\) is the weight of edge \((i, j)\) and \(N\) is the number of cities.

2.1 K-Independent Average TSP

KI-Average-TSP is a problem to minimize the weighted sum of the average and standard deviations of \(K\) independent circuits’ cost in a graph \(G\). The definition is as follows.

Definition 1

KI-Average-TSP is a problem to perform the following optimization in graph \(G = (V, E)\).

$$\begin{aligned}&\mathbf{min}&\text {cost}_\text {avg} + \gamma \cdot \text {cost}_\text {sd}^\theta&\end{aligned}$$
(1)
$$\begin{aligned}&\mathbf {subject\ to}&\sum _{k \in K} x_{ijk} \le 1&(\forall i, j \ (i \ne j)) \end{aligned}$$
(2)
$$\begin{aligned}&\sum _{j \in V} x_{ijk} = 1&(\forall i, k) \end{aligned}$$
(3)
$$\begin{aligned}&\sum _{j \in V} x_{jik} = 1&(\forall i, k) \end{aligned}$$
(4)
$$\begin{aligned}&\text {u}_{ik} + 1 - (N-1)(1- x_{ijk}) \le \text {u}_{jk}&(\forall i,j,k) \end{aligned}$$
(5)
$$\begin{aligned}&x_{ijk} \in \{0, 1\}&\end{aligned}$$
(6)
$$\begin{aligned}&0 \le u_{ik} \le N -1&\end{aligned}$$
(7)

where

$$\begin{aligned} \text {cost}_\text {avg}= & {} \frac{1}{K}\text {cost}_\text {sum} , \end{aligned}$$
(8)
$$\begin{aligned} \text {cost}_\text {sd}= & {} \sqrt{\frac{1}{K} (\sum _{k \in K} (\sum _{i \in V}\sum _{j \in V}d_{ij} \cdot x_{ijk} - \frac{1}{K}(\sum _{i \in V}\sum _{j \in V}\sum _{k' \in K} d_{ij} \cdot x_{ijk'}))^2)} . \end{aligned}$$
(9)

The value \(x_{ijk}\) represents the probability of ant \(k\) using the edge connecting vertex \(i\) to vertex \(j\). The value \(u_{ik}\) is the arc-constraint to excludes subtours based on the Miller–Tucker–Zemlin formulation [8]. Hereafter, the total cost of the \(K\) circuits is expressed as \(\text {cost}_\text {sum}\). The weighted sum is represented as \(\text {cost}_\text {ssd} = \text {cost}_\text {avg} + \gamma \cdot \text {cost}_\text {sd}^\theta \), where \(\text {cost}_\text {avg}\) and \(\text {cost}_\text {sd}^\theta \) respectively represent the average and standard deviation of \(K\) circuits’ costs. Variables \(\gamma , \theta \) are parameters for weighting the average and standard deviation respectively, and the constraints are the same as in KI-Total-TSP.

2.2 K-Independent Total TSP

The KI-Total-TSP is a problem to minimize the total cost in \(K\) circuits among the combinations of \(K\) independent circuits in the graph \(G\). The definition is as follows.

Definition 2

KI-Total-TSP is a problem to perform the following optimization in graph \(G=(V,E, d)\).

$$\begin{aligned} \mathbf{min} \quad \quad \quad \sum _{i \in V}\sum _{j \in V}\sum _{k \in K} d_{ij} \cdot x_{ijk} \end{aligned}$$
(10)

with the same constraint conditions as in the KI-Average-TSP (i.e., Eqs. 27).

We would like to note that the problems introduced above are complementary to each other. That is, the solution of KI-Average-TSP is useful when finding K circuits with similar utility values. On the other hand, KI-Total-TSP is useful when finding K circuits with ranked utility values. Specifically, the former is a case, where multiple packets are sent simultaneously through K routes, while the latter is a case, where spare routes should be prepared for a failure of the current route.

3 K-Independent Average ACO

3.1 Overview

In this section, we explain the proposed K-independent average ant colony optimization (KI-Average-ACO) algorithm for solving KI-Average-TSP. Considering that it is difficult to calculate the exact solution to KI-Average-TSP in a feasible time, we propose KI-Average-ACO to obtain an approximate solution.

Unlike the original ACO, KI-Average-ACO averages the cost of \(K\) circuits by repeatedly moving \(K\) ants along one edge at a time. However, because the construction failure rate increases when \(K\) ants move simultaneously, we use two heuristics. The first heuristic uses a degree of possible options, which indicates the feasible vertices the ant can reach. Ants move to vertices with fewer destinations using this index, putting off many potential movable vertices. The second is 2-best-opt, which searches efficiently by reconstructing failed circuits greedily using 2-opt. Using these heuristics, it is possible to reduce the construction failure rate while averaging the moving cost of \(K\) circuits, rather than repeating ACO. The pseudocode of KI-Average-ACO is presented in Algorithm 1.

figure a

3.2 Simultaneous Movement of Ants

KI-Average-ACO differs from the original ACO in moving \(K\) ants along one edge at a time. In the original Ant System [1] and Max-Min Ant System [10], some ants construct a path. If these algorithms are applied to KI-Average-TSP repeatedly, some ants construct a circuit using preferable edges greedily. Consequently, the cost of the circuit in the latter half of the construction increases, the shape becomes complicated, and the averaging cannot be satisfied. In contrast, in Line 17 in the pseudocode, KI-Average-ACO moves \(K\) ants along one edge at a time, so that all ants can use their preferred edges. In Line 19, ants are arranged in descending order of moving cost so far after every movement, and the next ants move in this order. As a result, it is possible to perform the averaging of the cost in a greedy manner, because ants, which have consumed bigger moving costs so far, can move to smaller-cost and pheromone-rich edges more preferentially. We would like to note that the cost of an edge used becomes infinite and the pheromone value becomes zero to ensure that it is not used as much as possible again.

3.3 Heuristic with Degree of Possible Options

KI-Average-ACO moves \(K\) ants simultaneously. As a result, close to the \(K\)-th movement, there are possibilities that ants may reuse edges used by other ants, thereby increasing the construction failure. Therefore, to increase the number of successes, we introduce the heuristic with the degree of possible options. This is incorporated into the transition probability equation in Line 17 in the pseudocode.

Assume that each of the \(K\) ants has already moved \(t\) times out of \(N\) times, and the set of vertices visited by ant \(h\) is \(U_h\). Here, we define \(R_h^t(x) \subseteq V\) as a function that returns a set of vertices where ant \(h\) can move consistently from vertex \(x\) to vertex \(y\). The word “consistent” averages that vertex \(y \in R_h^t(x)\) satisfies \(y \notin U_h\) and the edge \((x, y)\) is not yet used by other ants \({1, 2, \dots , h-1, h+1, \dots , K}\).

At this time, transition probability equation \(P_{ij}^h\) that ant \(h\) selects the next vertex \(j\) from the vertex \(i\) is defined by Eq. 11.

$$\begin{aligned} P_{ij}^h = \frac{[\tau _{ij}]^\alpha [\eta _{ij}]^\beta }{\sum _{u \in N_h^t(i)}[\tau _{iu}]^\alpha [\eta _{iu}]^\beta } \times \frac{1}{|R_h^t(j)|} , \end{aligned}$$
(11)
$$\begin{aligned} \eta _{ij} = \frac{1}{d_{ij}} \end{aligned}$$
(12)

where \(\tau _{ij}\) is the pheromone quantity of the edge \((i, j)\) and \(\eta _{ij}\) is the heuristic value. \(N_h^t(i)\) is a set of vertices where an ant \(h\) can move from vertex \(i\) in the \(t\)-th move. In Eq. 11, the transition probability is divided by the number of vertices \(|R_h^t(j)|\) that ant \(h\) can move from vertex \(j\). Using this operation, ants can preferentially move to vertices that have little non-affordably movable vertices. This reduces the construction failure rate. The time complexity of KI-Average-ACO with this heuristic is \(O(KN^3)\), while that without this heuristic is \(O(KN^2)\). Although the time complexity is increased by \(O(N)\) during the moving process, the construction failure rate is reduced.

3.4 2-best-opt

In Line 9, we use the heuristic called 2-best-opt to improve paths after constructing the circuits to further increase the success probability of constructing independent circuits and minimizing \(\text {cost}_\text {ssd}\). Procedures of the 2-best-opt are depicted from Line 23 to 40.

Assume that in the \(K\) paths after the construction, an edge \(e=(a, b)\) is redundantly used in multiple paths of \(F \ (> 1)\) ants. At this time, 2-best-opt is performed for each of the \(l_1, l_2, \ldots , l_F\) paths of \(F\) ants. 2-best-opt is the following operation and is shown in Fig. 2 and from Line 23 to 40.

Consider a case where an edge \(e=(a, b)\) is redundantly used by other paths of a certain path \(l\) and other \(N-1\) edges \(e'=(c, d)\) of the path \(l\) are exchanged by 2-opt. At this time, if the two new edges \(e_1=(a, c)\) and \(e_2=(b, d)\) are not yet used for any \(K\) paths, the number of use of edges can be reduced without contradiction, and the edge \(e'\) is added to the replacement candidate set \(S\) in Line 30 to 33. Then, among the exchange candidates of these edges, an edge \(e' \in S\) is selected and swapped by \(e\) in 2-opt, so that the moving cost of the path \(l\) becomes the smallest by exchanging with the edge \(e\) in Line 36 and 37.

Fig. 2.
figure 2

The example of 2-best-opt which is trying to swap \(e = (a, b)\) and \(e' = (c, d)\) because the edge \(e\) is used twice. Swapped edges \(e_1 = (a, c)\), \(e_2 = (b, d)\) can reduce usage count in \(e = (a, b)\).

The time complexity of KI-Average-ACO with 2-best-opt is \(O(KN^2)\), however, experimental results described in Sect. 4 show that the running time of 2-best-opt is smaller than KI-Average-ACO without this heuristic. Using this 2-best-opt, the overlapping edges causing the failure can be corrected greedily and the construction failure rate and \(\text {cost}_\text {ssd}\) can be reduced.

3.5 Pheromone Update

After performing 2-best-opt, in Line 10, if \(K\) paths are reconstructed and are independent of each other, the pheromone update equation, Eq. 13, is executed.

$$\begin{aligned} \tau _{ij}(t+1) = \rho \cdot \tau _{ij}(t) + \sum _{h=1}^K \varDelta _{ij}^h , \end{aligned}$$
(13)
$$\begin{aligned} \varDelta _{ij}^h = {\left\{ \begin{array}{ll} \frac{1}{C_h + \text {cost}_\text {sd}^\theta } &{} ((i, j) \in l_h)\\ 0 &{} (otherwise) \end{array}\right. } \end{aligned}$$
(14)

where \(\rho \) is the retention rate of the pheromone, \(C_h\) is the cost of the circuit constructed by ant \(h\), \(l_h\) is the path of ant \(h\), and \(\theta \) is equal to \(\theta \) in Eq. 1. However, if the \(K\) paths are not independent of each other, the updating equation for the pheromone on the graph and the evaporation of pheromone are not performed from Line 43 to 45. This tries to centralize searching by updating.

4 Empirical Study

4.1 Parameters and Settings

This section presents two experiments to evaluate our algorithm. In the first experiment, the performance of the two heuristics used in KI-Average-ACO was evaluated. In the second experiment, KI-Average-TSPs were solved using KI-Average-ACO and a combinatorial optimization method to compare their solutions and the time taken to obtain these solutions.

Table 1. Parameter settings.

The parameters in the experiments are as shown in Table 1. Here, AT represents the number of cycles to initialize the pheromone using the Ant System on the graph before starting KI-Average-ACO. KT represents the number of cycles that KI-Average-ACO executes to build K paths. LT represents the number of experimental trials performed.

4.2 Performance Evaluation of Heuristics

To evaluate the performance of the heuristics used in KI-Average-ACO, we considered four cases with and without each heuristic and compared them by solving KI-Average TSP for each case. In every case, the pheromone was always updated.

As the graphs used for the optimization problems, we selected three graphs ulysses22, bays29, and att48, which have a different number of vertices from TSPLIB [9], the dataset often used for performance evaluations of TSP solution algorithms.

We attempted to construct 6 circuits in each graph. Here, we set K to this value because it is about half of 10 (\( = \lfloor \frac{22-1}{2} \rfloor \)), which is the maximum number of independent paths for the smallest graph, ulysses22. We measured the weighted cost \(\text {cost}_\text {ssd}\), execution time, and construction failure rate. Even if only one edge is duplicated, this is considered as a construction failure. For example, if the construction failure rate is 0.48, this means that one or more edges have been used in duplicates in 480 of 1,000 trials. The results of the above experiments are shown in Table 2. Here, DPO, 2BO, DPO+2BO, and NONE represent cases, where only the heuristic with degree of possible options was used, only 2-best-opt was used, both two heuristics were used, and neither of the two was used, respectively.

Table 2. Performance of heuristics in KI-Average-ACO.

Table 2 shows the comparison results of the heuristic performance in KI-Average-ACO. These results show that 2-best-opt, in particular, improves the circuit construction failure rate in all three graphs. Moreover, the execution time of 2-best-opt is not long, so this heuristic would be feasible. On the other hand, heuristic with the degree of possible options did not contribute to reduce the cost of the solution even though the execution time was longer than that of 2-best-opt. This is because the execution time of this heuristic takes O(N), and costly edges were also selected to give priority to the reduction of the circuit construction failure rate. However, for ulysses22, the cost of solution was the smallest when heuristic with the degree of possible options was used. This suggests that this heuristic may also be useful depending on the problem type.

4.3 Performance Evaluation of KI-Average-ACO

We evaluated the performance of KI-Average-ACO. Specifically, we compared the costs of solutions obtained using KI-Average-ACO to that obtained using a combinatorial optimization algorithm. In the experiments, we used the graph gr17 with \(N=17\) as a problem to solve. The weighted parameters \(\gamma \) and \(\theta \) of the KI-Average-TSPs were set as 1 and 2, respectively. These parameter settings in Eq. 1 minimized the weighted sum of average and variance.

In general, it is difficult to find the exact solution for KI-Average-TSP. Indeed, in our preliminary experiments, we observed that exact solutions could be found only for problems, where the size of the graph is \(N<8\) and the number of circuits is \(K<3\) in a feasible time. Therefore, we evaluated the performance of KI-Average-ACO and the combinatorial optimization algorithm by comparing the costs of approximate solutions instead of exact solutions. The combinatorial optimization algorithm used as the comparison target is as follows. Since the standard deviation can be calculated from K circuits, a binary search was used to determine whether the maximum difference d of costs between the K circuits could be less than or equal to a certain threshold value. Repeating this operation, while gradually lowering the threshold value within a predetermined time limit, minimized the maximum difference in the costs of K circuits (thus, the standard deviation was also approximately minimized). In this case, the time limit was set to 300 s.

Figure 3 shows the experimental results. The horizontal and vertical axes of the graph represent the K number of circuits in the problem and the total costs of the solutions, respectively. “KI-Average-ACO” and “MO” represent the results obtained using our algorithm and the mathematical optimization algorithm, respectively. Here, the plots of MO for \(K=6,7\) are lost because MO did not find any solution within the time limit. This figure shows that for \(K=1,2,3\), the total cost of the solutions obtained by the proposed algorithm was almost the same as that of MO. Furthermore, for \(K=4,5,6,7\), our algorithm obtained better solutions. We would like to remark on the result when \(K=8\). It is considered that the reason why MO obtained a solution, in this case, is that the solution has to use all edges, so it is no longer necessary to decide whether or not to use edges in the solution. On the other hand, this did not bring any benefit to the solution of our algorithm even though it took more time to calculate as the problem became more complicated. As a result, no solution could be found. However, this is a special case, and overall, we have observed that it is useful, especially when the problems are complicated compared to the mathematical optimization algorithm.

Fig. 3.
figure 3

Costs of solutions for KI-Average-TSP.

5 Conclusions and Future Work

In this study, we proposed two problems named KI-Average-TSP and KI-Total-TSP, which were extensions of the TSP. We also proposed KI-Average-ACO, an optimization algorithm to solve KI-Average-TSP. The idea behind our algorithm is to move K ants simultaneously. However, to reduce the failure rate of circuit construction, we introduced two heuristics with the degree of possible options and 2-best-opt, a heuristic based on 2-opt. We evaluated the performance of our algorithm and the effectiveness of the heuristics. In the experiments, we observed that 2-best-opt significantly contributed to reducing solution costs and construction failure rates. In addition, the solution cost of KI-Average-ACO was reduced when the circuit to be constructed was larger compared to the solution cost of the mathematical optimization algorithm for a binary search.

One of the important future directions is to apply our algorithm to realistic problems. In particular, we would like to generalize KI-Average-TSP to formulate an optimization problem that allows \(m<K\) edges to be shared between circuits and to find its solution algorithm.