3 An introduction to genetic algorithms with DEAP

 

This chapter covers

  • Creating genetic solvers using DEAP.
  • Applying GA to a complex design or placement problem.
  • Solving or estimating mathematically hard problems with GA.
  • Determining which GA operators to employ when solving problems.
  • Constructing complex gene structures for design and drawing.

In the last chapter, we explored the origins of life simulation and how evolution and natural selection can be used for optimization. We learned how genetic algorithms, a subset of evolutionary computation, could extend these concepts further into an elegant practical method of optimized search.

For this chapter, we directly extend what we learned in the last chapter to tackle larger and more complex problems using genetic algorithms. As part of this journey, we will employ an evolutionary computation toolkit called DEAP to make our lives easier. Not unlike deep learning frameworks like Keras or PyTorch, DEAP provides several tools and operators to make coding easier.

3.1 Genetic Algorithms in DEAP

While we could continue writing all the GA code we need in straight Python, this book isn’t about building an EC framework. Instead, we are going to use an established EC framework called DEAP, Distributed Evolutionary Algorithms in Python. As the name suggests this framework will help us review various EC methods including GA.

3.1.1 One Max with DEAP

 
 

3.1.2 Learning Exercises

 
 

3.2 Solving the Queens Gambit

 
 
 
 

3.2.1 Learning Exercises

 
 
 

3.3 Helping a Traveling Salesman

 
 

3.3.1 Building the TSP Solver

 
 
 
 

3.3.2 Learning Exercises

 
 
 
 

3.4 Selecting Genetic Operators for Improved Evolution

 
 

3.4.1 Learning Exercises

 
 

3.5 Painting with the EvoLisa

 
 

3.5.1 Learning Exercises

 
 
 

3.6 Summary

 
 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage
test yourself with a liveTest