number
of queens:  

number of
free fields:    
  
by mouseclick
automatically
delay (in ms)
  



Backtracking:  The Eight Queens Problem   (JavaScript required)

Place eight queens on the chessboard such that no queen attacks any other one.

A mouseclick on any empty field of the chessboard puts a queen into this field.

The last placed queen is marked green and can be removed by mouseclick ("backtracking").

After activation of the option "automatically" a (very simple) backtracking algorithm will run down for search of a solution. It may be interrupted by activation of the option "by mouseclick". The algorithm ends When a solution is found (or - if queens were posed improperly - with an empty board), and in that case a search for another solution may be continued with the button "new solution". The delay (in milliseconds) regulates the frequency of the image output.

H. B. Meyer)       find your own solution       n queens problem

   
eXTReMe Tracker