VII. Parameters of GA
Crossover and Mutation Probability
There are two basic parameters of a GA: crossover probability and mutation probability.
Crossover probability indicates how often crossover will be performed.
If there is no crossover, the offspring is an exact copy of its parents. If there is
crossover, the offspring is created from parts of the parents' chromosomes. If the crossover
probability is 100%, then all offspring are created by crossover. If it
is 0%, the whole new generation is made from exact copies of chromosomes
from the old population (but this does not mean that the new generation is the
same).
Crossover is performed in the hope that new chromosomes will contain good parts of older
chromosomes and may therefore be better. However, it is also useful to let some part
of the population survive into the next generation.
Mutation probability indicates how often parts of a chromosome will be mutated.
If there is no mutation, the offspring is taken after crossover (or copying) without
any change. If mutation is performed, part of the chromosome is changed. If the mutation
probability is 100%, the whole chromosome is changed; if it is 0%,
nothing is changed.
Mutation is used to prevent the GA from falling into a local optimum, but it should
not occur too often, because then the GA will in fact turn into a random
search.
Other Parameters
There are also other parameters of a GA. Another important parameter is population size.
Population size indicates how many chromosomes there are in the population in one generation. If there are too few chromosomes, the GA has only a few possibilities for crossover, and only a small part of the search space is explored. On the other hand, if there are too many chromosomes, the GA slows down. Research shows that beyond some limit (which depends mainly on the encoding and the problem), it is not useful to increase the population size, because it does not make solving the problem faster.
Some recommendations for all parameters can be found in one of the following chapters.
Example
Here you can see an example similar to the previous one. In this case, you can change the crossover and mutation probabilities. You can also control elitism.
In the graph below, red represents the best solution, and blue represents the average value (fitness) of the whole population.
Try changing the parameters and see how the GA behaves.
Question: If you try to increase mutation probability to 100%, the GA will start to behave very strangely, almost as if the mutation probability were 0%. Do you know why? You can use a hint and, if you still do not know, look at the solution!