/n-queens

N-Queens solver and visualization of permutation process to find solutions.

Primary LanguageJavaScriptMIT LicenseMIT

N-Queens

N-Queens solver and visualization of permutation process to find solutions. This code uses 8 x 8 Board, but can be used with any number from 2 to 8 or more. Be careful of Time Complexity for n > 8.

// n is hard coded as 8
const board = new Board(8);
board.start();

The code uses Pseudoclassical pattern, and the algorithm uses Recusrsion, Permutation and Backtracking to speed up the process.

GIF Visualization Preview

Visualization of permutation and backtracking:

GIF Visualization Preview

License

This is a MIT License, see License file for more. And personally, anyone can use it for any imaginable use case, even making money, distruting it any how, it's not a concern for me.