Three algorithms compete on the same city set: Nearest Neighbour (greedy), 2-opt (local search) and Simulated Annealing (probabilistic). Drag cities or click to add new ones and watch routes optimise.
TSP asks: what's the shortest route visiting all cities exactly once? It's NP-hard — no known polynomial-time algorithm exists, but heuristics find near-optimal solutions.
Click to add cities. Drag to reposition them. Run all three algorithms and compare tour lengths. Watch Simulated Annealing escape local optima that trap 2-opt.
With just 20 cities, there are 20!/2 ≈ 1.2 × 10¹⁸ possible routes. The record exact solution for real TSP is 85,900 cities, computed in 2006 by Applegate, Bixby, Chvátal and Cook.