Explain like I'm five · Systems

What is a Genetic Algorithm?

Genetic algorithms, told as a story about mixing and twisting engine-tuning dial settings across generations to find the best one.

306045we want the dial settings where the engine runs besttoo many combinations to try them all

We want the dial settings where the engine runs best.Too many combinations to try them all.

2070this combo? that combo?trying each combo by hand never endswe need a way to mix the good settings together

Trying each combo by hand never ends.We need a way to mix the good settings together.

7268generation 1: the two best performers80generation 2: a better mix of the twogenetic algorithm: mix the best settings, twist a little, find better generationsover many generations, it edges closer to the best setting

A genetic algorithm mixes the best settings, twisting occasionally, to search for better ones.Over many generations, it edges closer to the best setting.

Create a populationmakes many settings at once
Score fitnessscores how well the engine runs on each setting
Crossovermixes two good settings into a new one
Mutationoccasionally twists a setting at random
the generation-by-generation cycle① first, create many settings (population)② score how well each one runs (fitness)③ mix the good settings together (crossover)④ occasionally twist a new setting at random (mutation)⑤ make these the next generation, repeat from ②

After creating the first settings, steps ② to ⑤ repeat each generation.Scoring through twisting repeats generation after generation.

88many generations later, a pretty good setting turns upbut the single perfect setting is never guaranteedwith too many options, a genetic algorithm finds a pretty good answer faster than trying them all

A genetic algorithm doesn't always find the single perfect setting.With too many options, a genetic algorithm finds a pretty good answer faster than trying them all.

In one breath

A genetic algorithm mixes well-performing settings from a population, occasionally applies a random twist, and across generations searches for a progressively better answer.

A genetic algorithm is an optimization technique modeled on biological evolution — selection, crossover, and mutation. It builds a population of candidate solutions, scores each with a fitness function, selects the fitter ones to produce offspring via crossover, and applies mutation at low probability to preserve diversity. Repeating this over many generations converges toward a near-optimal answer, though it never guarantees the global optimum.

When grown-ups say it

Population
The many dial settings in one generation. A collection of candidate solutions.
Fitness Function
The scorecard for how well a setting performs. Decides which individuals survive.
Selection
Picking out the well-performing settings. Higher fitness means a higher chance of being picked.
Crossover
Mixing two settings into a new one. The new setting inherits good traits from both parents.
Mutation
Occasionally twisting a setting at random. Keeps the settings diverse, so they don't all crowd around one spot.
Generation
One cycle of updating the population. The population's scores generally improve generation after generation.
Local Optimum
A pretty good setting, but not the very best. A genetic algorithm can get stuck here.
Metaheuristic
A family of strategies for a good-enough answer, fast. Genetic algorithms belong to this family.
Next story
Overlapping Repairs Across Several Benches →
Want another term as a picture book? Request →