3 Introducing 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 difficult 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.

In 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 employ an EC toolkit called Distributed Evolutionary Algorithms in Python (DEAP) to make our lives easier. Like frameworks such as 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, in this chapter, we use the well-established DEAP EC framework. As its name suggests, this framework helps us review various EC methods, including GA.

3.1.1 One max with DEAP

 
 

3.1.2 Learning exercises

 
 

3.2 Solving the Queen’s 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

 
 
 

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