A Python implementation of the Genetic Algorithm to solve the classic 8-Queens problem.
- Custom fitness function
- Crossover and mutation
- Elitism strategy
- Visualization of solution and fitness over generations
- Population size: 100
- Mutation rate: 0.1
- Elitism: top 2 individuals retained
- Max generations: 1000
- Python
- NumPy
- Matplotlib
- Seaborn
-
Online option (recommended for quick start):
Use Google Colab:- Open the link
- Click on βUploadβ and add
main.py
- Run all cells directly in the browser
- No setup or installation needed
-
Local option:
- Clone the repository or download the files
- Install dependencies:
pip install -r requirements.txt
- Open the notebook using Jupyter and run all cells