Presentation is loading. Please wait.

Presentation is loading. Please wait.

Ants and the TSP.

Similar presentations


Presentation on theme: "Ants and the TSP."— Presentation transcript:

1 Ants and the TSP

2 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

3 Why TSP for ants? Obvious application Really hard It’s a benchmark
Easy to understand It works!

4 How do ants solve it? Pheromones placed on edges that are useful
Pheromones evaporate off all edges

5 Local what? Local minima, maxima, optima

6 Deciding action Tabu list Visibility Amount of pheromone

7 Pheromone intensity Probability(path) = (intensity)a(visibility)b
a = 0 means greedy search b = 0 means converge quickly A good balance is most useful

8 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

9 How Many Ants? How about #ants = #cities?
Place randomly or one at each city, doesn’t matter.

10 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

11 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

12 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

13 ACS ACS (Ant Colony System) – improved AS Four changes Transitions
Pheromone updates Local updates Candidate lists

14 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)

15 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

16 3) Local updates Intensity decays when ant follows edge
Intensity = (1-decay_constant)*intensity + (decay_constant) * leftover_constant Forces ants to try different paths

17 4) Candidate list The q closest unvisited cities are the only ones considered If no unvisited cities, go to the nearest city

18 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

19 Unimplemented improvements
Actually use the threshold Allow the r best ants to udpate Penalize bad routes Use better local searches Test using “dynamic benchmarks”

20 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)

21 Another modification AS-rank Uses elitists
Updates proportional to performance

22 The End With local-optimizing help, ants were successful with the TSP.
Questions?


Download ppt "Ants and the TSP."

Similar presentations


Ads by Google