Visualgos: N Queens

Search this site:

This 8 Queens visualization shows an implementation of an iterative repair algorithm, a greedy algorithm and a simulated annealing algorithm.


In the N Queens puzzle you have an N by N chess board. On it you must place N queens so that no queen is threatening any other queen. Queens threaten any queen in the same row, column or diagonal.

There are many possible aglorithms for finding a valid placement of the N queens. The ones implemented here are: