The choice of rank is easy to implement when you already know how to choose a roulette wheel. Instead of using fitness as a chance to choose, you use rank. Thus, for a population of N solutions, the best solution is ranked N, the second best rank N-1, etc. The worst person has a rank of 1. Now use the roulette wheel and start choosing.
The probability of choosing the best person is N / ((N * (N + 1)) / 2) or about 2 / N, for the worst individual it is 2 / (N * (N + 1)) or about 2 / N ^ 2.
This is called a linear ranking choice because the ranks form a linear progression. You can also think of ranks forming a geometric progression, for example, 1/2 ^ n, where n ranges from 1 for a better individual to N for a worse one. This, of course, gives a much greater likelihood of a better person.
You can look at the implementation of some selection methods in HeuristicLab .
Andreas
source share