Selection Pressure and Premature Convergence

How strongly a selection scheme favors the best individuals, and what happens when it favors them too much. Fitness-proportional selection and its scaling problems, stochastic universal sampling, ranking, tournament and truncation selection, takeover time and selection intensity measured against theory, elitism, and the niching methods that keep a population diverse.

Fitness-proportional selection raises mean fitness by $\sigma^2/\bar{f}$, so its pressure depends on fitness values: adding 100 to fitness values 1 to 4 flattens the expected copies from 0.4 to 1.6 into 0.985 to 1.015. Ranking, tournament and truncation selection depend only on order and are unaffected. Takeover time grows as $O(\log n)$ for ranking and tournaments but $O(n \log n)$ for proportional selection (Goldberg and Deb, 1991). With $n = 100$ and 30 seeds, binary tournament took over in a median of 9 generations and proportional selection with SUS in 397.5; with independent spins the best was lost in 17 of 30 runs. Selection intensity matches Blickle and Thiele's theory, but loss of diversity under independent draws exceeds it (43% against 25% for binary tournament). Elitism and niching counter these losses.

Suppose a population of 100 candidate solutions contains one individual better than all the others, and the algorithm does nothing but select. There is no crossover and no mutation; each generation is formed by choosing 100 individuals from the current one. Copies of the best individual multiply until they fill the population. Under binary tournament selection this takes about 9 generations. Under fitness-proportional selection with the same population it can take several hundred, or never happen at all, because the best individual is lost by chance. Two reasonable ways of favoring the fit differ this widely because one depends on the fitness values themselves, so its preference for the best shrinks as those values draw together, and the other depends only on their order. This article works through the consequences for the choice of a selection scheme.

That speed is one way to measure selection pressure, the degree to which a selection scheme favors better individuals. Selection pressure is a trade-off. Too little, and the search drifts: good individuals reproduce barely more than poor ones, and the algorithm behaves like random sampling. The simple genetic algorithm showed this on OneMax, where late in a run the best string expected only about 1.13 copies. Too much, and the population fills with copies of whatever was best early on, before crossover and mutation have had time to find anything better. The second failure is premature convergence: the population loses its diversity while it is still far from the optimum. With no diversity left, recombination has nothing to combine.

First we look at fitness-proportional selection, why it fails, and how sampling adds noise to it. Then we meet the schemes that depend only on order: ranking, tournaments and truncation. Next we measure their pressure in two ways, by takeover time and by selection intensity, and check both against simulation. Finally we turn to the remedies: elitism, the causes of premature convergence, and the niching methods that keep a population spread over several peaks. The selection recursion and genetic drift are introduced in natural selection for computer scientists; this article applies them to a GA's selection schemes. Eiben and Smith (2015, ch. 5) cover the same material at textbook level.

Fitness-proportional selection

Holland's (1975) original reproductive plan selects each individual with probability proportional to its fitness. With fitness values $f_1, \dots, f_n$, all positive and to be maximized, individual $i$ is chosen with probability

$$p_i = \frac{f_i}{\sum_{j=1}^{n} f_j}.$$

In $n$ selections it receives on average $n p_i = f_i / \bar{f}$ copies, its fitness divided by the population mean $\bar{f}$. The usual picture is a roulette wheel with one slot per individual, each slot's width proportional to fitness.

The scheme depends on the absolute values of fitness, not only their order. That causes two problems, and one small example shows both.

Example (adding 100 to every fitness value). Four individuals have fitness 1, 2, 3 and 4. Their sum is 10, so their expected copies $4 f_i / 10$ are 0.4, 0.8, 1.2 and 1.6. Add 100 to every value. The ranking and the optimum are untouched, but the sum is now 410, and the expected copies $4 f_i / 410$ become 0.985, 0.995, 1.005 and 1.015. Selection has almost vanished.

The same thing happens during a run:

  • Early on, a single individual far above the mean can take most of the wheel and fill the population within a few generations.
  • Late in a run, fitness values cluster closely, the wheel becomes nearly uniform, and selection stops pushing.

The second effect is the one the simple GA met on OneMax. It also shapes how a binary GA behaves on De Jong's test functions, which that article measures across repeated runs.

Why a constant matters. Here is the idea in one sentence: proportional selection raises the mean by the variance of fitness divided by the mean, so anything that inflates the mean without changing the spread weakens it. The derivation is short.

Let $\sigma$ be the standard deviation of fitness in the population, with divisor $n$, so $\sigma^2 = \frac{1}{n}\sum_i f_i^2 - \bar{f}^2$. The mean fitness of a selected parent is the average of the $f_i$ weighted by their selection probabilities:

$$\bar{f}_{\text{sel}} = \sum_{i=1}^{n} p_i f_i = \frac{\sum_i f_i^2}{\sum_i f_i}.$$

