Genetic algorithms solution

To solve the nurse scheduling problem using a genetic algorithm, we created the Python program called, which is located at

Since the solution representation we chose for this problem is a list (or an array) of binary values, we were able to use the same genetic approach we used for several problems we have solved already, such as the 0-1 knapsack problem we described in Chapter 4, Combinatorial Optimization.

The main parts of our solution are described in the following steps:

  1. Our program starts by creating an instance of the NurseSchedulingProblem class with the desired value ...

Get Hands-On Genetic Algorithms with Python now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.