Exercise 11

May 7, 2018 ยท View on GitHub

"Inspired" by the code of OnePlusOneEAForKnapsack and HillClimbingForQueens, write a (1+1)EA implementation OnePlusOneEAForQueens for the Queens problem. Make particular attention on how to implement the mutation operator, as you cannot use a simple bit flip.

Write a test suite OnePlusOneEAForQueensTest similarly to what done in QueensProblemTest for the HC algorithm, i.e., write tests for boards of followings sizes: 8, 16, 20 and 100. If your implementation of (1+1)EA is correct, those board sizes should be very quick to solve.

Solutions

Solutions to this exercise can be found in the solutions module, under the org.pg4200.sol11 package.