Both sums can be written in terms of the population's mean and variance. The denominator is $\sum_i f_i = n \bar{f}$. Rearranging the definition of $\sigma^2$ gives the numerator, $\sum_i f_i^2 = n(\sigma^2 + \bar{f}^2)$. Dividing,

$$\bar{f}_{\text{sel}} = \frac{n(\sigma^2 + \bar{f}^2)}{n \bar{f}} = \bar{f} + \frac{\sigma^2}{\bar{f}}.$$

This is the population-genetics result that mean fitness rises by $\operatorname{Var}(w)/\bar w$, derived in natural selection for computer scientists, written for $n$ individuals. The gain from selection is $\bar{f}_{\text{sel}} - \bar{f} = \sigma^2 / \bar{f}$. Measured in units of $\sigma$, it is $\sigma/\bar{f}$, the coefficient of variation.

Back to the four individuals. For the values 1 to 4, $\bar{f} = 2.5$ and $\sigma = 1.118$. So the mean after selection is $30/10 = 3.0 = 2.5 + 1.25/2.5$, and the standardized gain is $1.118/2.5 = 0.447$. For 101 to 104, $\sigma$ is the same but $\bar{f} = 102.5$. The mean after selection is 102.512 and the standardized gain is 0.011. Adding a constant to fitness leaves $\sigma$ unchanged and inflates $\bar{f}$, and the selection differential shrinks in proportion.

Scaling repairs this by transforming fitness before selection.

  • Windowing subtracts the worst fitness of the current or a recent generation.
  • Sigma scaling uses $f' = \max(f - (\bar{f} - c\,\sigma), 0)$ with a constant $c$, often 2. Selection then depends only on how many standard deviations an individual lies above the mean (Goldberg, 1989; Eiben and Smith, 2015, ch. 5).

On the values 1 to 4 with $c = 2$, the baseline is $\bar{f} - 2\sigma = 2.5 - 2.236 = 0.264$. The scaled values are 0.736, 1.736, 2.736 and 3.736, with sum 8.944. The expected copies are $4 \times 0.736/8.944 = 0.33$, then 0.78, 1.22 and 1.67. On 101 to 104 the baseline is $102.5 - 2.236 = 100.264$, the scaled values are the same four numbers, and so are the expected copies.

Expected copies are still only averages. A sampling algorithm turns them into actual counts.

Sampling: roulette wheel and stochastic universal sampling

Selection probabilities say how many copies each individual should receive on average; a sampling algorithm turns them into actual counts. Spinning the wheel $n$ times independently gives each individual a binomially distributed number of copies. In a population of four, an individual expected to receive 1.6 copies receives none with probability $(1 - 0.4)^4 \approx 0.13$. Baker (1987) analyzed this sampling error and proposed stochastic universal sampling (SUS): a single spin of a wheel with $n$ equally spaced pointers. Every individual then receives either the floor or the ceiling of its expected number of copies, and the expected count is still exact. SUS can be used with any scheme that assigns selection probabilities, including the ranking schemes below.

The difference shows on Goldberg's $x^2$ example from the simple genetic algorithm, whose four strings expect 0.578, 1.969, 0.219 and 1.234 copies. Lay these expectations end to end on a line from 0 to 4. Independent spins drop four points at random on the line. SUS draws one offset $u$ uniformly from $[0, 1)$ and places pointers at $u$, $u + 1$, $u + 2$ and $u + 3$.

The two samplers on Goldberg's four strings, with each string's interval as wide as its expected number of copies. Above, four independent spins (at the positions used in the simple GA article). Below, SUS with offset 0.4. Notice that the pointers are exactly one unit apart, so an interval of width 1.969 always contains one or two of them, never zero or three.
The two samplers on Goldberg's four strings, with each string's interval as wide as its expected number of copies. Above, four independent spins (at the positions used in the simple GA article). Below, SUS with offset 0.4. Notice that the pointers are exactly one unit apart, so an interval of width 1.969 always contains one or two of them, never zero or three.

Since the pointers are one unit apart, an interval of width $e$ contains either $\lfloor e \rfloor$ or $\lfloor e \rfloor + 1$ of them, the second with probability $e - \lfloor e \rfloor$. The reason is that the first pointer at or after the interval's left end lies at a distance $d$ from it that is uniformly distributed on $[0, 1)$. The pointers inside the interval are those at distances $d, d + 1, d + 2, \dots$ below $e$. There are $\lfloor e \rfloor + 1$ of them when $d$ is below the fractional part $e - \lfloor e \rfloor$, and $\lfloor e \rfloor$ otherwise. The expected count is then $\lfloor e \rfloor + (e - \lfloor e \rfloor) = e$, as it should be.

Example (the best string under SUS). Under independent spins the best string, 11000, is lost in 6.6 percent of generations. Under SUS it is never lost. Its interval has width 1.969, so it always holds at least one pointer. It gets two with probability 0.969. The full distributions of the number of copies under the two samplers are:

