Genetic operator

On this page 7

A genetic operator is a procedure that an evolutionary algorithm applies to candidate solutions in order to choose, combine or modify them and so produce the next generation of a population. In evolutionary computation, the three classic genetic operators are selection, crossover and mutation, and together they decide how a search moves through the space of possible solutions.

Each operator plays a distinct role. Selection exploits what the population has already found by favoring fitter individuals, while crossover and mutation explore by producing new variants. The balance between these forces, known as the exploration and exploitation trade-off, largely determines whether a genetic algorithm converges on a good solution or stalls on a poor one.

How genetic operators drive the evolutionary loop

Genetic operators act in a fixed cycle: evaluate fitness, select parents, recombine them, mutate the offspring and replace part of the population. Each cycle is one generation, and a typical run lasts from dozens to many thousands of generations depending on the problem.

The operators work on the genotype, the encoded representation of a solution, while the fitness function evaluates the phenotype, the solution that the encoding expresses. This separation means that an operator must always respect the representation: a mutation that is sensible for a bit string can produce invalid results for a permutation.

The table below summarizes the role of each main operator class in the loop.

Operator classWhat it doesMain effect on search
SelectionChooses parents or survivors by fitnessExploitation, increases average fitness
CrossoverCombines material from two or more parentsExploration by recombining building blocks
MutationMakes small random changes to one individualExploration, restores lost diversity
ReplacementDecides who enters the next generationControls turnover and elitism
Main classes of genetic operators

Common variants of each genetic operator

Every operator class has many concrete variants, and choosing a variant that matches the encoding is one of the most consequential design decisions. The following table lists widely used forms and the representations they suit.

VariantOperator classSuitable encoding
Tournament selectionSelectionAny; pressure set by tournament size
Fitness proportionate selectionSelectionAny; needs positive, well-scaled fitness
One-point and two-point crossoverCrossoverBinary or integer strings
Uniform crossoverCrossoverStrings with independent genes
Order crossover (OX)CrossoverPermutations, such as routing problems
Bit-flip mutationMutationBinary strings
Gaussian mutationMutationReal-valued vectors
Swap or inversion mutationMutationPermutations
Subtree crossoverCrossoverProgram trees in genetic programming
Typical operator variants and suitable encodings

Specialized fields add their own operators. Differential evolution uses a difference-vector mutation, NEAT adds structural mutations that insert nodes and connections, and memetic algorithms add a local search operator that refines offspring before evaluation.

Key parameters that control operator behavior

Genetic operators are tuned through a small set of rates and sizes that strongly influence results. Values that work well on one problem can fail on another, so the ranges below are starting points rather than rules.

ParameterCommon rangeEffect when increased
Crossover rate0.6 to 0.95More recombination, faster mixing of traits
Mutation rate per geneAbout 1/L for string length LMore diversity, but search becomes random
Tournament size2 to 7Higher selection pressure, faster convergence
Elite count1 to 5 percent of populationPreserves best solutions, reduces diversity
Mutation step size (real-valued)Problem-scaled, often adaptiveLarger jumps, coarser search
Typical operator parameters and their effects

Evolution strategies and CMA-ES go further with self-adaptation, in which mutation step sizes are themselves encoded and evolved. This removes much manual tuning and is one reason these methods perform strongly on continuous optimization problems.

Genetic operators compared with other search moves

Genetic operators differ from the moves of classical local search because they act on a population rather than a single point. Crossover in particular has no direct counterpart in hill climbing or simulated annealing, since it requires at least two parents.

Mutation alone makes an evolutionary algorithm behave like a parallel stochastic local search. Crossover adds the ability to combine partial solutions found in different individuals, which is the intuition behind the schema theorem and the building block hypothesis. Both ideas remain debated, and crossover is clearly beneficial only when the encoding places related genes in a way that recombination can preserve.

Other population-based methods replace genetic operators with different update rules. Particle swarm optimization moves particles using velocity terms drawn toward personal and global best positions, and estimation of distribution algorithms replace crossover and mutation with sampling from a learned probability model. These methods share the population idea but not the explicit recombination of parent genotypes, which is why they are usually described as relatives of genetic algorithms rather than members of the same family.

In genetic programming, operators must also manage bloat, the uncontrolled growth of program trees. Size-limited subtree crossover, depth limits and parsimony pressure in selection are common countermeasures, and they show that operator design often has to address side effects beyond fitness.

Typical mistakes when designing genetic operators

Poorly designed operators are a leading cause of premature convergence and wasted computation. The most frequent errors are listed here:

  • Encoding mismatch: applying one-point crossover to permutations, which produces duplicates and invalid tours.
  • Excessive selection pressure: large tournaments or strong elitism cause the population to collapse onto one region.
  • Mutation rate too high: the algorithm degenerates into random search and loses accumulated progress.
  • Ignoring constraints: operators create infeasible offspring that a penalty function cannot repair efficiently.
  • No diversity monitoring: stagnation goes unnoticed until the budget is exhausted.

A reliable practice is to design operators that always produce valid offspring and to track population diversity alongside best fitness, adjusting rates when diversity falls too quickly.

Stripped to the essentials

A genetic operator is one step in a computer version of evolution. The program keeps a group of possible answers. Some answers are picked because they score well. Pairs of answers are mixed to form new ones. Small random changes are added.

It is a bit like breeding plants. A gardener keeps the strongest plants, crosses them and sometimes gets a surprising new variety. Over many rounds, the answers get better. The essence is this: picking, mixing and tweaking turn weak guesses into strong solutions.

Where it is applied

A logistics planner must schedule 120 delivery stops for a fleet of vans each morning. The team uses a genetic algorithm in which each individual is a permutation of stops split into routes, and fitness is total driving time plus penalties for missed delivery windows.

Because the encoding is a permutation, the team uses order crossover and swap and inversion mutation, which always produce valid route plans. Tournament selection of size three keeps pressure moderate, and the two best plans are copied unchanged into each new generation.

With a population of 200 and about 2,000 generations, the algorithm runs in under a minute and typically produces plans 8 to 12 percent shorter than the previous manual schedules. When the team briefly tried one-point crossover, many offspring visited stops twice, which showed in practice why operators must match the encoding.