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
Compare how tournament selection affects population diversity against alternative selection operators. section 3.4



