liveBook · Manning

Two-point crossover

As explained in Evolutionary Deep Learning: Genetic algorithms and neural networks

Two-point crossover exchanges the subsequences between two split positions in a pair of parent sequences.

Two-point crossover recombines two parent sequences by choosing two split positions and exchanging the subsequences between them. It is a general-purpose crossover method for ordinary gene sequences, but it does not suit indexed sequences such as TSP routes. section 12.1 section 3.4

A practical implementation workflow is:

  • Register the operator as `gep.crossover_two_point` and assign its probability alongside one-point and gene-level crossover operators. section 12.1
  • Represent complex gene expression programs as chromosomes so crossover can exchange useful component sections. section 12.1
  • Inspect whether recombination produces viable, improving offspring with genealogy plots; sparse connections can indicate ineffective crossover. section 3.4

Geppy registration

A Geppy toolbox can register two-point crossover with `toolbox.register('cx_2p', gep.crossover_two_point, pb=0.2)`, then use it during GEP evolution alongside mutation and other crossover operators. section 12.1

Figure 3.9 A comparison of genealogy plots of crossover operations

Compare genealogy plots for different crossover operations to see how recombination affects offspring viability and evolutionary progress. section 3.4

How Evolutionary Deep Learning: Genetic algorithms and neural networks covers it

How deep it goes
Defines the slicing mechanism and registration workflow, then stops short of detailed exchange pseudocode or theoretical analysis.
Examples
Demonstrates Geppy registration with a 0.2 probability and compares crossover behavior through genealogy plots.
What it assumes
Assumes genetic-algorithm vocabulary such as genes, sequences, parents, offspring, mutation, and fitness.
What you can do after
Operate/configure two-point crossover in Geppy and inspect its offspring through genealogy plots.
How it connects
Connects crossover with genetic algorithms, mutation, gene expression programming, chromosomes, and genealogy plots.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Evolutionary Deep Learning: Genetic algorithms and neural networks. The section links point to the parts of the book it draws on.