Afterglowscreensavers

Genetic Algorithm Evolver Screensaver

The Genetic Algorithm Evolver screensaver runs a real genetic algorithm live, evolving a population of random strings toward a target phrase over generations. It is free, runs in your browser, and ESC exits.

Live preview

Genetic Algorithm Evolver screensaver — A real population, evolving toward a target over generations.

Press ESC to leave fullscreen. Settings are saved in your browser only.

How the Genetic Algorithm Evolver screensaver works

The saver starts with a real population of random character strings, each scored by a real fitness function measuring closeness to a hidden target phrase.

The fittest real strings are more likely to be selected as parents, whose characters combine through real crossover to produce the next generation.

A small real mutation rate occasionally flips a random character, introducing new genetic variation the population can select on.

Once a string in the population exactly matches the target, it holds briefly to show the winning genome, then a fresh target and population begin.

Evolution as an optimisation method

Genetic algorithms borrow the language of natural selection to solve search problems. John Holland at the University of Michigan developed the approach, which was popularised by his 1975 book Adaptation in Natural and Artificial Systems. A candidate solution is encoded as a string of genes, a fitness function scores it, and the better ones are more likely to pass pieces of themselves to the next generation.

Three ingredients drive the process. Selection favours high-scoring candidates, crossover builds a child by splicing together parts of two parents, and mutation randomly changes the odd gene so that new variation keeps entering the population. Too little mutation and the population can converge early on a mediocre answer; too much and the search drifts towards randomness. Tuning population size and mutation rate is part of the craft.

The method needs no gradient, so it can be applied when the landscape is rough or the problem is hard to differentiate. It gives no guarantee of finding the best solution, and a problem with a smooth landscape is usually better served by a conventional optimiser. Matching a known target phrase is a teaching example: a real problem has no target to compare to, only a fitness score. Richard Dawkins used a phrase-matching program, his weasel program, to illustrate how cumulative selection differs from pure chance.

A worked example

Early generations look like pure noise, but real correct characters that happen to appear get selected for and preserved, so recognizable fragments of the target phrase emerge well before the full match.

Settings & tips

Frequently asked questions

Is this a real genetic algorithm?
Yes — real selection, crossover and mutation, the same core operators used in real evolutionary computation.
Does it always find the target?
Yes, eventually — with real mutation continually introducing variation, the population reliably converges given enough generations.
Is a key needed?
No — it is a pure local computation.
Is it free?
Yes — free, no download, in your browser.
What is crossover in a genetic algorithm?
It is the step that creates a child by combining parts of two parents' gene strings. It lets good pieces from different candidates come together.
Why is mutation needed?
It reintroduces variation that selection would otherwise erode, letting the population escape from a local peak. Without it, the population can become uniform.
Do genetic algorithms always find the best answer?
No. They are a heuristic search and offer no guarantee of finding the optimum, so results depend on the fitness function, population size and mutation rate.

← All Science & Research screensavers