This repository features a comprehensive implementation of backtracking algorithms to solve the N-Queens problem plus the visualization of the algorithm. The N-Queens problem involves placing N queens on an N×N chessboard such that no two queens can attack each other. This solution is designed to efficiently explore all possible configurations, demonstrating the power and elegance of backtracking in algorithm design. The code is well-documented and includes various examples for different values of N, making it a valuable resource for anyone studying algorithms, data structures, or preparing for technical interviews. Contributions and optimizations are welcome to enhance the repository further.
<------HOW TO RUN----->
Install python from officiall website.
Create new folder in the desktop.
Open cmd and cd into the folder then run "git clone https://github.com/andersonmaina/DSA-Backtracking-for-N-Queens.git"
Cd into the newly created folder.
Run the commands below.
python -u "path_to_your_folder\DSA-Backtracking-for-N-Queens\nqueens.py"
To see the visualization of the algorithm run the command below(You need to have tkinter python module installed, run 'python -m tkinter' to check if its present).
python -u "path_to_your_folder\DSA-Backtracking-for-N-Queens\visualizer.py"