*3.3. ACO-Rand*

In the pheromone updating stage of ACO-Index or ACO-MaxIt, it is decided based on experiences of when to calculate the opposite paths. Therefore, in this section, another strategy to update pheromones is addressed, and the novel ACO algorithm is named ACO-Rand since whether or not to construct the opposite path is decided by two random variables.

4

The whole procedure of ACO-Rand is much like that of ACO-MaxIt; however, two random variables *R*0 and *R* are introduced. *R*0 is chosen randomly but fixed after generated, and *R* is randomly selected during each iteration. The pseudocode of ACO-Rand is given in Algorithm 6.

**Algorithm 6** ACO-Rand algorithm

```
Input: parameters: m, n, α, β, ρ, Q, m1, m2, Nmax, R0
 1: Initialize pheromone and heuristic information
 2: for iteration index Nc ≤ Nmax do
 3: for k = 1 to m do
 4: Construct paths according to Equation (1)
 5: endfor
 6: Generate a random variable R
 7: if R < R0 then
 8: Construct opposite paths according to Algorithm 4
 9: Update pheromone according to Algorithm 2
10: else
11: Update pheromone according to Equation (2)
12: endif
13: endfor
Output: the optimal solution
```
#### *3.4. Time Complexity Analysis*

The main steps of the three improved ant colony algorithms include initialization, solution construction and pheromone updating. The time complexity of initialization is *<sup>O</sup>*(*n*<sup>2</sup> + *<sup>m</sup>*). The time complexity of constructing the solution is *<sup>O</sup>*(*mn*<sup>2</sup>). The time complexity of pheromone updating is *<sup>O</sup>*(*n*<sup>2</sup>). In addition, the time complexity of constructing and sorting the inverse solutions is *<sup>O</sup>*(*n*<sup>2</sup>). Therefore, the complexity of the final algorithm is *<sup>O</sup>*(*Nmaxmn*<sup>2</sup>). It is the same time complexity as the basic ant colony algorithm. Therefore, the improved algorithm does not increase significantly in time.

#### **4. Experiments and Results**

AS and PS-ACO are employed as ACO algorithms to verify the feasibility of three opposition-based ACO algorithms. The experiments were performed in the following hardware and software environments. CPU is Core i5@2.9 GB, and RAM is 16 GB. The operating system is Windows 10. TSP examples are exported from TSPLIB (http://comopt.ifi.uni-heidelberg.de/software/TSPLIB95/tsp/).
