Skip to content

πŸ‘‘ A visualisation tool written in Python (using Pygame) to solve the famous N-Queens problem.

Notifications You must be signed in to change notification settings

amritaravishankar/n_queens

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

21 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ‘‘ N-Queens

A visualisation tool written in Python (using Pygame) to solve the famous N-Queens problem.

Problem

The N Queen is the problem of placing N non-attacking chess queens on an NΓ—N chessboard so that no two queens attack each other. Solutions exist for all natural numbers other than n=2 and n=3.

Psuedocode

while there are untried configurations
{
   generate the next configuration
   if queens don't attack in this configuration then
   {
      print this configuration;
   }
}

Visualisation Tool

A screenshot of the tool in progress

The red boxes represent the spaces that cannot have a queen.

The tool's final outcome

Run the tool

To run the visualisation tool, type the following command in the terminal:

python backtracking.py

Reference

https://www.geeksforgeeks.org/n-queen-problem-backtracking-3/

About

πŸ‘‘ A visualisation tool written in Python (using Pygame) to solve the famous N-Queens problem.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages