Tournament selection:
- Tournament selection is a method of selecting an individual from the population of individuals.
- Choosing a tournament involves launching several "tournaments" among several individuals chosen at random among the population.
- The winner of each tournament (the one that has the best fitness) is selected for the crossover.
- When the size of the tournament is smaller, choosing a tournament also allows all people to be selected, and thus preserves diversity, although maintaining diversity can degrade convergence.
- But if the size of the tournament is larger, weak individuals are less likely to be selected, resulting in a loss of variety.
pseudo code:
choose k (the tournament size) individuals from the population at random choose the best individual from pool/tournament with probability p choose the second best individual with probability p*(1-p) choose the third best individual with probability p*((1-p)^2) and so on...
The deterministic choice of a tournament chooses the best person (when p = 1) in any tournament. Choosing from a 1-way tournament (k = 1) is equivalent to a random selection. The selected individual can be removed from the population if the choice is made at will, otherwise people can be selected more than once for the next generation. Compared to the method of proportional selection (stochastic) suitability, the choice of a tournament is often realized in practice due to the lack of stochastic noise.
Tournament selection in MatLab:
Matepool=randi(PopLength,PopLength,2);%%select two individuals randomly for tournament and chooose the one with best fitness value %% number of tournament is equal to the number of population size for i=1:PopLength if Fitness(Matepool(i,1))>= Fitness(Matepool(i,2)) SelectedPop(i,1:IndLength)=CurrentPop(Matepool(i,1),1:IndLength); else SelectedPop(i,1:IndLength)=CurrentPop(Matepool(i,2),1:IndLength); end end
setu basak
source share