Crossover (evolutionary algorithm)

Operator used to vary the programming of chromosomes from one generation to the next


title: "Crossover (evolutionary algorithm)" type: doc version: 1 created: 2026-02-28 author: "Wikipedia contributors" status: active scope: public tags: ["evolutionary-algorithms"] description: "Operator used to vary the programming of chromosomes from one generation to the next" topic_path: "technology/algorithms" source: "https://en.wikipedia.org/wiki/Crossover_(evolutionary_algorithm)" license: "CC BY-SA 4.0" wikipedia_page_id: 0 wikipedia_revision_id: 0

::summary Operator used to vary the programming of chromosomes from one generation to the next ::

Crossover in evolutionary algorithms and evolutionary computation, also called recombination, is a genetic operator used to combine the genetic information of two parents to generate new offspring. It is one way to stochastically generate new solutions from an existing population, and is analogous to the crossover that happens during sexual reproduction in biology. New solutions can also be generated by cloning an existing solution, which is analogous to asexual reproduction. Newly generated solutions may be mutated before being added to the population. The aim of recombination is to transfer good characteristics from two different parents to one child.

Different algorithms in evolutionary computation may use different data structures to store genetic information, and each genetic representation can be recombined with different crossover operators. Typical data structures that can be recombined with crossover are bit arrays, vectors of real numbers, or trees.

The list of operators presented below is by no means complete and serves mainly as an exemplary illustration of this dyadic genetic operator type. More operators and more details can be found in the literature.

Crossover for binary arrays

Traditional genetic algorithms store genetic information in a chromosome represented by a bit array. Crossover methods for bit arrays are popular and an illustrative example of genetic recombination.

One-point crossover

A point on both parents' chromosomes is picked randomly, and designated a 'crossover point'. Bits to the right of that point are swapped between the two parent chromosomes. This results in two offspring, each carrying some genetic information from both parents.

::figure[src="https://upload.wikimedia.org/wikipedia/commons/5/56/OnePointCrossover.svg"] ::

Two-point and k-point crossover

In two-point crossover, two crossover points are picked randomly from the parent chromosomes. The bits in between the two points are swapped between the parent organisms.

::figure[src="https://upload.wikimedia.org/wikipedia/commons/c/cd/TwoPointCrossover.svg" caption="TwoPointCrossover.svg"] ::

Two-point crossover is equivalent to performing two single-point crossovers with different crossover points. This strategy can be generalized to k-point crossover for any positive integer k, picking k crossover points.

Uniform crossover

In uniform crossover, typically, each bit is chosen from either parent with equal probability. Other mixing ratios are sometimes used, resulting in offspring which inherit more genetic information from one parent than the other. In a uniform crossover, we don’t divide the chromosome into segments, rather we treat each gene separately. In this, we essentially flip a coin for each chromosome to decide whether or not it will be included in the off-spring.

Crossover for integer or real-valued genomes

::figure[src="https://upload.wikimedia.org/wikipedia/commons/4/41/Discrete_Recombination-3Dim.png" caption="Example of a discrete recombination in the three-dimensional case. The two possible offspring lie on the corners of the cuboid marked in blue."] ::

For the crossover operators presented above and for most other crossover operators for bit strings, it holds that they can also be applied accordingly to integer or real-valued genomes whose genes each consist of an integer or real-valued number. Instead of individual bits, integer or real-valued numbers are then simply copied into the child genome. The offspring lie on the remaining corners of the hyperbody spanned by the two parents P_1=(1.5, 6, 8) and P_2=(7, 2, 1), as exemplified in the accompanying image for the three-dimensional case.

Discrete recombination

If the rules of the uniform crossover for bit strings are applied during the generation of the offspring, this is also called discrete recombination.

Intermediate recombination

::figure[src="https://upload.wikimedia.org/wikipedia/commons/4/45/Intermediate_Recombination.png" caption="In the two-dimensional case, the two offspring of discrete recombination lie on the corners marked in blue, while the entire gray area is in question for the offspring of intermediate recombination."] ::

In this recombination operator, the allele values of the child genome a_i are generated by mixing the alleles of the two parent genomes a_{i,P_1} and a_{i,P_2}: :\alpha_i = \alpha_{i,P_1}\cdot\beta_i + \alpha_{i,P_2}\cdot\left (1 - \beta_i\right) \quad \mathsf{with} \quad \beta_i \in \left [ -d, 1+d \right ] randomly equally distributed per gene i The choice of the interval [-d, 1+d] causes that besides the interior of the hyperbody spanned by the allele values of the parent genes additionally a certain environment for the range of values of the offspring is in question. A value of 0.25 is recommended for d to counteract the tendency to reduce the allele values that otherwise exists at d=0.

The adjacent figure shows for the two-dimensional case the range of possible new alleles of the two exemplary parents P_1=(3,6) and P_2=(9,2) in intermediate recombination. The offspring of discrete recombination C_1 and C_2 are also plotted. Intermediate recombination satisfies the arithmetic calculation of the allele values of the child genome required by virtual alphabet theory. Discrete and intermediate recombination are used as a standard in the evolution strategy.

Crossover for permutations