String Expected Independent spins, P(0 to 4 copies) SUS
1: 01101 0.578 0.536, 0.362, 0.092, 0.010, 0.000 P(0) = 0.422, P(1) = 0.578
2: 11000 1.969 0.066, 0.258, 0.375, 0.242, 0.059 P(1) = 0.031, P(2) = 0.969
3: 01000 0.219 0.799, 0.185, 0.016, 0.001, 0.000 P(0) = 0.781, P(1) = 0.219
4: 10011 1.234 0.229, 0.408, 0.273, 0.081, 0.009 P(1) = 0.766, P(2) = 0.234

(Probabilities are rounded to three places.) Under independent spins the best string is lost with probability 0.066; under SUS it is never lost and receives two copies 97 percent of the time. Both samplers give the same expected counts, so both implement the same selection scheme. They differ only in the noise around those counts. The takeover experiment below shows that this noise matters.

SUS removes the sampling noise but not the dependence on fitness values. For that we need schemes that look only at order.

Rank-based selection

Ranking removes the dependence on fitness values altogether. Individuals are sorted, and selection probabilities are assigned by rank. In linear ranking (Baker, 1985), ranks run from $r = 0$ for the worst through $r = n - 1$ for the best, and a parameter $s$ with $1 < s \le 2$ sets the slope:

$$p(r) = \frac{2 - s}{n} + \frac{2 r (s - 1)}{n (n - 1)}$$

(Eiben and Smith, 2015, ch. 5). The probabilities sum to 1: the first term contributes $2 - s$ over the $n$ ranks, and since $\sum_{r=0}^{n-1} r = n(n-1)/2$, the second contributes $s - 1$. The best individual expects $n\,p(n-1) = (2 - s) + 2(s - 1) = s$ copies and the worst $n\,p(0) = 2 - s$, so $s$ sets the pressure directly. With four individuals and $s = 1.5$, the expected copies are 0.5, 0.833, 1.167 and 1.5, whatever the fitness values are. Adding 100 to every fitness changes nothing. The cost is a sort, $O(n \log n)$ per generation, and the loss of information about how much better one individual is than another.

Ranking still needs the whole population sorted. Tournament selection works from comparisons alone.

Tournament selection

Tournament selection draws $k$ individuals at random and selects the best of them, repeating until enough parents are chosen. Goldberg and Deb (1991) trace it to unpublished work by Wetzel studied in Brindle's dissertation. It needs no global sort and no knowledge of the population's fitness distribution, only pairwise comparisons. That makes it easy to parallelize, and usable when fitness is defined only by comparison. The tournament size $k$ controls pressure. The best individual wins a tournament whenever it is drawn. With contestants drawn with replacement, it is drawn in a given tournament with probability $1 - (1 - 1/n)^k$, so over $n$ tournaments it expects $n\,[1 - (1 - 1/n)^k]$ copies. That is close to $k$ in a large population: 1.99 for $n = 100$ and $k = 2$.

Example (binary tournaments among four). Four individuals hold binary tournaments ($k = 2$), with contestants drawn with replacement. The worst individual expects a quarter of a copy. It wins only when both contestants are the worst, with probability $(1/4)^2 = 1/16$, and four selections give $4/16 = 0.25$. In general the individual of rank $i$ (counting from 1 for the worst) wins when both contestants have rank at most $i$ and not both have rank at most $i - 1$, with probability $(i^2 - (i-1)^2)/16 = (2i - 1)/16$. The expected copies by rank are exactly 0.25, 0.75, 1.25 and 1.75.

Goldberg and Deb (1991) showed that two of these schemes are the same in expectation. Their model divides a population into classes of equal fitness. Under it, binary tournament and linear ranking with $s = 2$ are identical in expectation. They also analyzed a probabilistic binary tournament in which the better individual wins only with probability $p$. It matches ranking with $s = 2p$, so every linear ranking scheme has a tournament with the same expected effect.

In a finite population of distinct individuals the two differ slightly, and agree as $n$ grows. The individual with $r$ others below it expects $2r/(n-1)$ copies under ranking with $s = 2$, from the formula above, and $(2r + 1)/n$ under binary tournament: the count in the example, with $n$ in place of 4 and $i = r + 1$, gives a winning probability of $(2i - 1)/n^2$ in each of $n$ tournaments. The difference is

$$\frac{2r}{n-1} - \frac{2r+1}{n} = \frac{2r - (n - 1)}{n(n-1)},$$

which is at most $1/n$ in size, since $0 \le r \le n - 1$. For $n = 4$ it is a quarter of a copy at the two ends, as the table in the section after next shows.

Truncation selection

Truncation selection keeps the best fraction $T$ of the population and selects uniformly among them; everything below the threshold is discarded. It is the selection of animal and plant breeding. Mühlenbein and Schlierkamp-Voosen (1993) built their breeder genetic algorithm on it. The survivor selection of evolution strategies, keeping the best $\mu$ of $\lambda$ offspring, is truncation of the same kind (see $(\mu,\lambda)$ selection and self-adaptation).

