6.0 Step 4: The Engine of Evolution – Core Genetic Operators
The genetic operators—selection, crossover, and mutation—are the core engine that drives the evolutionary process in a Genetic Algorithm. They work in concert to exploit the information found in good solutions while simultaneously exploring new areas of the search space. The careful selection, configuration, and tuning of these operators are central to a GA’s success.
6.1 Parent Selection
The strategic purpose of parent selection is to choose individuals from the current population to create offspring for the next generation. This process must strike a critical balance. On one hand, it needs to apply selection pressure, favoring fitter individuals to guide the search towards promising regions. On the other hand, it must maintain population diversity to prevent a few highly fit individuals from dominating the population, which can lead to premature convergence on a suboptimal solution.
Fitness Proportionate Selection
This method selects parents with a probability proportional to their fitness, meaning fitter individuals have a higher chance of being chosen.
- Roulette Wheel Selection: This method assigns each individual a “slice” of a virtual roulette wheel proportional to its fitness. The wheel is spun, and the individual whose slice lands on a fixed point is selected. The process is repeated to select more parents.
- Stochastic Universal Sampling (SUS): This is a less biased variant of roulette wheel selection that uses multiple, equally spaced pointers. In a single spin, it selects all parents at once, encouraging highly fit individuals to be chosen at least once.
Both methods, however, are unsuitable for problems where fitness values can be negative.
Tournament Selection
In this method, K individuals are chosen at random from the population, and the fittest individual from this small group (the “tournament”) is selected as a parent. This process is repeated to find the next parent. A key advantage of this method is its ability to work with negative fitness values, making it more versatile than fitness-proportionate approaches.
Rank Selection
This method selects parents based on their rank within the population, not their absolute fitness score. Individuals are first ranked from best to worst, and selection probability is then based on this rank. This is particularly useful when individuals have very close fitness values, as it prevents stagnation by maintaining selection pressure even when fitness differences are small.
Random Selection
This strategy simply selects parents randomly from the population. Because it applies no selection pressure towards fitter individuals, it is generally avoided.
The choice of selector thus represents a direct control over selection pressure; while Roulette Wheel mirrors fitness directly, Tournament and Rank selection are powerful tools to modulate that pressure, especially when fitness values are clustered or negative.
6.2 Crossover (Recombination)
The crossover operator is the GA’s analogy to biological reproduction. It combines the genetic material of two or more parents to produce new offspring, with the goal of creating children that inherit the best characteristics of their parents. Crossover is typically applied with a high probability, denoted as pc.
- One-Point Crossover: A single crossover point is randomly selected on the parent chromosomes. All data beyond that point is swapped between the two parents to produce two new offspring.
- Multi-Point Crossover: A generalization of one-point crossover where multiple crossover points are selected. The segments between alternating points are swapped between the parents.
- Uniform Crossover: Each gene is treated separately. A virtual coin is flipped for each gene to decide whether it will be inherited from the first or second parent.
- Whole Arithmetic Recombination: Used for integer or real-valued representations. It creates offspring by taking a weighted average of the parent genes using the formulas:
- Child1 = α * Parent1 + (1-α) * Parent2
- Child2 = (1-α) * Parent1 + α * Parent2 Note that if the parameter α is set to 0.5, both children will be identical.
- Davis’ Order Crossover (OX1): Specifically designed for permutation-based representations (like in TSP). It works by copying a random segment from one parent and then filling the remaining genes with the unused values from the second parent in the order they appear.
6.3 Mutation
Mutation introduces small, random changes to a chromosome. It serves the dual purpose of introducing new genetic material to maintain diversity and facilitating the exploration of new regions of the search space. It prevents the population from becoming too homogeneous and helps the algorithm escape local optima. Mutation is applied with a low probability, denoted as pm. The value of pm represents a fundamental trade-off between exploration and exploitation; too low, and the search may stagnate, too high, and it devolves into a random walk, destroying beneficial schemas.
- Bit Flip Mutation: Used for binary encoding. One or more random bits in the chromosome are selected and flipped from 0 to 1 or vice versa.
- Random Resetting: Used for integer representation. A randomly chosen gene is assigned a new random value from the set of permissible alleles.
- Swap Mutation: Used for permutation encoding. Two genes are randomly selected on the chromosome, and their positions are swapped.
- Scramble Mutation: Used for permutation encoding. A subset of genes is randomly selected, and their values within that subset are shuffled.
- Inversion Mutation: Used for permutation encoding. A subset of genes is chosen, and the entire sequence within that subset is inverted.
After new offspring are created through crossover and mutation, the final step in a generation’s lifecycle is to decide which individuals will survive to form the next generation.