Crossover · evolutionary computation

Also known as: recombination

On this page 7

Crossover, also called recombination, is the genetic operator in evolutionary computation that builds new candidate solutions by combining parts of two or more parent solutions. It is the main mechanism through which a genetic algorithm exchanges useful structure between individuals in a population, complementing mutation, which introduces small random changes.

In evolutionary computation, crossover rests on a simple hypothesis: if two parents are each good for different reasons, a child that inherits the good parts of both may be better than either. Whether that hypothesis holds depends on the representation, the problem structure and the specific crossover operator chosen. Not to be confused with the macOS compatibility software of the same name.

How crossover recombines parent solutions

Crossover works by selecting parents, choosing exchange points or masks, and copying genes from each parent into one or more offspring. The selection operator decides which individuals become parents, typically favoring higher fitness, and crossover then decides how their genotypes are mixed.

Crossover is applied with a crossover probability, often written as p_c. When crossover is not applied, the offspring are copies of the parents and change only through mutation. In classic generational genetic algorithms, p_c commonly lies between 0.6 and 0.95, although the best value depends on the problem and the other operators.

ParameterTypical rangeEffect when increased
Crossover probability0.6 to 0.95More recombination, faster mixing
Number of cut points1 to severalLess positional bias, more disruption
Uniform swap probability0.5 per gene commonHigher gene-level mixing
Number of parents2, sometimes moreBroader blending of traits
Distribution index (SBX)About 2 to 20Children stay closer to parents
Key parameters that control crossover

Common crossover operators by representation

The right crossover operator depends on how solutions are encoded. An operator that works for bit strings can produce invalid offspring for permutations or meaningless ones for real-valued vectors, so practitioners choose representation-aware operators.

OperatorRepresentationHow it builds the child
One-point crossoverBinary or integer stringsSwaps tails after one cut point
Two-point crossoverBinary or integer stringsSwaps the segment between two cuts
Uniform crossoverBinary or integer stringsPicks each gene from either parent
Order crossover (OX)PermutationsKeeps a segment, fills remaining order
Partially mapped crossover (PMX)PermutationsSwaps a segment and repairs duplicates
Arithmetic crossoverReal-valued vectorsTakes a weighted average of parents
Simulated binary crossover (SBX)Real-valued vectorsSamples children near the parents
Subtree crossoverProgram treesSwaps randomly chosen subtrees
Crossover operators and the encodings they suit

Permutation operators such as OX and PMX matter for routing and scheduling problems, where every city or job must appear exactly once. In genetic programming, subtree crossover is the dominant operator, but it is also a known driver of bloat, the uncontrolled growth of program size without fitness gain.

Why crossover can help, and when it does not

The classic explanation for crossover is the building block hypothesis, which states that genetic algorithms work by combining short, low-order, above-average schemata into progressively better solutions. The schema theorem gives a formal lower bound on how such patterns propagate, but its predictive power is limited because it ignores construction and treats crossover mainly as a source of disruption.

Crossover helps most when the problem is partly decomposable, meaning that good partial solutions in different genes combine well. It helps little or harms performance when genes interact strongly, a property called epistasis, because swapping segments then breaks coordinated combinations. Crossover also depends on population diversity: once the population converges, parents become nearly identical and recombination produces almost no novelty.

AspectCrossoverMutation
InputsTwo or more parentsOne parent
Source of noveltyNew combinations of existing genesNew gene values
Search behaviorExploits and mixes discovered structureExplores locally around a solution
Dependence on diversityHigh; fails in converged populationsLow; works on any individual
Main riskDisrupting linked genesDestroying good solutions with large steps
Crossover compared with mutation

Choosing and tuning a crossover operator

Choosing crossover starts with the encoding and the constraints of the problem, then moves to tuning. A practical approach is to start with a standard operator for the representation, measure performance over several independent runs, and only then test alternatives.

SituationRecommended choiceReason
Bit strings with linked genesOne-point or two-point crossoverPreserves adjacent gene groups
Bit strings, independent genesUniform crossoverMixes genes without positional bias
Ordering or routing problemsOX, PMX or edge recombinationKeeps offspring valid permutations
Continuous parameter tuningSBX or blend crossoverControls step size around parents
Highly epistatic problemsLow p_c or model-based methodsAvoids breaking interacting genes
Decision guide for selecting crossover

Some algorithm families treat recombination differently. Evolution strategies often use intermediate recombination of many parents, differential evolution applies binomial or exponential crossover after a vector-difference mutation, and estimation of distribution algorithms replace explicit crossover with sampling from a learned probability model.

Frequent mistakes with crossover

Most crossover problems in practice come from a mismatch between operator and encoding or from neglecting diversity. The following mistakes appear repeatedly in applied projects.

  • Applying one-point crossover to permutations, which creates invalid offspring with duplicates.
  • Setting crossover probability very high while selection pressure is also high, which accelerates premature convergence.
  • Ignoring gene ordering: placing related genes far apart makes one-point crossover separate them.
  • Assuming crossover always helps without testing a mutation-only baseline for comparison.
  • Using subtree crossover in genetic programming without size limits or parsimony pressure.

Stripped to the essentials

Crossover is a way to mix two good answers into a new one. Imagine two cooks. One makes great sauce. The other makes great pasta. A new dish that takes the sauce from one and the pasta from the other may beat both.

A computer does the same with candidate solutions. It cuts them into parts and swaps the parts. Sometimes the result is worse, and the computer throws it away. Over many rounds, the best combinations survive.

Where it is applied

A logistics planner uses a genetic algorithm to plan delivery routes for 40 vans and about 1,200 stops in a metropolitan area. Each candidate solution is a permutation of stops split into van routes. The team applies order crossover with a probability of 0.8 and a swap mutation with a low rate, using tournament selection to choose parents.

In early tests with one-point crossover, many children visited some stops twice and skipped others, so a repair step consumed most of the runtime. Switching to order crossover kept every child valid and let good route segments pass from parent to child intact. After 500 generations, the plan reduced total driving distance by roughly 8 percent compared with the manually built baseline, and the result was stable across ten independent runs.