Ants and the TSP
What’s a TSP? Nodes with edges in between Visit each node at least once All nodes reachable Might make sense on a 2D grid, might not
Why TSP for ants? Obvious application Really hard It’s a benchmark Easy to understand It works!
How do ants solve it? Pheromones placed on edges that are useful Pheromones evaporate off all edges
Local what? Local minima, maxima, optima
Deciding action Tabu list Visibility Amount of pheromone
Pheromone intensity Probability(path) = (intensity)a(visibility)b a = 0 means greedy search b = 0 means converge quickly A good balance is most useful
Pheromone updates Or 0 if not visited Updated at the end of an iteration (all ants complete tour) D intensity = intensity_constant / length_of_tour Or 0 if not visited Still need evaporation New intensity = decay_constant * intensity + D intensity
How Many Ants? How about #ants = #cities? Place randomly or one at each city, doesn’t matter.
Another Modification Elitist Ant Will only take the best tour so far Keeps the current best solution from “getting lost” More elitists as iterations continue
How good is AS? Similar or better than GP for 30-70 cities On bigger problems Did not find solutions in 3000 steps Converged quickly to “good” solutions Did not do well compared to SP solvers What is needed to fix it? Authors decided on local search
Before moving on The authors of the Ant System analyzed its behavior Does not converge closely Keeps trying new solutions Avoids maxima traps Good for converging quickly to “good” solutions Good for dynamic situations
ACS ACS (Ant Colony System) – improved AS Four changes Transitions Pheromone updates Local updates Candidate lists
1) A new transition rule More explicit exploration enforcement Next city selected from candidate list If random > threshold, most desireable Otherwise, weighted random (same as before)
2) A new update rule Intensity formula is the same D intensity = intensity_constant / length_of_tour Or 0 if not visited Only applied to best solution Other solutions must emerge through local updates
3) Local updates Intensity decays when ant follows edge Intensity = (1-decay_constant)*intensity + (decay_constant) * leftover_constant Forces ants to try different paths
4) Candidate list The q closest unvisited cities are the only ones considered If no unvisited cities, go to the nearest city
How does ACS do? Tested on 2500 iterations with 10 ants for 50 cities Comparable to or better than standard algorithms. On larger problems, a local search is needed
Unimplemented improvements Actually use the threshold Allow the r best ants to udpate Penalize bad routes Use better local searches Test using “dynamic benchmarks”
Implemented modifications Max-Min AS Only one ant updates Pheromones bounded to (min, max) Trails initialized to max. Trail-smoothing D intensity a (max – intensity)
Another modification AS-rank Uses elitists Updates proportional to performance
The End With local-optimizing help, ants were successful with the TSP. Questions?