Back to the OneMax problem
In Chapter 3, Using the DEAP Framework, we utilized the OneMax problem as the “Hello World” of genetic algorithms. As a quick recap, the objective is to discover the binary string of a specified length that maximizes the sum of its digits. For instance, when dealing with a OneMax problem of length 5, candidate solutions such as 10010 (sum of digits = 2) and 01110 (sum of digits = 3) are considered, ultimately leading to the optimal solution of 11111 (sum of digits = 5).
While, in Chapter 3, we used a problem length of 100, a population size of 200, and 50 generations, here we will tackle a significantly scaled-down version, having a length of 10, a population size of 20, and only 5 generations. The reasons for this adjustment will become apparent shortly.
A baseline benchmark program
The initial version of this Python program is 01_one_max_start.py
, available at https://github.com/PacktPublishing/Hands-On-Genetic-Algorithms-with-Python...