We now have several ways to select, and the next section compares them on the same population.

The schemes side by side

The four-individual example makes the schemes easy to compare by hand. The table gives the expected number of copies of each individual, worst to best, for two populations: fitness values 1, 2, 3 and 4, and 101, 102, 103 and 104. Tournaments draw their contestants with replacement. Values are rounded to three places, except the tournament with $k = 3$, whose values are exact.

Scheme Fitness 1, 2, 3, 4 Fitness 101 to 104
Fitness-proportional 0.400, 0.800, 1.200, 1.600 0.985, 0.995, 1.005, 1.015
Sigma scaling, $c = 2$ 0.329, 0.776, 1.224, 1.671 the same
Linear ranking, $s = 1.5$ 0.500, 0.833, 1.167, 1.500 the same
Linear ranking, $s = 2$ 0.000, 0.667, 1.333, 2.000 the same
Tournament, $k = 2$ 0.250, 0.750, 1.250, 1.750 the same
Tournament, $k = 3$ 0.0625, 0.4375, 1.1875, 2.3125 the same
Truncation, $T = 0.5$ 0, 0, 2, 2 the same

Only fitness-proportional selection changes between the two columns. Every other scheme depends on the order of the fitness values, or, for sigma scaling, on their distances measured in standard deviations. Adding a constant changes neither.

The tournament entries follow from counting. With $k$ contestants drawn with replacement, the individual of rank $i$ (1 for the worst) wins when every contestant has rank at most $i$ and not every contestant has rank at most $i - 1$. That has probability $(i/n)^k - ((i-1)/n)^k$. For $k = 3$ and the best of four, it is $1 - (3/4)^3 = 0.578$, or 2.3125 expected copies.

In a larger population the same comparison becomes a curve. The figure plots expected copies against rank in a population of 100 with one individual in each fitness class $i/100$, the setting of the takeover experiment below.

Expected copies by rank in a population of 100 whose fitness values are evenly spaced. Notice that proportional selection on f = i/n is almost identical to binary tournament, giving the best 1.98 copies against the tournament's 1.99, while adding 1 to every fitness value flattens the proportional line so the best expects only 1.33. Ranking with s = 1.5 is a gentler straight line, a tournament of 4 gives the best 3.94 copies and the individual at the median rank about half a copy, and truncation is a step from 0 to 2.
Expected copies by rank in a population of 100 whose fitness values are evenly spaced. Notice that proportional selection on $f = i/n$ is almost identical to binary tournament, giving the best 1.98 copies against the tournament's 1.99, while adding 1 to every fitness value flattens the proportional line so the best expects only 1.33. Ranking with $s = 1.5$ is a gentler straight line, a tournament of 4 gives the best 3.94 copies and the individual at the median rank about half a copy, and truncation is a step from 0 to 2.

The coincidence of the two top lines is not general. Proportional selection behaves like binary tournament here only because fitness happens to be proportional to rank and to start near zero. Shift the fitness values, as the dashed line shows, and the match is gone.

Expected copies describe one generation. Takeover time measures what they add up to over many.

Takeover time

Goldberg and Deb (1991) compared selection schemes by the takeover time $t^*$. It is the number of generations selection alone needs to grow a single best individual until it occupies $n - 1$ places in a population of $n$. The two-type version of this question, with its S-shaped curve, is worked in natural selection for computer scientists. Goldberg and Deb wrote difference equations for the expected proportion $P_t$ of the best class under each scheme:

  • Tournament of size $k$. An individual outside the best class is selected only if all $k$ contestants come from outside it, so $1 - P_{t+1} = (1 - P_t)^k$.
  • Linear ranking with parameter $c_0$, the expected copies of the best individual (which is $s$ above): $P_{t+1} = P_t \left[ c_0 - (c_0 - 1) P_t \right]$.

With $k = 2$ the tournament recursion expands to $P_{t+1} = 1 - (1 - P_t)^2 = P_t\,[2 - P_t]$, which is the ranking recursion with $c_0 = 2$. That is the equivalence of the two schemes in expectation, seen for the best class.

Solving from $P_0 = 1/n$ to $(n-1)/n$ gives the approximations in their Table 2. The tournament row is derived in the next subsection, and the other rows are quoted from Goldberg and Deb:

Scheme Takeover time $t^*$
Fitness-proportional, $f(x) = x^c$ $\frac{1}{c}(n \ln n - 1)$
Fitness-proportional, $f(x) = e^{cx}$ $\frac{1}{c}\, n \ln n$
Linear ranking, $c_0 = 2$ $\log_2 n + \log_2 (\ln n)$
Linear ranking, $1 < c_0 < 2$ $\frac{2}{c_0 - 1} \ln (n - 1)$
Tournament of size $k$ $\frac{1}{\ln k} \left[ \ln n + \ln (\ln n) \right]$

