Genetic algorithms solution

To solve the N-Queens problem using a genetic algorithm, we created the Python program, which is located at

Since the solution representation we chose for this problem is a list (or an array) of indices, which is similar to the representation we used for the traveling salesman problem (TSP) and the vehicle routing problem (VRP) in Chapter 4, Combinatorial Optimization, we were able to utilize a similar genetic approach, just like we did there. In addition, we take advantage of elitism once more by reusing the elitist version that we created for DEAP's simple genetic flow. ...

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

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.