Research Article

An Improved Ant Colony Optimization Based on an Adaptive Heuristic Factor for the Traveling Salesman Problem

Algorithm 1

AHACO.
Input:, , , , , , , , ,
Output:
(1)Calculate Euclidean distance for the cities and get the number of cities as
(2)Initialize pheromone on all path with
(3)Apply k-means clustering for the cities (equations (7)–(10))
(4)Separate non-classified cities (equation (11))
(5)
(6)
(7)fordo
(8)ifthen
(9)  
(10)  
(11) else
(12)  
(13)  
(14) end
(15)fordo
(16)  fordo
(17)   ifthen
(18)    ant i select next city using , (equations (12)–(13)); //special ant
(19)   else
(20)    ant i select next city by equation (2); //normal ant
(21)   end
(22)   Set tabu table for ant I
(23)  end
(24)  Calculate fitness of the corresponding solution obtained by ant i (equation (1))
(25) end
(26) Select the best solutions for all ants (include normal ants and special ants)
(27) Update global best solution (optimal solution)
(28) Apply improved 2-opt algorithm to optimal solution (Section 3.3)
(29) Update pheromone on normal and special best solution separately (equations (14)–(16))
(30)ifthen
(31)  
(32)  ifthen
(33)   Re-initialize the pheromone on the global best solution with
(34)   
(35)  end
(36) else
(37)  
(38) end
(39)end