crossover (evolutionary algorithm)

{{short description|Operator used to vary the programming of chromosomes from one generation to the next}}

{{Evolutionary algorithms}}

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.{{Cite book |title=Handbook of genetic algorithms |date=1991 |publisher=Van Nostrand Reinhold |last=Davis |first=Lawrence |isbn=0-442-00173-8 |location=New York |oclc=23081440}}{{Cite book |last1=Eiben |first1=A.E. |url=http://link.springer.com/10.1007/978-3-662-44874-8 |title=Introduction to Evolutionary Computing |last2=Smith |first2=J.E. |date=2015 |publisher=Springer |isbn=978-3-662-44873-1 |edition=2nd |series=Natural Computing Series |location=Berlin, Heidelberg |pages=49–78 |language=en |chapter=Representation, Mutation, and Recombination |doi=10.1007/978-3-662-44874-8 |s2cid=20912932}}{{Cite book |last1=Yu |first1=Xinjie |url=https://www.worldcat.org/oclc/654380156 |title=Introduction to evolutionary algorithms |last2=Gen |first2=Mitsuo |date=2010 |publisher=Springer |isbn=978-1-84996-129-5 |series=Decision Engineering |location=London |pages=40–63 |language=en |chapter=Encoding and Operators |doi=10.1007/978-1-84996-129-5 |oclc=654380156}}{{Cite book |last1=Yu |first1=Xinjie |url=http://link.springer.com/10.1007/978-1-84996-129-5 |title=Introduction to Evolutionary Algorithms |last2=Gen |first2=Mitsuo |date=2010 |publisher=Springer |isbn=978-1-84996-128-8 |series=Decision Engineering |volume= |location=London |pages=285–299 |chapter=Variation Operators for Permutation Code |doi=10.1007/978-1-84996-129-5}}{{Cite book |last1=Booker |first1=Lashon B. |url=https://www.worldcat.org/oclc/45730387 |title=Evolutionary computation. Vol. 1, Basic algorithms and operators |last2=Fogel |first2=David B. |last3=Whitley |first3=Darrell |last4=Angeline |first4=Peter J. |last5=Eiben |first5=A.E. |date=2000 |publisher=Institute of Physics Pub |isbn=0-585-30560-9 |editor-last=Bäck |editor-first=Thomas |location=Bristol |pages=256–307 |language=en |chapter=Recombination |oclc=45730387 |editor-last2=Fogel |editor-first2=David B. |editor-last3=Michalewicz |editor-first3=Zbigniew}}

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.

File: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.

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.{{Citation |last=Syswerda |first=Gilbert |title=Uniform crossover in genetic algorithms |date=1989 |work=Proceedings of the 3rd International Conference on Genetic Algorithms (ICGA) |pages=2–9 |editor-last=Schaffer |editor-first=J.D. |place=San Francisco |publisher=Morgan Kaufmann |isbn=1558600663 }} 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

File:Discrete Recombination-3Dim.png

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.{{Cite book |last1=Eiben |first1=A.E. |url=http://link.springer.com/10.1007/978-3-662-44874-8 |title=Introduction to Evolutionary Computing |last2=Smith |first2=J.E. |date=2015 |publisher=Springer |isbn=978-3-662-44873-1 |edition=2nd |series=Natural Computing Series |location=Berlin, Heidelberg |pages=65–67 |chapter=Recombination Operators for Real-Valued Representation |doi=10.1007/978-3-662-44874-8 |s2cid=20912932}}

= Intermediate recombination =

File:Intermediate Recombination.png

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}:{{Cite book |last1=Yu |first1=Xinjie |title=Introduction to Evolutionary Algorithms |last2=Gen |first2=Mitsuo |date=2010 |publisher=Springer |isbn=978-1-84996-128-8 |series=Decision Engineering |volume= |location=London |pages=45–63 |language=en |chapter=Real Code and Related Operators |doi=10.1007/978-1-84996-129-5}}

:\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.{{Cite journal |last1=Mühlenbein |first1=Heinz |last2=Schlierkamp-Voosen |first2=Dirk |date=1993 |title=Predictive Models for the Breeder Genetic Algorithm I. Continuous Parameter Optimization |url=https://direct.mit.edu/evco/article/1/1/25-49/1093 |journal=Evolutionary Computation |language=en |volume=1 |issue=1 |pages=25–49 |doi=10.1162/evco.1993.1.1.25 |s2cid=16085506 |issn=1063-6560|url-access=subscription }}

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.{{Cite journal |last=Goldberg |first=David E. |date=1991 |title=Real-coded Genetic Algorithms, Virtual Alphabets, and Blocking |url=https://www.complex-systems.com/abstracts/v05_i02_a02/ |journal=Complex Syst. |volume=5 |issue=2 |pages=139–167}}{{Cite book |last1=Stender |first1=J. |url= |title=Genetic algorithms in optimisation, simulation, and modelling |last2=Hillebrand |first2=E. |last3=Kingdon |first3=J. |date=1994 |publisher=IOS Press |isbn=90-5199-180-0 |location=Amsterdam |language=en |oclc=47216370}} Discrete and intermediate recombination are used as a standard in the evolution strategy.{{Cite book |last=Schwefel |first=Hans-Paul |url=https://ls11-www.cs.tu-dortmund.de/lehre/wiley/ |title=Evolution and optimum seeking |date=1995 |publisher=Wiley |isbn=0-471-57148-2 |location=New York |language=en |oclc=30701094}}

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{{Cite journal |last1=Larrañaga |first1=P. |last2=Kuijpers |first2=C.M.H. |last3=Murga |first3=R.H. |last4=Inza |first4=I. |last5=Dizdarevic |first5=S. |date=1999 |title=Genetic Algorithms for the Travelling Salesman Problem: A Review of Representations and Operators |url=http://link.springer.com/10.1023/A:1006529012972 |journal=Artificial Intelligence Review |volume=13 |issue=2 |pages=129–170 |doi=10.1023/A:1006529012972|s2cid=10284682 |url-access=subscription }} 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.{{Citation |last1=Goldberg |first1=David E. |last2=Lingle |first2=R. |title=Alleles, loci, and the traveling salesman problem |work=Proceedings of the First International Conference on Genetic Algorithms and Their Applications (ICGA) |date=1985 |publisher=Lawrence Erlbaum Associates |editor-last=Grefenstette |editor-first=John J. |isbn=0-8058-0426-9 |location=Hillsdale, N.J. |pages=154–159 |language=en |oclc=19702892}}{{Cite book |last1=Eiben |first1=A.E. |url=http://link.springer.com/10.1007/978-3-662-44874-8 |title=Introduction to Evolutionary Computing |last2=Smith |first2=J.E. |date=2015 |publisher=Springer |isbn=978-3-662-44873-1 |edition=2nd |series=Natural Computing Series |location=Berlin, Heidelberg |pages=70–74 |language=en |chapter=Recombination for Permutation Representation |doi=10.1007/978-3-662-44874-8 |s2cid=20912932}} The explanation of the procedure is illustrated by an example:

Procedure

|  

| Example

|  

| Example Chromosome

colspan=5 |
style="vertical-align: top; "

|  

|  

| Let be given two permutations of the same set.

|  

| P_0 = \left( A,B,C,D,E,F,G,H \right) and P_1 = \left( C,G,E,A,F,H,B,D \right)

colspan=5 |
style="vertical-align: top; "

| Randomly select two crossover points forming a gene segment in P_0.

|  

| Here from gene position 4 to 6.

|  

| style="vertical-align: middle;" | P_0 = \left( A,B,C,\underline {D,E,F},G,H \right)

colspan=5 |
style="vertical-align: top;"

| The selected section is copied to the child chromosome in the same position.

|  

| The open positions are indicated by question marks.

|  

| style="vertical-align: middle;" | P_C = \left( ?,?,?,\underline {D,E,F},?,? \right)

colspan=5 |
style="vertical-align: top;"

| rowspan=2 | Look for genes that have not been copied in the corresponding segment of P_1 starting at the first crossover point. For each gene found (called m), look up in the offspring which element (called n) was copied in its place from P_0. Copy m to the position held by n in P_1 if it is not occupied. Otherwise, continue with the next step.

|  

| Gene A is the first uncopied gene in the corresponding segment of P_1: \left(..., A,F,H,... \right). Gene D was copied from P_0 in its place in P_C.

|  

| style="vertical-align: middle;" | P_C = \left( ?,?,?,\underline {\bold{D},E,F},?,? \right)

style="vertical-align: top;"

|  

| The position of D in P_1 is the furthest right position and A will be placed there in P_C.

|  

| style="vertical-align: middle;" | P_C = \left( ?,?,?,\underline {D,E,F},?,A \right)

colspan=5 |
style="vertical-align: top; "

| If the place taken by n in P_1 is already occupied by an element k in the descendant, m is put in the place taken by k in P_1.

|  

| The next gene in \left(..., A,F,H,... \right) is F and this has already been copied into the child chromosome. Thus, the next gene to be handled is H. Its position in the offspring would be the position of F in P_1. However, this place is already occupied by gene E. So H is copied to the position of E in P_1.

|  

| style="vertical-align: middle;" | P_C = \left( ?,?,H,\underline {D,E,F},?,A \right)

colspan=5 |
style="vertical-align: top; "

| After processing the genes from the selected segment in P_1, the remaining positions in the offspring are filled with the genes from P_1 that have not yet been copied, in the order of their appearance. This results in the finished child genome.

|  

| The genes copied from P_1 are C, G and B.

|  

|style="vertical-align: top;" | P_C = \left( C,G,H,\underline {D,E,F},B,A \right)

colspan=5 |

= 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:

Procedure

|  

| Example

|  

| Example Chromosome

colspan=5 |
style="vertical-align: top; "

| style="width:38%;" |  

| style="width:1%;" |  

| style="width:30%;" | Let be given two permutations of the same set.

| style="width:1%;" |  

| style="width:30%;" | P_0 = \left( A,B,C,D,E,F,G,H,I,J \right) and P_1 = \left( B,D,A,H,J,C,E,G,F,I \right)

colspan=5 |
style="vertical-align: top; "

| Randomly select gene segments in P_0.

|  

| Here two segments from gene position 1 to 2 and from 6 to 8.

|  

| style="vertical-align: middle;" | P_0 = \left( \underline {A,B},C,D,E,\underline {F,G,H},I,J \right)

colspan=5 |
style="vertical-align: top;"

| As a child permutation, a permutation is generated that contains the selected gene segments of P_0 in the same position.

|  

| The open positions are indicated by question marks.

|  

| style="vertical-align: middle;" | P_C = \left( A,B,?,?,?,F,G,H,?,? \right)

colspan=5 |
style="vertical-align: top;"

| The remaining missing genes are now also transferred, but in the order in which they appear in P_1.

|  

| The missing genes of P_0 in the example are:

|  

| P_\text{missing} = \left\{ C,D,E,I,J \right\}

P_{\text{in order from } P_1} = \left( D,J,C,E,I \right)

colspan=5 |
style="vertical-align: top;"

| This results in the completed child genome.

|  

| The transferred genes are underlined:

|  

| P_C = \left( A,B,\underline {D,J,C},F,G,H,\underline {E,I} \right)

colspan=5 |

Among other things, order crossover is well suited for scheduling multiple workflows, when used in conjunction with 1- and n-point crossover.{{Citation |last1=Jakob |first1=Wilfried |title=Fast Multi-objective Scheduling of Jobs to Constrained Resources Using a Hybrid Evolutionary Algorithm |date=2008 |url=http://link.springer.com/10.1007/978-3-540-87700-4_102 |work=Parallel Problem Solving from Nature – PPSN X |volume=LNCS 5199 |pages=1031–1040 |editor-last=Rudolph |editor-first=Günter |place=Berlin, Heidelberg |publisher=Springer |doi=10.1007/978-3-540-87700-4_102 |isbn=978-3-540-87699-1 |access-date=2023-01-14 |last2=Quinte |first2=Alexander |last3=Stucky |first3=Karl-Uwe |last4=Süß |first4=Wolfgang |editor2-last=Jansen |editor2-first=Thomas |editor3-last=Beume |editor3-first=Nicola |editor4-last=Lucas |editor4-first=Simon|url-access=subscription }}

= 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){{Citation |last1=Oliver |first1=I.M. |last2=Smith |first2=D.J. |last3=Holland |first3=J. |title=A study of permutation crossover operators on the travelling salesman problem |work=Proceedings of the Second International Conference on Genetic Algorithms and Their Applications (ICGA) |date=1987 |publisher=Lawrence Erlbaum Associates |editor-last=Grefenstette |editor-first=John J. |isbn=978-0-8058-0158-3 |location=Hillsdale, N.J. |pages=224–230 |language=en }}
  2. order-based crossover (OX2){{Cite book |last=Syswerda |first=Gilbert |title=Handbook of genetic algorithms |date=1991 |publisher=Van Nostrand Reinhold |isbn=0-442-00173-8 |editor-last=Davis |editor-first=Lawrence |location=New York |pages=332–349 |language=en |chapter=Schedule Optimization Using Genetic Algorithms |oclc=23081440 }}
  3. position-based crossover (POS)
  4. edge recombination{{Citation |last1=Whitley |first1=Darrell |last2=Starkweather |first2=Timothy |last3=Fuquay |first3=D'Ann |title=Scheduling Problems and Traveling Salesmen: The Genetic Edge Recombination Operator |date=1989 |work=Proceedings of the 3rd International Conference on Genetic Algorithms (ICGA) |pages=133–140 |editor-last=Schaffer |editor-first=J.D. |place=San Francisco |publisher=Morgan Kaufmann |isbn=1558600663 }}
  5. voting recombination (VR)
  6. alternating-positions crossover (AP)
  7. maximal preservative crossover (MPX){{Citation |last1=Dzubera |first1=John |title=Advanced correlation analysis of operators for the traveling salesman problem |date=1994 |url=http://link.springer.com/10.1007/3-540-58484-6_251 |work=Parallel Problem Solving from Nature — PPSN III |volume=866 |pages=68–77 |editor-last=Davidor |editor-first=Yuval |place=Berlin, Heidelberg |publisher=Springer |doi=10.1007/3-540-58484-6_251 |isbn=978-3-540-58484-1 |access-date=2023-01-15 |last2=Whitley |first2=Darrell |editor2-last=Schwefel |editor2-first=Hans-Paul |editor3-last=Männer |editor3-first=Reinhard|url-access=subscription }}
  8. merge crossover (MX){{Citation |last1=Blanton |first1=Joe L. |last2=Wainwright |first2=Roger L. |title=Multiple Vehicle Routing with Time and Capacity Constraints Using Genetic Algorithms |date=1993 |work=Proceedings of the 5th International Conference on Genetic Algorithms (ICGA) |pages=452–459 |editor-last=Forrest |editor-first=Stephanie |place=San Francisco |publisher=Morgan Kaufmann |isbn=978-1-55860-299-1 }}
  9. sequential constructive crossover operator (SCX){{cite thesis |last=Ahmed |first=Zakir Hussain |date=2000 |title=Sequential Constructive Sampling and Related approaches to Combinatorial Optimization |type=PhD |publisher=Tezpur University, India }}

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.{{cite journal |last1=Riazi |first1=Amin |title=Genetic algorithm and a double-chromosome implementation to the traveling salesman problem |journal=SN Applied Sciences |date=14 October 2019 |volume=1 |issue=11 |doi=10.1007/s42452-019-1469-1|doi-access= }}

See also

Bibliography

  • John Holland (1975). Adaptation in Natural and Artificial Systems, PhD thesis, University of Michigan Press, Ann Arbor, Michigan. {{ISBN|0-262-58111-6}}.
  • {{Cite book |last=Schwefel |first=Hans-Paul |title=Evolution and Optimum Seeking |publisher=John Wiley & Sons |year=1995 |isbn=0-471-57148-2 |location=New York |language=en |url=https://www.researchgate.net/publication/220690578}}
  • {{Cite book |last=Davis |first=Lawrence |title=Handbook of genetic algorithms |date=1991 |publisher=Van Nostrand Reinhold |isbn=0-442-00173-8 |location=New York |oclc=23081440}}
  • {{Cite book |last1=Eiben |first1=A.E. |url=https://link.springer.com/10.1007/978-3-662-44874-8 |title=Introduction to Evolutionary Computing |last2=Smith |first2=J.E. |date=2015 |publisher=Springer |isbn=978-3-662-44873-1 |series=Natural Computing Series |location=Berlin, Heidelberg |language=en |doi=10.1007/978-3-662-44874-8|s2cid=20912932 }}
  • {{Cite book |last1=Yu |first1=Xinjie |url=http://link.springer.com/10.1007/978-1-84996-129-5 |title=Introduction to Evolutionary Algorithms |last2=Gen |first2=Mitsuo |date=2010 |publisher=Springer |isbn=978-1-84996-128-8 |series=Decision Engineering |volume= |location=London |language=en |doi=10.1007/978-1-84996-129-5}}
  • {{Cite book |title=Evolutionary computation. Vol. 1, Basic algorithms and operators |date=1999 |publisher=Institute of Physics Pub |isbn=0-585-30560-9 |editor-last2=Fogel |editor-first2=David B. |location=Bristol |url=https://www.worldcat.org/oclc/45730387 |oclc=45730387 |editor-last=Bäck |editor-first=Thomas |editor-last3=Michalewicz |editor-first3=Zbigniew}}

References