The repository contains two files:-
1. Genetic_Algo.py: This file contains the complete python code which can we used to run both
the naive and the improved version of the Genetic Algorithm for the Eight Queens Problem.
2. Report.pdf: This file contains a brief introduction about the problem, implemenataion details
and the improvements along with the possible reasons. It also contains a short ananlysis
of the results obtained.
The code requires the following libraries to be installed. Please run the following snippet in the terminal if not already installed.
>>> pip3 install numpy
>>> pip3 install matplotlib
Run the code by simply navigating to the folder and running the following command:-
>>> python3 Genetic_Algo.py
The code will output the best fitness value for all generations for the given problem. In the end, the graph is plotted for comparison of the textbook version and the improved version. The part for the average performance for multiple runs of the algorithms is commented part in both the functions. The part could be uncommented to analyse the average performance of the algorithms.
Note:- The Textbook version of the algorithm being talked about in the report comes from the book titled 'Artificial Intelligence A Modern Approach, Third Edition' by 'Stuart J. Russell' and 'Peter Norvig'. The pdf can be found easily on the internet.
Contact at agarwalrohan189@gmail.com for any clarifications or discussion on some more improvement ideas.