What is a genetic algorithm?

A genetic algorithm is one of a family of computational models inspired by evolution. It encodes candidate solutions in simple chromosome-like data structures and improves a population of them generation by generation through selection, crossover and mutation. It is mostly used as an optimisation tool.

Unlike gradient descent, which updates a single solution using derivatives, a genetic algorithm uses no gradient information and tries many candidates at once, so it also suits problems with many local optima.

Topic
Machine learning, models and training
Also known as
GA, canonical genetic algorithm, simple genetic algorithm
Origin
1975, the canonical genetic algorithm model

How a genetic algorithm works

  1. In the canonical form each candidate is a bit string; the initial population is usually random.
  2. An evaluation function scores each candidate and better candidates get more chances to reproduce through selection.
  3. Crossover swaps fragments of two parents; mutation changes bits with a low probability, typically below 1%.
  4. Evaluation, selection, crossover and mutation form one generation, repeated over many generations.

In more detail

How is selection done?

In the canonical genetic algorithm the probability that a string is copied into the intermediate population is proportional to its fitness. This is likened to a roulette wheel on which each individual gets a slice proportional to its fitness. Fitness can also be assigned by rank in the population or by sampling methods such as tournament selection.

Commonly confused terms

TermHow it differs
Reinforcement learningIn reinforcement learning an agent interacts with an environment and learns a policy that maximises reward. A genetic algorithm instead evolves a population of candidates over generations. A controlled comparison in image classifier architecture search gave evidence that evolution can reach results faster than reinforcement learning on the same hardware, especially early in the search.

Why a genetic algorithm matters for on-premises AI

Because it makes relatively few assumptions about the problem, it suits black-box problems such as design, scheduling and hyperparameter search. An antenna designed with evolutionary algorithms for NASA's ST5 mission launched in 2006 as the first computer-evolved hardware in space. Evolutionary search is also used in neural architecture search.

ON-PREMISES EXAMPLE

A manufacturer plans its weekly machine schedule with a genetic algorithm. Each chromosome is a job sequence and the evaluation function penalises late deliveries and set-up times. The planning team compares the best few schedules and applies the one it approves.

Common questions

Is a genetic algorithm a machine learning method?

It is primarily a search and optimisation method. In machine learning projects it can drive hyperparameter and architecture search, while neural network weights are usually trained with gradient-based methods.

Does a genetic algorithm always find the best solution?

No. It is robust but very general and guarantees no optimum. If a good optimisation method exists for the specific problem, that method may suit it better.

How high should the mutation rate be?

In the canonical genetic algorithm mutation is applied to each bit with a low probability, typically below 1%. The rate is tuned by experiment for the problem and the encoding.

Sources

In the glossary: Glossary, E to L

What does this term mean for your infrastructure?

We can work out together in a technical assessment how it maps onto your data, hardware and security requirements.

Request a technical assessment →

This site sets no cookies. Visitor numbers are counted in aggregate using a cookieless method that does not identify anyone. See the Privacy Policy for details.