# Does crossover take the parents or the offsprings? How to select parents with linear ranking?

I am building genetic algorithm for feature selection. But there are vague things to me.

1. For example, there are 100 individuals with crossover probability 0.8. Does it mean I take 80 parents (40 couples), or 80 offsprings?
2. I'm using linear ranking as the parent selection because of the fitness values are close to each other. How can I select the parents after I get the values of linear ranking?
3. Assume if the answer on number (1) is taking 80 parents. After I get parent's candidates, what will happen to the unused parents if those candidates are more than our requirement? And what will happen if those candidates are less than our requirement?
4. If we only take the best 80 individuals as parents, then what is the point of using linear ranking as parent selection?

Thanks before.

• Please ask only one question per post. Also, which resources have you checked? Those are rather basic question I'd assume are covered in any textbook on the matter. Commented Dec 11, 2017 at 12:05

For example, there are 100 individuals with crossover probability 0.8. Does it mean I take 80 parents (40 couples), or 80 offsprings?

0.8 is the probability that crossover will occur at a particular mating.

The standard algorithm samples the population with replacement (the same parent may be selected more than once):

• you pick out 50 couples;
• crossover is performed for (about) 40 couples producing 80 new individuals (80% of the new generation is produced via crossover);
• (approximately) 10 couples are copied to the new population (here ignoring the mutation operator).

(this is a generational approach).

I'm using linear ranking as the parent selection because of the fitness values are close to each other. How can I select the parents after I get the values of linear ranking?

Just use the standard roulette wheel selection algorithm and, rather than weighting each candidate by its fitness score, use its rank.

If we only take the best 80 individuals as parents, then what is the point of using linear ranking as parent selection?

It's not deterministic. An individual has a probability of getting selected as a parent (the probability is linked to the rank).

With rank selection the best individual is more likely to be chosen than the second one, but both have the same probabilities of being chosen whether the best had ten times the fitness of the second best, or only a slightly greater fitness.