EVOLUTION, IN MOTION
One maze. A hundred possibilities.
Watch 100 competing routes evolve, find the exit, and get smarter with every generation.
C++ → WebAssembly Real algorithm. Running in your browser.
Find the way
LoadingLoading the C++ simulation engine.
Watch the best route change as evolution explores.
Routes start at S in the top-left and search for G in the bottom-right. Amber is the best route. Moving dots trace the current population's routes.
LIVE EVOLUTION
Getting ready
Your first maze is on its way.
The whole population, not just the leader.
Breakthrough timeline
Lower is betterEvery generation keeps its strongest routes.
Select a chart point or choose a generation to compare routes.
Settings & engine details 100 routes
Same seed, same maze, same evolution.
- Seed
- —
- Best fitness
- —
- Genome length
- —
Selection in action.
Explore the C++ sourceTry a hundred routes
Each genome is a sequence of moves. Walls block a move; the rest of the route keeps going.
Keep what works
The better half survive. Crossover and mutation produce new routes. When progress stalls, guided mutations explore larger changes.
Find it. Then refine it.
Reaching the goal is the first milestone. Evolution continues until the route is optimal or the generation budget runs out.
Under the hood C++ · WebAssembly · Web Worker · seeded RNG
The actual C++ engine runs in a Web Worker so the interface stays responsive. The native CLI evaluates fitness with a thread pool; this browser build uses one worker.
Fitness = distance remaining × (genome length + 1) + moves used. Distance is measured by breadth-first search (BFS). The BFS distance field guides fitness and some mutations: this is a hybrid genetic search. Guided mutations rewrite route segments toward the goal and expand after a plateau. The dashed overlay is the BFS shortest path, not an evolved route. A lower score wins.
The population has 100 genomes, each at least 100 moves or 1.5× the shortest path. Replay links save maze settings and seed, starting again at generation zero. The timeline records real improvements from this run; inspecting one pauses evolution and never changes the population. Moving dots replay routes, not extra simulation steps. 40 × 40 uses loops to keep searches practical; a solution within the budget is not guaranteed. Keep evolving extends a run in 1,500-generation blocks, up to 15,000.