liveBook · Manning

Selection

As explained in Grokking AI Algorithms, Second Edition

Selection is an evolutionary algorithm operation that chooses candidate solutions for continuation or reproduction based on their quality.

Selection chooses candidate solutions for continuation or reproduction according to fitness. It chooses parents before reproduction and survivors after reproduction, usually while keeping population size fixed. section 4.17 section 4.3

Selection has two closely related jobs in a genetic algorithm:

  • Parent selection chooses fit individuals to produce offspring through crossover and mutation. section 4.3
  • Generation selection chooses individuals and offspring that survive into the next generation. section 4.17
  • Elitism keeps the highest-ranked individuals, but similar survivors can reduce genetic diversity and cause stagnation. section 4.17
  • Selection methods balance exploration of varied solutions against exploitation of solutions that already perform well. section 4.20 section 5.2

A constrained knapsack population

Imagine candidate knapsacks scored by the total value they carry without exceeding the weight limit. A valid high-value individual receives a strong fitness score and becomes a better candidate for selection; an overweight individual receives 0, making it effectively worthless despite its contents. The chosen parents produce offspring, and selection then decides which individuals remain in the fixed-size next generation. section 4.7 section 4.3

Figure 4.9 Genetic algorithm life cycle
04_09

Trace selection alongside population creation, fitness measurement, reproduction, and next-generation replacement. section 4.3

How Grokking AI Algorithms, Second Edition covers it

How deep it goes
Explains parent and survivor selection, elitism, and diversity trade-offs, but does not detail each alternative strategy.
Examples
Uses knapsack fitness scores, overweight-solution penalties, elitism, and genetic algorithm lifecycle diagrams.
What it assumes
Assumes populations, candidate solutions, fitness functions, reproduction, and mutation; explains their lifecycle relationship.
What you can do after
Operate/configure selection in a genetic algorithm while recognizing convergence, stagnation, and diversity trade-offs.
How it connects
Connects fitness functions, reproduction, crossover, mutation, genetic diversity, and exploration versus exploitation.

Also explained in

Compare how 5 books explain selection →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Grokking AI Algorithms, Second Edition. The section links point to the parts of the book it draws on.