View Source Genetix.Evolution.CrossOver (Genetix v0.4.1)
Contain functions with different aproaches / strategies to make the crossover. In genetic algorithms and evolutionary computation, crossover, also called recombination, is a genetic operator used to combine the genetic information of two parents to generate new offspring.
Possibles strategies:
- Single-point
- Order-one
- Uniform
- Whole arithmetic Recombination (TODO)
Link to this section Summary
Functions
Single-point crossover is the most basic crossover strategy. It works like this
Order-one crossover, sometimes called "Davis order" crossover, is a crossover strategy on ordered list or permutations. Order-one is part of a unique set of crossover strategies that will preserve the integrity of a permutation without the need for chromosome repair. It works like this
Genes in the parent chromosome are treated separately (individually).
Uniform crossover works by paaring corresponding genes in a chromosome an swapping them according to a rate
defined by the crossover_rate
hyperparameter. By default 0.5
(50% or probability to swap both genes).
Link to this section Functions
@spec crossover_cx_one_point( Genetix.Types.Chromosome.t(), Genetix.Types.Chromosome.t(), keyword() ) :: {Genetix.Types.Chromosome.t(), Genetix.Types.Chromosome.t()}
Single-point crossover is the most basic crossover strategy. It works like this:
- Choose a random number k between 0..n-1 where n is the length of the parten chromosomes. Works on blocks of genes.
- Split both parents at k to rpdocue four slices of genes.
- Swap the tails of each parent at k produce two new children.
@spec order_one_crossover( Genetix.Types.Chromosome.t(), Genetix.Types.Chromosome.t(), keyword() ) :: {Genetix.Types.Chromosome.t(), Genetix.Types.Chromosome.t()}
Order-one crossover, sometimes called "Davis order" crossover, is a crossover strategy on ordered list or permutations. Order-one is part of a unique set of crossover strategies that will preserve the integrity of a permutation without the need for chromosome repair. It works like this:
- Select a random slice of genes from Parent 1.
- Remove the values from the slice of Parent 1 from Parent 2.
- Insert the slice from Parten 1 into the same position in Parent 2.
- Repeat with a random slice from Parten 2.
@spec uniform(Genetix.Types.Chromosome.t(), Genetix.Types.Chromosome.t(), keyword()) :: {Genetix.Types.Chromosome.t(), Genetix.Types.Chromosome.t()}
Genes in the parent chromosome are treated separately (individually).
Uniform crossover works by paaring corresponding genes in a chromosome an swapping them according to a rate
defined by the crossover_rate
hyperparameter. By default 0.5
(50% or probability to swap both genes).