← 🤖 Algorithms

🧬 Genetic Algo

Mode
Target string
Generation 0
Best fitness
Avg fitness
Diversity
Best string
String mode: watch characters evolve letter-by-letter · Landscape: population climbs toward the global peak

🧬 Genetic Algorithm — Evolution

Watch evolution in action! A population evolves through selection, crossover and mutation. Two modes: evolve a target string (like Dawkins' Weasel program) or optimise the devilishly hard Rastrigin function.

🔬 What It Demonstrates

Tournament selection picks the fittest parents. Crossover recombines their genes. Random mutations add diversity. Over generations, the population converges on the optimum.

🎮 How to Use

Adjust mutation rate, population size and crossover probability. Watch the fitness chart climb. In Rastrigin mode, see how the population escapes local optima.

💡 Did You Know?

Genetic algorithms mimic billions of years of evolution in seconds. They're used to optimise jet engine fan blades, antenna shapes for NASA spacecraft, and even trading strategies.