BrowseComputing & AI / Algorithms & Computation

Genetic Algorithms

A genetic algorithm (GA) searches by maintaining a population of candidate solutions rather than improving one solution along a single path.

Explanatory diagram for Genetic Algorithms.
Local explanatory diagram

A typical generation:

  • evaluate each candidate with a fitness function;
  • preferentially select candidates to reproduce;
  • combine information through crossover/recombination;
  • introduce variation through mutation;
  • form the next population and repeat.

Big idea: Evolution supplies the search metaphor, but the fitness function defines what “better” means. A GA can become extremely good at exploiting the wrong objective.

Compared with gradient descent, GAs do not require differentiability and can search discrete, irregular, or simulation-defined spaces. The price is usually many more objective evaluations. They also provide no general guarantee of finding the global optimum.

Population diversity matters. Too much selection pressure can cause premature convergence; too little selection means little progress. Mutation is not there merely to imitate biology — it helps reintroduce/search variation that selection and crossover may lose.

For your GA Playground, useful methods such as tournament selection and rank selection are different ways of controlling how strongly fitness differences translate into reproduction.

sources

John Holland, *Adaptation in Natural and Artificial Systems* (1975/1992)Mitchell, *An Introduction to Genetic Algorithms* (MIT Press)