Mutation in evolutionary computation is a genetic operator that applies small random changes to a candidate solution, producing a modified offspring that may explore parts of the search space no current individual occupies. Together with selection and crossover, the mutation operator forms the core loop of genetic algorithms, evolution strategies, genetic programming and related methods.
Its main role is to maintain diversity and prevent stagnation. Selection concentrates the population on good solutions, and crossover recombines existing material, but only mutation can introduce genuinely new values. The balance between too little and too much mutation is one of the central tuning problems in the field.
How the mutation operator works
A mutation operator takes one parent, usually after selection and crossover, and changes some of its genes with a given probability. The mutation rate controls how often a gene is changed, and the mutation strength or step size controls how large each change is. Both parameters together define how far an offspring typically lands from its parent.
The mechanism depends on the representation. In a binary chromosome, a gene flips from 0 to 1 or back. In a real-valued vector, a random number drawn from a distribution, often Gaussian, is added to a coordinate. In a permutation, two positions are swapped or a segment is reversed, because changing a single value would create an invalid solution.
A useful property of any mutation operator is ergodicity: repeated application must be able to reach every point of the search space with nonzero probability. This guarantee underlies the theoretical result that an elitist evolutionary algorithm with such mutation converges to the global optimum in the limit, although the limit may be impractically far away. Operator design also involves locality, meaning that small genotype changes should cause small phenotype changes; poor locality makes mutation behave like random restarts.
The table below lists the most common operators by representation.
| Representation | Operator | What changes |
|---|---|---|
| Binary string | Bit-flip mutation | Each bit flips with probability p |
| Real-valued vector | Gaussian mutation | Adds noise drawn from N(0, sigma) |
| Real-valued vector | Polynomial mutation | Bounded perturbation within variable limits |
| Integer vector | Random resetting | Gene replaced by a random valid value |
| Permutation | Swap, insertion, inversion | Order of elements changes, set stays valid |
| Program tree | Subtree or point mutation | Node or subtree replaced by random code |
Key parameters and typical settings
The most widely cited heuristic for binary genetic algorithms sets the per-bit mutation rate to 1/L, where L is the chromosome length, so that on average one bit changes per offspring. This rule balances exploration and preservation of good material, although the best value always depends on the problem and the other operators.
For real-valued problems, the step size sigma matters more than the rate. Too small a sigma makes progress slow, while too large a sigma turns the search into random sampling. Evolution strategies addressed this with the one-fifth success rule and later with self-adaptation, in which step sizes are encoded in the individual and evolve alongside the solution.
| Parameter | Typical range | Effect when too low | Effect when too high |
|---|---|---|---|
| Per-gene rate (binary) | About 1/L, often 0.001 to 0.05 | Loss of diversity | Good genes destroyed |
| Step size sigma (real) | Relative to variable range | Slow progress | Random search behavior |
| Distribution index (polynomial) | Often 20 to 100 | Large jumps dominate | Changes become negligible |
| Operator probability (GP) | Often 0.05 to 0.2 | Search relies on crossover | Programs lose structure |
Modern practice often uses adaptive or self-adaptive mutation, as in CMA-ES, which adapts a full covariance matrix and therefore learns the direction as well as the size of useful mutations.
Mutation compared with crossover and selection
Mutation is one of three genetic operators with distinct roles. Selection decides which individuals reproduce, crossover combines material from two or more parents, and mutation perturbs a single individual. Classic genetic algorithms treated mutation as a background operator, while evolution strategies and evolutionary programming made it the primary search operator.
| Operator | Input | Main effect | Search role |
|---|---|---|---|
| Mutation | One individual | Introduces new values | Exploration and local refinement |
| Crossover | Two or more parents | Recombines existing values | Exploiting building blocks |
| Selection | Whole population | Favors fitter individuals | Directs search toward quality |
Differential evolution uses the term differently: its differential mutation builds a new vector from scaled differences between population members, so it is population-based rather than purely random.
Choosing a mutation strategy in practice
The right mutation strategy follows from the representation, the fitness landscape and the remaining budget. Rugged landscapes with many local optima favor larger or heavy-tailed mutations, while smooth landscapes reward small, adaptive steps. Constraint handling also matters, because an operator that produces infeasible offspring wastes evaluations.
| Situation | Recommended choice | Reason |
|---|---|---|
| Premature convergence | Raise rate or use heavy-tailed noise | Restores diversity |
| Continuous, ill-conditioned problem | Covariance-adapting mutation | Learns correlated directions |
| Scheduling or routing | Swap or inversion mutation | Keeps permutations valid |
| Late phase of search | Reduce step size | Enables fine local tuning |
| Genetic programming bloat | Size-limited subtree mutation | Controls program growth |
Limitations and common mistakes
Mutation is blind to fitness: it does not know which changes help. Its usefulness therefore depends entirely on selection filtering the results. Common errors in practice include:
- Using a fixed high rate, which turns the algorithm into near-random search.
- Ignoring variable scaling, so one Gaussian sigma suits some variables and wrecks others.
- Applying value-changing operators to permutations, which creates invalid solutions.
- Disabling mutation entirely, which lets the population lose alleles permanently.
A frequent misconception is that biological realism should guide the setting. Effective rates in evolutionary computation are engineering choices, tuned by experiment, and bear no fixed relation to natural mutation rates.
Stripped to the essentials
Imagine baking many batches of cookies. You keep the best recipes each time. Sometimes you change one ingredient a little at random. Most changes do nothing useful. A few produce a better cookie.
Mutation does the same for computer solutions. It makes small random changes so the search can find ideas that none of the current solutions contain. Too few changes and the search gets stuck. Too many and good recipes are ruined. The skill lies in finding the right amount of change.
Where it is applied
An engineering team optimizes the shape of a wind turbine blade with an evolution strategy. Each candidate is a vector of 24 real-valued design variables, such as chord lengths and twist angles, and every fitness evaluation runs an aerodynamic simulation that takes several minutes.
The team starts with Gaussian mutation and a single step size, but progress stalls because twist angles and chord lengths have very different scales. Switching to CMA-ES, which adapts the mutation distribution to correlations between variables, lets the search follow the narrow ridge of good designs. After about 3,000 evaluations, the best blade shows a few percent higher annual energy yield in simulation than the baseline design, a gain the team then verifies in detailed analysis.