O'Reilly logo

Genetic Algorithms and Machine Learning for Programmers by Frances Buontempo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Let’s Fire Some Cannons

The GA starts with a generation of random_tries. The GA selects parents from each generation to breed new solutions by crossover. It then has a new generation and will perform mutation on a few of the pairs to keep some variety. Crossover picks angles and velocities from the parents, so mixes things up a bit, but mutation ensures more variety, by changing the numbers. Crossover could splice together two seating plans but would need to deal with two guests ending up in the same seat. Mutation could swap two guests. These two operations depend on the problem at hand.

You can try crossover or mutation by themselves, but the combination allows the GA to explore more and makes it more likely to find a good solution more ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required