Capitals Tour

A genetic algorithm searching for a short closed tour of 22 world capitals. Orange is the best route found so far; faint blue lines are other candidates in the current generation. A marker walks the best tour so the visit order is readable. Fitness is great-circle distance.
loading data...
Chapter 9 (Evolution). The genome is a visiting order, fitness is total haversine distance, crossover is ordered crossover, mutation swaps two stops. Edges that cross the Pacific are split at the date line so the flat map does not draw a spurious strip across Eurasia.
Data: curated capital coordinates in data.json. Distances are real great-circle km.