For combinatorial tasks, permutations are usually used that are specifically designed for genomes that are themselves permutations of a set. The underlying set is usually a subset of \mathbb{N} or \mathbb{N}_0. If 1- or n-point or uniform crossover for integer genomes is used for such genomes, a child genome may contain some values twice and others may be missing. This can be remedied by genetic repair, e.g. by replacing the redundant genes in positional fidelity for missing ones from the other child genome.

In order to avoid the generation of invalid offspring, special crossover operators for permutations have been developed which fulfill the basic requirements of such operators for permutations, namely that all elements of the initial permutation are also present in the new one and only the order is changed. It can be distinguished between combinatorial tasks, where all sequences are admissible, and those where there are constraints in the form of inadmissible partial sequences. A well-known representative of the first task type is the traveling salesman problem (TSP), where the goal is to visit a set of cities exactly once on the shortest tour. An example of the constrained task type is the scheduling of multiple workflows. Workflows involve sequence constraints on some of the individual work steps. For example, a thread cannot be cut until the corresponding hole has been drilled in a workpiece. Such problems are also called order-based permutations.

In the following, two crossover operators are presented as examples, the partially mapped crossover (PMX) motivated by the TSP and the order crossover (OX1) designed for order-based permutations. A second offspring can be produced in each case by exchanging the parent chromosomes.

Partially mapped crossover (PMX)

The PMX operator was designed as a recombination operator for TSP like Problems. The explanation of the procedure is illustrated by an example: ::data[format=table]

::

Order crossover (OX1)

The order crossover goes back to Davis in its original form and is presented here in a slightly generalized version with more than two crossover points. It transfers information about the relative order from the second parent to the offspring. First, the number and position of the crossover points are determined randomly. The resulting gene sequences are then processed as described below: ::data[format=table]

::

Among other things, order crossover is well suited for scheduling multiple workflows, when used in conjunction with 1- and n-point crossover.

Further crossover operators for permutations

Over time, a large number of crossover operators for permutations have been proposed, so the following list is only a small selection. For more information, the reader is referred to the literature.

  1. cycle crossover (CX)
  2. order-based crossover (OX2)
  3. position-based crossover (POS)
  4. edge recombination
  5. voting recombination (VR)
  6. alternating-positions crossover (AP)
  7. maximal preservative crossover (MPX)
  8. merge crossover (MX)
  9. sequential constructive crossover operator (SCX)

The usual approach to solving TSP-like problems by genetic or, more generally, evolutionary algorithms, presented earlier, is either to repair illegal descendants or to adjust the operators appropriately so that illegal offspring do not arise in the first place. Alternatively, Riazi suggests the use of a double chromosome representation, which avoids illegal offspring.

Bibliography

References

References

  1. Davis, Lawrence. (1991). "Handbook of genetic algorithms". Van Nostrand Reinhold.
  2. (2015). "Introduction to Evolutionary Computing". Springer.
  3. (2010). "Introduction to evolutionary algorithms". Springer.
  4. (2010). "Introduction to Evolutionary Algorithms". Springer.
  5. (2000). "Evolutionary computation. Vol. 1, Basic algorithms and operators". Institute of Physics Pub.
  6. Syswerda, Gilbert. (1989). "Uniform crossover in genetic algorithms". Morgan Kaufmann.
  7. (2015). "Introduction to Evolutionary Computing". Springer.
  8. (2010). "Introduction to Evolutionary Algorithms". Springer.
  9. (1993). "Predictive Models for the Breeder Genetic Algorithm I. Continuous Parameter Optimization". Evolutionary Computation.
  10. Goldberg, David E.. (1991). "Real-coded Genetic Algorithms, Virtual Alphabets, and Blocking". Complex Syst..
  11. (1994). "Genetic algorithms in optimisation, simulation, and modelling". IOS Press.
  12. Schwefel, Hans-Paul. (1995). "Evolution and optimum seeking". Wiley.
  13. (1999). "Genetic Algorithms for the Travelling Salesman Problem: A Review of Representations and Operators". Artificial Intelligence Review.
  14. (1985). "Alleles, loci, and the traveling salesman problem". Lawrence Erlbaum Associates.
  15. (2015). "Introduction to Evolutionary Computing". Springer.
  16. (2008). "Fast Multi-objective Scheduling of Jobs to Constrained Resources Using a Hybrid Evolutionary Algorithm". Springer.
  17. (1987). "A study of permutation crossover operators on the travelling salesman problem". Lawrence Erlbaum Associates.
  18. Syswerda, Gilbert. (1991). "Handbook of genetic algorithms". Van Nostrand Reinhold.
  19. (1989). "Scheduling Problems and Traveling Salesmen: The Genetic Edge Recombination Operator". Morgan Kaufmann.
  20. (1994). "Advanced correlation analysis of operators for the traveling salesman problem". Springer.
  21. (1993). "Multiple Vehicle Routing with Time and Capacity Constraints Using Genetic Algorithms". Morgan Kaufmann.
  22. Ahmed, Zakir Hussain. (2000). "Sequential Constructive Sampling and Related approaches to Combinatorial Optimization". Tezpur University, India.
  23. (14 October 2019). "Genetic algorithm and a double-chromosome implementation to the traveling salesman problem". SN Applied Sciences.

::callout[type=info title="Wikipedia Source"] This article was imported from Wikipedia and is available under the Creative Commons Attribution-ShareAlike 4.0 License. Content has been adapted to SurfDoc format. Original contributors can be found on the article history page. ::

evolutionary-algorithms