Evolutionary algorithm

Also known as: EA

On this page 7

An evolutionary algorithm (EA) is a population-based, stochastic optimization method that searches for good solutions by repeatedly selecting, recombining and mutating candidate solutions, in loose analogy with natural evolution. In evolutionary computation, the term serves as the umbrella name for genetic algorithms, evolution strategies, evolutionary programming, genetic programming and differential evolution.

Evolutionary algorithms need only a way to score each candidate, not gradients or a closed-form model of the problem. That property makes them a practical choice for black-box, noisy, discontinuous or multi-objective problems in artificial intelligence and engineering, at the cost of many more function evaluations than gradient-based methods.

How an evolutionary algorithm works

Every EA maintains a population of candidate solutions and improves it over successive generations. The loop is simple, and the power comes from repeating it thousands of times while selection pressure steers the population toward better regions of the search space.

  1. Initialize a population, usually at random within the allowed bounds.
  2. Evaluate each individual with the fitness function.
  3. Select parents, favoring higher fitness.
  4. Create offspring with crossover and mutation.
  5. Choose survivors for the next generation, often with elitism.
  6. Stop when a budget, a target fitness or stagnation is reached.

The main building blocks and their roles are summarized below. Each one is a design decision, and the right choice depends on how solutions are encoded. The distinction between genotype and phenotype matters here: operators act on the encoded genotype, while the fitness function evaluates the decoded phenotype, so a poor mapping between the two can make small genetic changes produce erratic jumps in quality.

ComponentRole in the searchCommon choices
RepresentationEncodes a solution as a genotypeBit strings, real vectors, permutations, trees
Fitness functionScores solution qualityObjective value, simulation result, penalty terms
SelectionBiases reproduction toward good individualsTournament, rank-based, fitness proportionate
CrossoverCombines information from parentsOne-point, uniform, simulated binary
MutationIntroduces new variationBit flip, Gaussian noise, swap
ReplacementDecides who survivesGenerational, steady-state, plus or comma schemes
Components of a typical evolutionary algorithm

Main families of evolutionary algorithms

The EA families emerged independently in the 1960s and 1970s and differ mainly in representation and in which operator carries the search. Modern practice mixes their ideas freely, but the original distinctions still guide method selection.

FamilyTypical representationMain variation operatorTypical use
Genetic algorithmBit strings or integersCrossoverCombinatorial and discrete problems
Evolution strategiesReal-valued vectorsGaussian mutation with self-adaptationContinuous parameter tuning
Evolutionary programmingFinite-state machines or vectorsMutation onlyBehavior and parameter optimization
Genetic programmingExpression trees or graphsSubtree crossover and mutationSymbolic regression, program synthesis
Differential evolutionReal-valued vectorsDifference-vector mutationContinuous global optimization
Classic and modern EA families compared

Advanced descendants include CMA-ES, which learns a covariance matrix to shape mutations, NSGA-II for multi-objective problems and MAP-Elites for quality diversity. Each one keeps the population-based loop but changes how variation or survival is organized.

Hybrid designs are also common. A memetic algorithm adds local search to each offspring, which often speeds convergence on structured problems, while an island model splits the population into subpopulations that exchange migrants occasionally to preserve diversity and use parallel hardware efficiently.

Key parameters and their effects

Performance depends strongly on a few control parameters. Poor settings cause either premature convergence, where diversity collapses around a local optimum, or slow drift with little progress.

ParameterTypical rangeEffect when too lowEffect when too high
Population size20 to several thousandLoss of diversitySlow progress per evaluation
Mutation rateAbout 1/L per gene for bit stringsStagnationRandom search behavior
Crossover probability0.6 to 0.95Little recombinationDisruption of good structures
Tournament size2 to 7Weak selection pressurePremature convergence
Elite count1 to 5 percent of populationBest solution can be lostReduced exploration
Typical parameter ranges and their influence

In the table, L is the genome length. Evolution strategies and CMA-ES reduce tuning effort through self-adaptation, in which the step sizes are themselves evolved alongside the solutions.

Evolutionary algorithms compared with other optimizers

An EA is rarely the fastest method when gradients are available and the landscape is smooth. Its strength is robustness on rugged or poorly understood fitness landscapes, and its population naturally supports parallel evaluation.

MethodNeeds gradientsStrengthWeakness
Evolutionary algorithmNoGlobal search, multi-objective frontsMany evaluations
Gradient descentYesVery fast on smooth problemsLocal optima, needs differentiability
Simulated annealingNoSimple, single solutionSequential, sensitive to cooling schedule
Bayesian optimizationNoFew evaluations for costly functionsScales poorly beyond about 20 dimensions
Particle swarm optimizationNoFew parameters, fast early progressWeaker on discrete problems
When to prefer an EA over alternative methods

In machine learning, evolutionary methods appear in neuroevolution, hyperparameter search and neural architecture search. For training the weights of large networks, however, gradient methods remain far more efficient, so EAs usually optimize structure or settings rather than millions of weights.

Limitations and common mistakes

Evolutionary algorithms offer no general guarantee of finding the global optimum in finite time, and the no free lunch theorems show that no optimizer wins on all problems. Results are stochastic, so a single run proves very little.

  • Too few runs: report results over 20 to 30 independent seeds with statistical tests.
  • Weak fitness design: an exploitable fitness function produces solutions that satisfy the score but not the intent.
  • Poor encoding: a representation that breaks feasibility wastes most evaluations on invalid solutions.
  • Ignoring evaluation cost: when one evaluation takes minutes, surrogate models or Bayesian methods may be more efficient.

A non-technical view

An evolutionary algorithm solves problems the way a plant breeder improves crops. You start with many different attempts. You keep the best ones. You mix them and change them a little. Then you repeat this over and over.

No single attempt needs to be smart. Improvement comes from many small steps and from keeping what works. After hundreds of rounds, the best attempts are often very good, even for problems that nobody knows how to solve directly. The price is patience: the computer must try a very large number of options.

A concrete example

An engineering team designs a lightweight bracket for a drone frame. The shape must survive a set load while using as little material as possible, and every candidate shape is scored with a finite element simulation that takes about 20 seconds. The problem has many local optima and no useful gradients, so the team chooses a real-valued evolutionary algorithm with a population of 60 and two objectives: mass and maximum stress.

Using NSGA-II, the team runs 150 generations, about 9,000 simulations in total, spread across 32 processor cores, which completes in under two hours. The result is a Pareto front of trade-off designs rather than a single answer. The engineers select a design that is about 30 percent lighter than the original part with an acceptable safety margin, and they confirm it with a physical load test before production.