The fitness-proportional results assume $n$ individuals spread evenly over the unit interval, with the best at $x = 1$. The ranking formula for $c_0 < 2$ comes from a logistic differential-equation approximation. Goldberg and Deb give it with the natural logarithm, and note that base 2 corrects the approximation's early overshoot but overestimates the late phase.

The contrast in orders of growth is the main result. Ranking and tournament selection take over in $O(\log n)$ generations, fitness-proportional selection in $O(n \log n)$. Goldberg and Deb add a caution. A real GA must assemble good solutions from parts while selection is acting, so takeover time does not predict how fast a GA finds the optimum. It gives an idea of how long a GA can run before mutation becomes its main means of exploration.

Deriving the tournament formula

Where does the $\ln \ln n$ term come from? Here is the plan of the derivation. The share outside the best class is raised to the power $k$ each generation, so it shrinks doubly exponentially. Two rounds of logarithms then turn the stopping condition into a formula for $t$.

The formal version. Write $Q_t = 1 - P_t$ for the proportion of the population outside the best class.

  1. One generation. A tournament selects an individual outside the best class only if all $k$ contestants come from outside it. Contestants are drawn independently, so in expectation $Q_{t+1} = Q_t^k$.
  2. Unrolling. Applying the recursion $t$ times multiplies the exponents: $Q_t = Q_0^{k^t}$, with $Q_0 = 1 - 1/n$. The outside share shrinks doubly exponentially.
  3. The stopping condition. Takeover means $P_t = (n-1)/n$, that is $Q_t = 1/n$. Taking logarithms of $Q_0^{k^t} = 1/n$ gives $k^t \ln(1 - 1/n) = -\ln n$.
  4. Approximating. For large $n$, $\ln(1 - 1/n) \approx -1/n$ (for $n = 100$ the two are 0.01005 and 0.01000 in size). Since $\ln(1 - x) = -x - x^2/2 - \dots$, the relative error of this step is about $1/(2n)$, so the approximation improves as $n$ grows. Then $k^t / n \approx \ln n$, so $k^t \approx n \ln n$.
  5. Solving for $t$. Taking logarithms once more, $t \ln k \approx \ln n + \ln \ln n$, which is Goldberg and Deb's formula, $t^* \approx (\ln n + \ln \ln n)/\ln k$.

The check. For $n = 100$ and $k = 2$, the exact solution of step 3 is $t = 8.840$ and the approximation gives 8.847. Following the recursion one generation at a time shows the shape of takeover. The best class's proportion $P_t$ is 0.010, 0.020, 0.039, 0.077, 0.149, 0.275, 0.474, 0.724, 0.924 and 0.994 for $t = 0, \dots, 9$ (rounded to three places). It roughly doubles each generation while it is small, since $1 - (1 - P)^2 \approx 2P$. It then closes the remaining gap in two or three generations, the logistic shape common to all the schemes.

The formulas describe expected proportions. A real population is finite and sampled at random. The next subsection measures how well the formulas survive that.

Takeover time measured

The script tools/experiments/evolution/takeover.py in the site repository runs the Goldberg and Deb setting. There are $n$ individuals, one in each fitness class $f = i/n$ for $i = 1, \dots, n$, and selection only, with replacement, for 30 seeds per scheme. Each run stops when the best class holds $n - 1$ places, or when it dies out. The table gives four things for each scheme:

  • the closed form above;
  • the first generation at which the deterministic recursion reaches $(n-1)/n$;
  • the median and interquartile range of the simulated takeover times, over the runs in which the best survived;
  • the number of runs in which the best was lost.

Example (proportional selection with independent spins). The closed form predicts 459.5 generations for proportional selection with $n = 100$. With independent spins the simulated takeover was faster than that, when it happened at all. The median was 100 generations, and the best was lost in 17 of the 30 runs. The rest of the section explains why.

Scheme, $n = 100$ Closed form Recursion Simulated median [Q1, Q3] Best lost
Proportional, independent spins 459.5 459 100.0 [57.0, 117.0] 17 of 30
Proportional, SUS 459.5 459 397.5 [348.5, 486.2] 0 of 30
Linear ranking, $s = 2$ 8.8 9 9.0 [8.5, 10.0] 7 of 30
Linear ranking, $s = 1.5$ 18.4 19 16.5 [15.0, 18.2] 14 of 30
Tournament, $k = 2$ 8.8 9 9.0 [9.0, 10.0] 5 of 30
Tournament, $k = 4$ 4.4 5 5.0 [5.0, 5.0] 1 of 30
Tournament, $k = 8$ 2.9 3 3.0 [3.0, 3.8] 0 of 30
Truncation, $T = 0.5$ 7 7.0 [6.0, 8.0] 6 of 30
The proportion of the population held by the best class, generation by generation, for a population of 100. Lines follow the expected-proportion recursion and markers give the median over those of the 30 simulated runs in which the best survived; the horizontal axis is logarithmic and shows t + 1. Notice how far apart the schemes sit: tournaments of size 4 and 2 take over in about 5 and 9 generations, ranking with s = 1.5 in about 17, and proportional selection with SUS in several hundred.
The proportion of the population held by the best class, generation by generation, for a population of 100. Lines follow the expected-proportion recursion and markers give the median over those of the 30 simulated runs in which the best survived; the horizontal axis is logarithmic and shows $t + 1$. Notice how far apart the schemes sit: tournaments of size 4 and 2 take over in about 5 and 9 generations, ranking with $s = 1.5$ in about 17, and proportional selection with SUS in several hundred.

