Welcome to the N-Queens Visualizer! This project demonstrates the backtracking algorithm used to solve the N-Queens problem in real-time. The visualizer is built using HTML, CSS, and JavaScript.
The N-Queens problem involves placing N queens on an N×N chessboard so that no two queens threaten each other. This visualizer shows how the backtracking algorithm solves this problem step-by-step.
- Initialization: The visualizer sets up an N×N chessboard.
- Backtracking Algorithm: The core of the solution involves a recursive backtracking algorithm that attempts to place a queen in each row, ensuring that no two queens are in the same row, column, or diagonal.
- Real-Time Visualization: As the algorithm proceeds, the visualizer updates the board in real-time, showing each move and backtrack.
- Logs: Detailed logs display the moves and decisions made by the algorithm, helping users understand the process.
- Recursion: The algorithm uses recursion to explore all possible placements of queens.
- Backtracking: If placing a queen leads to a conflict, the algorithm backtracks and tries a different position.
- 🎨 Visual representation of the N-Queens problem
- ⏱️ Real-time visualization of the backtracking algorithm
- 🎛️ Interactive controls to start and observe the backtracking algorithm
- 📜 Logs displaying the moves played during the algorithm
You need a web browser to run this project.
Open index.html
in your preferred web browser, or visit the live version at (https://github.com/Tapas3341/N-Queens-Visualizer)
- Start: Begins the visualization of the backtracking algorithm
- Logs: Displays the moves played during the backtracking process
Contributions are welcome! If you have suggestions for improvements or find any issues, please open an issue or submit a pull request.
Made with ❤️ by Tapasendra Patra