*3.1. ACO-Index*

According to the definition given in Equation (7), the same route may lead to different opposite paths. Taking a TSP of six cities as an example, path (1, 2, 3, 4, 5, 6) and path (2, 3, 4, 5, 6, 1) are the same path; however, their opposite paths, (1, 4, 2, 5, 3, 6) and (2, 5, 3, 6, 4, <sup>1</sup>), are different.

In addition, the initialization procedure of ACO is not random compared with DE, but more similar to the greedy algorithm, which selects a closer according to the rule of state transition. Therefore, opposite paths are always longer than the original ones generally and cannot be used pheromone updating. Aiming to solve the shortcomings, a novel ACO algorithm, namely ACO-Index, is proposed based on a modified strategy of opposite path construction.

Opposite path construction is mainly composed of two steps. The first step is the path sorting, and the second is the decision of opposite path. Suppose the number of cities *n* is even, then, during path sorting, put the path *P* back into a cycle and appoint a particular city A as the starting city with index 1. In addition, the rest of the cities will be given indices according to their position in this cycle. In this way, we could ge<sup>t</sup> the indices *P*ind= [1, 2, ..., *<sup>n</sup>*].

During the second step, indices of the opposite path *P*CWind should be found through Equation (7) and the opposite path *P*CW can be found based on the indices *P*CWind appointed previously.

Moreover, when the number of cities *n* is odd, an auxiliary index should be added to the end of the indices *P*ind, and we could ge<sup>t</sup> *P*aux. According to Equation (7), we could ge<sup>t</sup> the opposite indices *P*CWaux , and its last index is the auxiliary index itself. Remove the latest index, and we can ge<sup>t</sup> *P*CWind . In addition, then, decide the opposite path *P*CW according to the opposite indices *P*CWind.

In this way, opposite paths for different paths that share the same cycle route are the same. Pseudocode for opposite path construction is addressed in Algorithm 1.

#### **Algorithm 1** Constructing the opposite path


Although some paths may be longer than the optimal path, they still contain useful information within themselves, which inspires us to apply them to reasonably modifying pheromone. For ACO algorithms, if the number of ants is *m*, the number of paths should also be *m* for pheromone updating. In the proposed ACO-Index, the top *m*1 shortest original paths and the top *m*2 shortest opposite paths will be chosen to form the *m* = *m*1 + *m*2 paths. Algorithm 2 presents the pseudocode for pheromone updating.

**Algorithm 2** Updating pheromone

**Input:** original paths and opposite paths

1: Sort original paths and opposite paths by length

3: Construct *m* = *m*1 + *m*2 new paths

4: Update pheromone according to Equation (2)

**Output:** Pheromone trail in each path

<sup>2:</sup> Select the top *m*1 shortest paths and the top *m*2 shortest opposite paths

Algorithm 3 shows the pseudocode for the primary steps of ACO-Index for total iterations *N*max.


**Input:** parameters: *m*, *n*, *α*, *β*, *ρ*, *Q*, *m*1, *m*2, *N*max 1: Initialize pheromone and heuristic information 2: **for** iteration index *Nc* ≤ *N*max **do** 3: **for** *k* = 1 to *m* **do** 4: Construct paths according to Equation (1) 5: Construct opposite paths through Algorithm 1 6: **endfor** 7: Update pheromone according to Algorithm 2 8: **endfor Output:** the optimal path
