Labs · Evolutionary Computing
Traveling Salesperson (GA)
The phrase GA evolved strings of letters. Here the DNA is an ordering: the sequence in which to visit every city, and fitness rewards shorter round trips. Checking every route is impossible (40 cities have ~10⁴⁶ tours), but evolution finds very good ones quickly.
Orderings need special operators, because ordinary crossover would duplicate or drop cities. Order crossover copies a slice from one parent and fills the rest in the other parent's order. Mutation reverses a random section (a "2-opt" move), which untangles crossing paths.
Click to add cities while it runs. Set the mutation rate to 0 and watch progress stall.
Controls
- Cities
- City layout
- Population
- Mutation rate
- Elites kept
- Generations per frame
- Route colour
- City colour
Evolved from Evolving a Phrase.
Evolved into Simulated Annealing.