liveBook · Manning

Tournament selection

As explained in Evolutionary Deep Learning: Genetic algorithms and neural networks

Tournament selection is a selection method that compares randomly chosen groups of individuals and selects the highest-fitness competitor from each group.

Tournament selection chooses parents by repeatedly forming random groups, comparing fitness within each group, and advancing each winner. It favors strong individuals without immediately discarding population diversity. section 3.1.1 section 3.4

A practical tournament-selection cycle is:

  • Select an initial tournament group randomly from the population. section 3.4
  • Compare competitors by fitness and move the winner into the parent pool. section 3.1.1
  • Repeat until enough parents have been selected for the next generation. section 3.4
  • Adjust tournament size to control selection pressure: larger groups favor the best individuals more strongly. section 3.1.1

OneMax with DEAP

For a 100-bit OneMax population, register DEAP's tournament operator with `tools.selTournament` and `tournsize=3`. The evolutionary run combines this selector with evaluation, two-point crossover, bit-flip mutation, a population of 300, and 40 generations.

Listing 3.3 EDL_3_1_OneMax_DEAP.ipynb: Genetic operators
toolbox.register("evaluate", evalOneMax)      #1
 
toolbox.register("mate", cxTwoPointCopy)      #2
 
toolbox.register("mutate", tools.mutFlipBit, 
 indpb=0.05)                                #3
 
toolbox.register("select", tools.selTournament, 
 tournsize=3)                               #4

Inspect the runnable DEAP registration for tournament selection alongside evaluation, crossover, and mutation. section 3.1.1

Figure 3.7 A comparison of selection operators on population diversity

Compare how tournament selection affects population diversity against alternative selection operators. section 3.4

How Evolutionary Deep Learning: Genetic algorithms and neural networks covers it

How deep it goes
Explains random grouping, winner advancement, repetitions, and tournament size, then demonstrates DEAP configuration without deriving selection theory.
Examples
Demonstrates OneMax with DEAP's selTournament, tournsize=3, and comparisons of selection operators using diversity figures.
What it assumes
Assumes genetic-algorithm terms such as fitness, parents, crossover, mutation, and population, while showing their DEAP registration context.
What you can do after
Operate/configure tournament selection in DEAP and inspect its effects on optimization and population diversity.
How it connects
Connects fitness, genetic algorithms, crossover, mutation, population diversity, and local optima.

Also explained in

Compare how 4 books explain tournament selection →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Evolutionary Deep Learning: Genetic algorithms and neural networks. The section links point to the parts of the book it draws on.