N-Queen Solver

UNITY

N-Queen Solver

A multithreaded N-Queen solver visualized in Unity.

Overview

A multithreaded N-Queens solver built in Unity, which implements parallel backtracking-based algorithms and visualizes the solution on an interactive 3D chessboard.

Solving Approach

The N-Queens problem consists of placing N queens on an NxN chessboard such that no two queens are attacking each other. For this project, I implemented two different algorithms: • A backtracking algorithm. • A systematic search + greedy heuristics. Both algorithms were implemented in a multithreaded manner, running N threads for an NxN board to explore the solution space in parallel. This is also why a WebGL build was not possible.

Visualization & Interaction

When the solver starts, a loading bar displays the estimated progress. Once a solution is found, it is rendered on a 3D chessboard. The camera can be moved and zoomed freely. You can also click on a queen to highlight the tiles it attacks, allowing you to verify that no two queens are attacking each other.

Tags

UnityMultithreadingC#