January 2020
Intermediate to advanced
346 pages
9h 8m
English
The OneMax (or One-Max) problem is a simple optimization task that is often used as the Hello World of genetic algorithm frameworks. We will use this problem for the rest of this chapter to demonstrate how DEAP can be used to implement a genetic algorithm.
The OneMax task is to find the binary string of a given length that maximizes the sum of its digits. For example, the OneMax problem of length 5 will consider candidates such as the following:
Obviously (to us), the solution to this problem is always the string that comprises all 1s. But the genetic algorithm does not have this knowledge, and needs to blindly look for this solution using its ...
Read now
Unlock full access