January 2020
Intermediate to advanced
346 pages
9h 8m
English
Let's reset our changes and go back to the original settings (50 generations, population size 200). We are now ready to experiment with the crossover operator that's responsible for creating offspring from parent individuals.
Changing the crossover operator from a single-point to two-point crossover is simple, as we now define the crossover operator as follows:
toolbox.register("mate", tools.cxTwoPoint)
The algorithm now finds the best solution after only 27 generations:

This behavior is typical to genetic algorithms utilizing binary string ...
Read now
Unlock full access