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
Compare genealogy plots for different crossover operations to see how recombination affects offspring viability and evolutionary progress. section 3.4
