Introduction - If you have any usage issues, please Google them yourself
Ant colony algorithm to solve TSP problems MATLAB realization
Dispatched m ants, ants randomly select a path for each, denoted I = [1 2 3 · · · m], length denoted as long (I)
Calculated pheromone each path, denoted as P (I) = 1/long (I), and the normalization processing
Re-dispatched m ants, select the path according to the following rules:
Each ant with a probability p1 choose a new path (path random)
Ants do not select a new path with probability P (I) choose the path I
All ants are in a small probability p2 locally on their own path to change
Update all paths, each path is calculated pheromone
Repeat the above steps until the remaining path.