What's the point of crossover probability in genetic algorithm?
The general procedure of a genetic algorithm is: (source)
First an initial population is generated. Then a selection method is used (in this case the tournament selection) to choose a pair of individuals that will create a pair of children.
The children are added to the children population until its size reaches the desired value.
The next step is to combine the parents population of size N and children population of size M, either by replacing one by the other, keeping the best N individuals from both populations.
N = population size
P = create parent population by randomly creating N individuals
while not done
C = create empty child population
while not enough individuals in C
parent1 = select parent ***** HERE IS WHERE YOU DO TOURNAMENT SELECTION *****
parent2 = select parent ***** HERE IS WHERE YOU DO TOURNAMENT SELECTION *****
child1, child2 = crossover(parent1, parent2)
mutate child1, child2
evaluate child1, child2 for fitness
insert child1, child2 into C
end while
P = combine P and C somehow to get N new individuals
end while
Of course we might want to perform mutation with a given probability, for instance every 1 out of 100 children will be mutated.
But I don't see the point of crossover rate. What happens when a pair of parents is selected in tournament selection and the crossover didn't happen? Should the parents be added to the children population? In this case we would end up with duplicate members in parents and children population.
The goal here is to create as many children as desired in each generation, and it has to happen by means of crossover. How to change this algorithm so that crossover rate makes any sense?
If crossover probability is 100%, then all offspring is made by crossover. If it is 0%, whole new generation is made from exact copies of chromosomes from old population (but this does not mean that the new generation is the same!). Source
If the crossover probability is 0%, then the whole generation is made of exact copies of chromosome from old population. Then how come the new generation isn't the same?