Skip to content

NikTsiop/QueensProblem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

N-Queens Problem Solution using Hill Climbing

Overview

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.

Requirements

  • Python 3.x

Installation

  1. Clone the Repository:

    git clone https://github.com/NikTsiop/QueensProblem.git
    cd QueensProblem
  2. (Optional) Create a Virtual Environment:

    python -m venv venv
  3. Activate the Virtual Environment:

    • On Windows:
      venv\Scripts\activate
    • On macOS/Linux:
      source venv/bin/activate
  4. Install Required Packages:

    pip install -r requirements.txt

Usage

Run the script with the following command:

python queens_problem.py

This will execute the Hill Climbing algorithm to find a solution to the N-Queens problem.

Features

  • 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.

License

This project is licensed under the Apache License 2.0.

Author

Developed by NikTsiop.

About

For 4 queens: we want to put 4 queens on a 4x4 chessboard so that none of them threatens the other. Using Hill-Climbing and other optimization methods.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages