$30
General Instruction
• Submit uncompressed file(s) in the Dropbox folder via BeachBoard (Not email).
1. Implement 5-queens problem solvers with Python 3 by using the hill-climbing algorithm and the genetic algorithm.
(a) (30 points) Implement a program that performs the Hill-Climbing algorithm to find a solution.
(b) (30 points) Implement a program that performs the Genetic algorithm with 8 states including the three operations, i.e., selection, crossover, mutation to find a solution.
Program specification.
i. Find the board.py. You can modify the Board class.
ii. The function fitness in the board.py returns the number of attacking pairs.
iii. Sometimes the algorithms can stuck in local minima. Please implement the randomrestart procedure when they stuck.
iv. Please measure the running time and the number of restart.
v. An expected output.
Running time: 200ms
# of restart: 1
1 - - - -
- - - 1 -
- 1 - - -
- - - - 1
- - 1 - -
vi. Submit hill.ipynb, genetic.ipynb, and board.py.