For ranking and tournament selection, the medians agree with the theory to within a generation or two. With $n = 1000$ they grow only slightly, as $O(\log n)$ predicts: 13 generations for binary tournament (theory 12.8) and 5 for $k = 8$ (theory 4.3).

Fitness-proportional selection with independent spins departs from the theory completely. Both effects in the table come from sampling error.

  • The best is often lost. The best individual starts with an expected 1.98 copies. The number it actually receives is close to a Poisson count with that mean, the limit of a binomial count over many draws each with a small chance of picking it, and that count is zero about 14% of the time.
  • Takeover, when it happens, is fast. Later in the run the top classes have nearly equal fitness, the wheel barely distinguishes them, and their numbers wander at random. This is genetic drift. Drift, not selection, then decides which class fills the population. In these runs it did so faster than selection would: the median of 100 generations is less than a quarter of the 459 the recursion predicts for selection alone.

With SUS, which removes most of the sampling error, no run lost the best individual, and the median of 397.5 generations came much closer to the prediction. At $n = 1000$ the gap is larger still. Independent spins took 544 generations, with the best lost in 21 runs, against 6,484 with SUS and a prediction of 6,907.

The column of losses is a result in its own right. Even binary tournament selection, the most common scheme in practice, lost the best individual in 5 of 30 runs. An individual that is never drawn into a tournament is never copied. That happens to any given individual with probability $(1 - 1/100)^{200} \approx 0.13$. Truncation selection never discards the best individual from the candidate pool, yet it still lost it in 6 runs: 100 uniform draws from the top 50 miss a given individual with probability $(1 - 1/50)^{100} \approx 0.13$.

Takeover time watches one individual. Selection intensity measures what selection does to the population as a whole.

Selection intensity

Blickle and Thiele (1996) characterized a scheme by its effect on the whole fitness distribution. They used selection intensity, a measure from quantitative genetics that Mühlenbein and Schlierkamp-Voosen (1993) had applied to genetic algorithms: the change in mean fitness caused by selection, divided by the standard deviation of fitness before selection,

$$I = \frac{\bar{f}_{\text{sel}} - \bar{f}}{\sigma}.$$

For comparison, they computed $I$ on a population whose fitness follows the standard normal distribution:

  • Tournament of size $k$: $I$ is the expected maximum of $k$ standard normal values, $1/\sqrt{\pi} \approx 0.5642$ for $k = 2$.
  • Linear ranking: $I = (s - 1)/\sqrt{\pi}$, so ranking with $s = 2$ and binary tournament have the same intensity.
  • Truncation with threshold $T$: $I = \varphi(z)/T$, where $z$ is the point above which a fraction $T$ of the standard normal lies and $\varphi$ is the standard normal density.
  • Fitness-proportional selection is not invariant to translation, so it has no standardized value. The calculation at the start of this article gives $\sigma/\bar{f}$ for it.

The check. The binary tournament value can be checked by hand. For two numbers, $\max(X_1, X_2) = \frac{1}{2}(X_1 + X_2) + \frac{1}{2}|X_1 - X_2|$. If $X_1$ and $X_2$ are independent standard normal values, the first term has expectation 0. The difference $X_1 - X_2$ is normal with mean 0 and variance 2. The mean absolute value of a normal variable with standard deviation $s$ is $s\sqrt{2/\pi}$, so $\mathbb{E}|X_1 - X_2| = \sqrt{2} \cdot \sqrt{2/\pi} = 2/\sqrt{\pi}$. Halving it gives $I = 1/\sqrt{\pi} = 0.5642$. The same value for linear ranking with $s = 2$ is no coincidence. By the two formulas compared in the tournament section, an individual with $r = qn$ others below it expects $2r/(n-1)$ copies under ranking and $(2r+1)/n$ under binary tournament. Both are within $2/n$ of $2q$. In a large population the two schemes therefore give every rank the same expected number of copies, and so change any fitness distribution, the normal one included, in the same way.

Blickle and Thiele also defined the loss of diversity $p_d$, the fraction of the population not selected. Their formulas give the smallest loss the expected numbers of copies allow. That is the shortfall below one copy, summed over the individuals expected to receive fewer than one, as a fraction of the population. It gives $p_d = k^{-1/(k-1)} - k^{-k/(k-1)}$ for tournaments, $(s - 1)/4$ for linear ranking, and $1 - T$ for truncation.

