Supply Chain Lab Watch It Solve: Metaheuristics Lab Home
Network & Optimisation

Watch It Solve: Metaheuristics

Exact methods die of combinatorics: 45 cities means ~1054 possible tours. Watch three metaheuristics attack the same map live - annealing accepting bad moves while hot, a population breeding better tours, ants laying pheromone - and race them against the greedy baseline.

How to use it

Travelling salesman, three ways

Algorithm

Run

Inner state

-
–
vs nearest-neighbour
0
Iterations
–
Worse moves accepted

Red = best tour found. Faint red = the tour being tried right now.

Best-so-far tour length per iteration. Grey dash = greedy nearest-neighbour; good metaheuristics dive under it.

Try these experiments

  1. Run annealing and watch the “worse moves accepted” tile: high while hot, near zero when cold. That early recklessness is what escapes local optima.
  2. On the same 35-city map, race all three for ~15 seconds each. Note ants often find good tours early; annealing polishes deepest.
  3. Restart annealing several times - different final tours! Metaheuristics trade the guarantee of optimality for speed at scale.

About this tool

The concept

TSP with 45 cities has ~1054 tours - enumeration is hopeless. Metaheuristics search intelligently: accept some bad moves, recombine good parents, follow collective trails.

How it works

SA: 2-opt moves, accept worse with e−Δ/T, geometric cooling. GA: order crossover + swap mutation, tournament selection. ACO: 20 ants, pheromone τα·(1/d)β with evaporation.

Winning strategy

None dominates - the No-Free-Lunch theorem. Diversify early, intensify late: exactly what cooling schedules, mutation decay and pheromone evaporation all do.