What is selection in a genetic algorithm?

Stephen M. Walker II · Co-Founder / CEO

What is selection in a genetic algorithm?

Selection is the process of choosing individuals from a population to serve as parents for the next generation in a genetic algorithm. It favors individuals with higher fitness values so that useful traits are more likely to be passed on, while still leaving room for lower-fitness individuals to be chosen occasionally, which helps preserve diversity in the population.

Common selection methods include:

  • Tournament selection — A small subset of individuals is randomly drawn from the population, and the one with the highest fitness value wins and is selected as a parent.

  • Roulette wheel selection — Each individual is assigned a selection probability proportional to its fitness value, and parents are chosen by a weighted random draw.

  • Rank-based selection — Individuals are ranked by fitness rather than by raw fitness value, and selection probability is based on rank. This reduces the influence of extreme fitness differences.

Once parents are selected, their genes are combined through crossover and mutation to produce offspring, which are evaluated and added to the next generation. This selection–crossover–mutation cycle repeats until a stopping criterion is met, such as a maximum number of generations or convergence on an acceptable solution.

What are the objectives and trade-offs of selection?

Selection has two competing objectives: improving the population's overall fitness and maintaining enough diversity to keep exploring the search space. Selection pressure controls this balance.

  • If pressure is too high, the algorithm can converge prematurely on a suboptimal solution before adequately exploring the search space.
  • If pressure is too low, the algorithm may fail to make consistent progress and lose useful genetic variation.
  • Selection parameters, such as tournament size or selection probability, often need to be tuned for a given problem, and results can be sensitive to the accuracy of the fitness function used.

Choosing a selection method and pressure that fit the problem is central to a genetic algorithm's ability to converge efficiently without losing diversity too early.

More terms

Continue exploring the glossary.

Learn how teams define, measure, and improve LLM systems.

August 14, 2024

𝕏 Grok-2 Beta Release

A historical look at x.ai's August 2024 Grok-2 release, which offered advanced chat, coding, and reasoning features. Grok-2 has since been superseded by later Grok generations.
Read term

Glossary term

What is model checking?

Model checking verifies a system's model correctness. It uses a transition system model and checks if it satisfies certain properties. These properties can be safety properties, ensuring nothing harmful occurs, or liveness properties, guaranteeing a beneficial outcome eventually.
Read term

It's time to build

Collaborate with your team on reliable Generative AI features.
Want expert guidance? Book a 1:1 onboarding session from your dashboard.

Talk to sales