Example (loss of diversity under independent draws). The theory says binary tournament leaves out a quarter of the population: $2^{-1} - 2^{-2} = 0.25$. With independent draws the measured loss is larger. The theoretical value is a minimum, reached only when each individual's count is as close to its expectation as possible. Independent draws also miss individuals that would have been selected on average. The second part of takeover.py checks both measures on 10,000 standard normal fitness values, 30 seeds, with independent draws:

Scheme $I$, theory $I$, measured $p_d$, theory $p_d$, measured
Tournament, $k = 2$ 0.5642 0.5641 0.2500 0.4322
Tournament, $k = 4$ 1.0294 1.0287 0.4725 0.5613
Tournament, $k = 8$ 1.4236 1.4236 0.6501 0.6948
Linear ranking, $s = 2$ 0.5642 0.5665 0.2500 0.4334
Linear ranking, $s = 1.5$ 0.2821 0.2849 0.1250 0.3840
Truncation, $T = 0.5$ 0.7979 0.7988 0.5000 0.5675

Intensity matches the theory to two or three decimal places. The measured loss of diversity is much larger: binary tournament leaves out 43% of the population each generation, not 25%. Ranking with $s = 1.5$, the gentlest scheme in the table, loses 38% under independent sampling and exactly 12.5% under SUS, which the script also prints. How a scheme is sampled can matter as much as which scheme it is.

So every scheme can lose the best individual, and every scheme discards diversity. Elitism protects against the first, and the remedies of the later sections against the second.

Elitism

The losses in the takeover experiment have a simple remedy. Elitism copies the best individual, or the best few, into the next generation unchanged. De Jong (1975) studied this as the elitist strategy. It guarantees that the best fitness in the population never decreases.

It also has a theoretical justification. Rudolph (1994) proved with a Markov chain model that the canonical genetic algorithm, with proportional selection, crossover and mutation, does not converge to the global optimum, in the sense that the probability of the population containing it does not tend to one. Variants that always keep the best solution do converge in that sense. Plus-selection in evolution strategies, which pools parents and offspring before choosing survivors, is elitist by construction. Elitism also adds pressure, since the elite are never lost and keep reproducing, so it is usually limited to one or a few individuals.

Diversity loss and premature convergence

Premature convergence happens when the population becomes concentrated in one region before any member has found a good solution there. Strong selection is the main cause, but not the only one.

  • Drift. As the experiment shows, drift can fix an arbitrary class in a finite population without any selective reason, and small populations drift fast.
  • Crossover of near-identical parents. It produces near-identical children. Once diversity is gone, only mutation can introduce anything new. At low mutation rates the search becomes a slow local search around one point, as the seeded run in the simple genetic algorithm showed on five bits.

De Jong (1975) observed this stall in his own experiments, as the article on the De Jong functions describes.

The remedies follow from the causes:

  • lower selection pressure (smaller tournaments, gentler ranking);
  • sampling with SUS;
  • larger populations;
  • higher mutation rates;
  • restarts when diversity falls below a threshold;
  • separate subpopulations that exchange individuals only occasionally, as in island models.

A different family of methods changes selection itself, so that the population keeps several groups, or niches, around different optima.

Niching

On a function with several optima of equal height, a plain genetic algorithm ends up on one of them, chosen largely by drift. Niching methods aim to keep subpopulations on several peaks at once. That helps both when several good solutions are wanted and when the global optimum lies on a peak that would otherwise be abandoned early.

Fitness sharing

Goldberg and Richardson (1987) proposed fitness sharing: individuals close to each other share their fitness, like animals sharing the food of one habitat. Each individual's fitness is divided by a niche count,

$$f'_i = \frac{f_i}{\sum_{j=1}^{n} \mathrm{sh}(d_{ij})}, \qquad \mathrm{sh}(d) = \begin{cases} 1 - (d/\sigma_{\text{share}})^{\alpha} & d < \sigma_{\text{share}}, \\ 0 & \text{otherwise.} \end{cases}$$

Here $d_{ij}$ is the distance between individuals $i$ and $j$ (in genotype or phenotype space), $\sigma_{\text{share}}$ is the niche radius, and $\alpha$ shapes the sharing function, commonly 1. The sum includes $j = i$, with $\mathrm{sh}(0) = 1$.

Example (sharing favors the isolated individual). Three individuals of equal fitness 1 sit at positions 0, 0.1 and 1.0, with $\sigma_{\text{share}} = 0.5$ and $\alpha = 1$. Proportional selection on shared fitness favors the isolated one at 1.0. The first two are 0.1 apart, so $\mathrm{sh}(0.1) = 1 - 0.1/0.5 = 0.8$ and each has niche count $1 + 0.8 = 1.8$. The third is more than 0.5 from both and has niche count 1. Shared fitness is $1/1.8 = 0.556$, 0.556 and 1.0, with sum 2.111, and the expected copies $3 f'_i / 2.111$ are 0.79, 0.79 and 1.42. The isolated individual, alone on its peak, is favored, and the crowded niche loses ground.

