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.
| Parameter | Typical range | Effect when increased |
|---|---|---|
| Crossover probability | 0.6 to 0.95 | More recombination, faster mixing |
| Number of cut points | 1 to several | Less positional bias, more disruption |
| Uniform swap probability | 0.5 per gene common | Higher gene-level mixing |
| Number of parents | 2, sometimes more | Broader blending of traits |
| Distribution index (SBX) | About 2 to 20 | Children stay closer to parents |
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.
| Operator | Representation | How it builds the child |
|---|---|---|
| One-point crossover | Binary or integer strings | Swaps tails after one cut point |
| Two-point crossover | Binary or integer strings | Swaps the segment between two cuts |
| Uniform crossover | Binary or integer strings | Picks each gene from either parent |
| Order crossover (OX) | Permutations | Keeps a segment, fills remaining order |
| Partially mapped crossover (PMX) | Permutations | Swaps a segment and repairs duplicates |
| Arithmetic crossover | Real-valued vectors | Takes a weighted average of parents |
| Simulated binary crossover (SBX) | Real-valued vectors | Samples children near the parents |
| Subtree crossover | Program trees | Swaps randomly chosen subtrees |
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.
| Aspect | Crossover | Mutation |
|---|---|---|
| Inputs | Two or more parents | One parent |
| Source of novelty | New combinations of existing genes | New gene values |
| Search behavior | Exploits and mixes discovered structure | Explores locally around a solution |
| Dependence on diversity | High; fails in converged populations | Low; works on any individual |
| Main risk | Disrupting linked genes | Destroying good solutions with large steps |
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.
| Situation | Recommended choice | Reason |
|---|---|---|
| Bit strings with linked genes | One-point or two-point crossover | Preserves adjacent gene groups |
| Bit strings, independent genes | Uniform crossover | Mixes genes without positional bias |
| Ordering or routing problems | OX, PMX or edge recombination | Keeps offspring valid permutations |
| Continuous parameter tuning | SBX or blend crossover | Controls step size around parents |
| Highly epistatic problems | Low p_c or model-based methods | Avoids breaking interacting genes |
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.