There are different types of selection, we can implement in a genetic algorithm. We seldom become confused with two types of selection. One type is Roulette wheel selection and another is Rank based selection.

In Rank Selection:

The rank selection first ranks the population and then every chromosome receives fitness from this ranking.

The worst-case will have fitness 1, second-worst 2, etc. and the best-case will have fitness N (number of chromosomes in population).

After this, all the chromosomes have a chance to be selected.

Rank-based selection schemes can avoid premature convergence.

But it can be computationally expensive because it manages the populations based on fitness value.

But this method can point to slower convergence because the best chromosomes do not differ so much from other ones.

So the process will be:

First, sort the Fitness value of the Population.

Then if the Population number is 10 then give the probability of selection to the Population like 0.1,0.2,0.3,…, 1.0.

Then calculate cumulative Fitness and make the roulette wheel.

And the next steps are the same as the roulette wheel.

If you wish to learn about Genetic Algorithm or Genetic Programming then visit this Artificial Intelligence Course.