Suppose niches are tight and far apart: members of one niche are at nearly zero distance from each other, so $\mathrm{sh} \approx 1$ between them, and more than $\sigma_{\text{share}}$ from every other niche, so $\mathrm{sh} = 0$ across niches. Then each of the $m$ members of a niche on a peak of height $f$ has niche count $m$ and shared fitness $f/m$, and the niche's total shared fitness is $m \cdot f/m = f$. So the niche as a whole receives a share proportional to the height of its peak, whatever its size. Sharing has two practical costs. Computing all pairwise distances takes $O(n^2)$ time per generation. And $\sigma_{\text{share}}$ must be set in advance, which presumes some knowledge of how far apart the optima are.

Crowding keeps niches without choosing a radius.

Crowding

Crowding works through replacement rather than selection. In De Jong's (1975) version, each offspring replaces the most similar of a random sample of $CF$ individuals from the population, $CF$ being the crowding factor. New individuals then tend to displace their own kind rather than members of other niches.

Mahfoud (1992) re-examined crowding and preselection. His dissertation (Mahfoud, 1995) describes the method that came out of that work, deterministic crowding:

  1. Parents are paired at random, and each pair produces two children by crossover and mutation.
  2. The children are matched to the parents in whichever of the two possible pairings has the smaller total parent-child distance.
  3. Each child replaces its matched parent only if it is fitter.

Deterministic crowding needs no niche radius. Because children compete only with their own parents, a niche is not taken over by individuals from another peak.

Speciation in NEAT applies explicit fitness sharing to neural networks. MAP-Elites and novelty search take the idea of preserving diversity further, rewarding difference for its own sake.

What we have learned

Fitness-proportional selection raises the mean by $\sigma^2/\bar f$, so it fades as fitness values draw together and nearly vanishes when a constant is added. Ranking, tournaments and truncation look only at order and keep their pressure. Measured by takeover time, they fill a population of 100 in 3 to about 17 generations, against hundreds for the roulette wheel. How a scheme is sampled matters too. Independent spins lost the best individual in 17 of 30 runs and let drift, not selection, decide the winner, while SUS lost it in none. Elitism keeps the best, and niching keeps several peaks occupied, at the price of extra pressure or extra computation.

Selection only chooses among the candidates that exist. New candidates come from crossover and mutation, and the right operator depends on the representation: bit strings, real vectors or permutations. Crossover and mutation operators describes how the standard operators work for each representation, and how each one sets the distance between a child and its parents.

References

  • Baker, J. E. (1985). Adaptive selection methods for genetic algorithms. In Proceedings of the First International Conference on Genetic Algorithms and Their Applications, 101–111. record
  • Baker, J. E. (1987). Reducing bias and inefficiency in the selection algorithm. In Proceedings of the Second International Conference on Genetic Algorithms and Their Application, 14–21. record
  • Blickle, T., and Thiele, L. (1996). A comparison of selection schemes used in evolutionary algorithms. Evolutionary Computation, 4(4), 361–394. record
  • De Jong, K. A. (1975). An Analysis of the Behavior of a Class of Genetic Adaptive Systems. Doctoral dissertation, University of Michigan. record · 5 pages
  • Eiben, A. E., and Smith, J. E. (2015). Introduction to Evolutionary Computing, 2nd ed., chapter 5. Springer. record · 35 pages
  • Goldberg, D. E. (1989). Genetic Algorithms in Search, Optimization, and Machine Learning. Addison-Wesley. record · 6 pages
  • Goldberg, D. E., and Deb, K. (1991). A comparative analysis of selection schemes used in genetic algorithms. In G. J. E. Rawlins (ed.), Foundations of Genetic Algorithms, 69–93. Morgan Kaufmann. record · 2 pages
  • Goldberg, D. E., and Richardson, J. (1987). Genetic algorithms with sharing for multimodal function optimization. In Proceedings of the Second International Conference on Genetic Algorithms and Their Application, 41–49. record · 3 pages
  • Holland, J. H. (1975). Adaptation in Natural and Artificial Systems. University of Michigan Press. record · 5 pages
  • Mahfoud, S. W. (1992). Crowding and preselection revisited. In R. Männer and B. Manderick (eds.), Parallel Problem Solving from Nature 2, 27–36. North-Holland. record
  • Mahfoud, S. W. (1995). Niching Methods for Genetic Algorithms. Doctoral dissertation, University of Illinois at Urbana-Champaign. record
  • Mühlenbein, H., and Schlierkamp-Voosen, D. (1993). Predictive models for the breeder genetic algorithm I. Continuous parameter optimization. Evolutionary Computation, 1(1), 25–49. record
  • Rudolph, G. (1994). Convergence analysis of canonical genetic algorithms. IEEE Transactions on Neural Networks, 5(1), 96–101. record

Reviewed: verified, 16 Nov 2026 · citations checked, 16 Nov 2026 · editorial review, 23 Nov 2026 · 8 revisions