Variation operators generate new candidate solutions. Their role is to balance new competing objectives: exploration (discover new regions of the search space) and exploitation (refine and recombine good solutions).

Crossover

Crossover aims to recombine information from multiple parents. This exploits existing building blocks, enabling structured exploration.

For example, we can combine genetic material from two parents:

The intuition is that good solutions often share useful building blocks. These blocks correspond to partial patterns in the genotype. Recombining blocks may yield to better solutions.

A simple intuition if we consider something like this:

These two share a block. Crossover would aim to preserve this shared structure while exploring new combinations.

Crossover probability

We can choose to not crossover some parent pairs and instead simply pass them onto the next generation. Crossover probability is applied independently to each parent pair.

For every parent pair chosen for reproduction:

  • Draw a random number
  • If : apply crossover
  • If : copy parents unchanged

Crossover Methods

Mutation

Mutation introduces random variation, maintaining diversity. This allows escape from local optima.

Mutation probability

Like crossover probability, for each gene in each offspring:

  • Draw a random number
  • If : mutate the gene
  • If : leave the gene unchanged

Typically, , where is the chromosome length. Thus, on average, one bit mutates per chromosome, preserving most structure.

If is too low, diversity collapses, and population stagnates. This may cause premature convergence to local optima.

If is too high, the genetic algorithm drifts toward random search. Building blocks are destroyed, such that selection cannot accumulate strucutre.

Bit-Flip Mutation

With a binary representation, we can simply do bit flips for mutation: