Skip to content
Tutorials Center
My learning

Topics

Lesson 13 of 36 ยท Selection

Selection Pressure, Elitism and Takeover Time

Quantify selection pressure with takeover time, compare generational and steady-state replacement, and use elitism, (mu+lambda) and crowding to balance speed against diversity.

You now know four ways to pick parents. This lesson steps back and asks a design question: how hard should selection push? Push too hard and the population collapses onto one mediocre answer. Push too softly and the GA wanders. The same question has a second half: after parents make children, who survives into the next generation? Replacement rules such as elitism matter as much as parent selection.

Selection pressure and takeover time

Selection pressure measures how strongly fit individuals are favored. A practical, measurable way to express it is takeover time: applying selection only (no crossover, no mutation) to a population of N different individuals, how many generations until the population has collapsed to copies of a single individual? (The textbook definition starts from one copy of the best individual and waits until it fills the population; the measured trend is the same.)

  • Short takeover time means high pressure: fast but risky.
  • Long takeover time means low pressure: slow but diverse.
Python Measuring takeover time

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Here "all one value" means the population has collapsed completely (all individuals identical). With random selection (pure genetic drift) the population still collapses, just slowly, because chance alone removes variety in finite populations. With strong selection the collapse happens in a handful of generations. This is the central tension: the same mechanism that creates progress also destroys diversity.

Genetic drift

Even without any fitness advantage, a finite population loses genes by luck: some individuals have more children than others, so some alleles disappear. Small populations drift faster. This is why a population of 10 is a poor choice for a hard problem, even with a perfect fitness function.

Replacement strategies

After creating children you must decide which individuals form the next generation.

Strategy How it works Pressure
Generational Replace all parents with children Pressure comes only from parent selection
Generational with elitism As above but keep the best e parents Higher; best never lost
Steady-state Create 1 or 2 children, replace the worst (or a random) individual Gradual, continuous
(mu + lambda) Pool parents and children, keep the best mu Very high; the best always survive
(mu, lambda) Keep the best mu among the children only High but parents can be lost, which helps escape traps
Crowding A child replaces the most similar existing individual Preserves diversity

Elitism

Elitism copies the best e individuals unchanged into the next generation. It guarantees that the best fitness never decreases, which is helpful: without it, the best solution found can be lost by an unlucky selection or a destructive crossover. The risk is that elites also take part in reproduction and can dominate. Typical values: 1 to 5 individuals, or up to 5 % of the population.

Python Elitism protects the best fitness

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Without elitism the best fitness repeatedly slips backward because the best individual is damaged by mutation or is not selected. With two elites that never happens, and the final result is usually better too.

Steady-state replacement

In a steady-state GA, each step selects parents, makes one child, and puts it into the population only if it beats a victim. The usual victims are the worst individual (strong pressure) or a random one (weak). Because only one individual changes per step, there is no need for a separate elitism rule: the best simply stays unless something better replaces it.

(mu + lambda) versus (mu, lambda)

These come from evolution strategies. mu parents create lambda children (often lambda = 5 to 7 times mu).

  • Plus: parents and children compete together. Safe, elitist, but can stagnate on a plateau.
  • Comma: only children compete, so even excellent parents die after one generation. Needs lambda > mu. Better at escaping local optima and following moving targets.

Crowding

Deterministic crowding pairs each child with the more similar parent and lets the child replace it only if the child is better. Individuals compete with their own kind, so several niches (peaks) survive at once, which is useful for multimodal problems.

Who goes forward?

Elitism Best always survive
Steady state One replacement at a time
mu + lambda Parents and kids compete
Crowding Kids replace their neighbors

Replacement rules shape pressure just like parent selection.

1 / 2

Putting it together: tuning pressure

A practical recipe:

  1. Start with tournament size 2 or 3, one or two elites, mutation 1/L.
  2. Plot best, average and diversity per generation.
  3. If the best curve flattens early and diversity is near zero, lower pressure (smaller tournament, fewer elites) or raise mutation.
  4. If the best curve climbs very slowly while the average barely moves, raise pressure.
  5. Repeat each setting with at least 10 random seeds. One run proves nothing.
flowchart TD
    A["Run the GA with<br/>10 seeds"] --> B{"Converges early<br/>to a poor solution?"}
    B -- yes --> C["Lower pressure,<br/>raise diversity"]
    B -- no --> D{"Progress too<br/>slow?"}
    D -- yes --> E["Raise pressure<br/>or shrink population"]
    D -- no --> F["Keep the settings"]
    C --> A
    E --> A

Tuning selection pressure is an experiment loop.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What does a short takeover time indicate?

    Takeover time is how long the best individual needs to fill the population. Short means selection is strong and diversity disappears quickly.
  2. 2. What is genetic drift?

    Some individuals by chance leave more offspring than others, so alleles vanish. Small populations drift faster.
  3. 3. Which replacement scheme can lose even the best parents after one generation?

    In the comma scheme only children compete for survival, so parents are discarded, which helps escape traps but risks losing good solutions.
  4. 4. What does deterministic crowding achieve?

    A child competes only with its closest parent, so different niches do not overwrite one another.

Summary

  • Selection pressure can be measured by takeover time; strong pressure converges fast and loses diversity.
  • Finite populations also lose genes by drift, so tiny populations are risky.
  • Replacement matters: generational, steady-state, (mu + lambda), (mu, lambda) and crowding differ in pressure and diversity.
  • Elitism (1 to 5 %) guarantees the best fitness never drops.
  • Tune by experiment: plot best, average and diversity over many seeds.

Next: Crossover for Binary Strings