This project implements the Hill Climbing algorithm to solve the N-Queens problem, where the objective is to place N queens on an N×N chessboard such that no two queens threaten each other. The solution includes variations of the algorithm and performance evaluations for different board sizes.
- Python 3.x
-
Clone the Repository:
git clone https://github.com/NikTsiop/QueensProblem.git cd QueensProblem -
(Optional) Create a Virtual Environment:
python -m venv venv
-
Activate the Virtual Environment:
- On Windows:
venv\Scripts\activate
- On macOS/Linux:
source venv/bin/activate
- On Windows:
-
Install Required Packages:
pip install -r requirements.txt
Run the script with the following command:
python queens_problem.pyThis will execute the Hill Climbing algorithm to find a solution to the N-Queens problem.
- Hill Climbing Algorithm: Implements the basic Hill Climbing algorithm to find solutions for the N-Queens problem.
- Lateral Moves: Includes a variation of the algorithm that allows lateral moves to escape local maxima.
- Performance Evaluation: Provides performance metrics and evaluations for different board sizes to analyze the efficiency of the algorithm.
This project is licensed under the Apache License 2.0.
Developed by NikTsiop.