Counting How Many Queens Are Placed Tentatively
While Seeking A First Solution To The N x N Queens Puzzle.

For this example we'll use a 5 x 5 board because this size requires the fewest number of
tentative Queen placements (only 15) to reach the first solution to the puzzle.
A Queen shown in RED is obviously clashing with at least one previously-placed Queen.
It will be lifted off the board and set down again (or be "placed") in the next unoccupied square.
When a Queen is placed with no clashes on any row, we immediately move up to the next row.

We have FOUND the first possible solution to the 5 x 5 version of the N-Queens puzzle!
This example also shows that when placing Queens in this manner, no 'earlier' solutions can exist.

Fifth Queen  

Third Queen      

  Third Queen

Second Queen    
First Queen        
15 The 15th 'placement' of a Queen
results in this first solution to our puzzle.
5 Number of times a Queen was placed on the board,
and was allowed to stay.
10 Number of times a Queen was placed on the board, but was
clearly challenged by at least one previously-placed Queen.
Re-start this Example Go back one step

Queen-placement example page  15  of   15

Click  Return to my Home page to return to this site's Home page.

Document made with KompoZer Content on this CSP Queens site by Colin S Pearson and Martin S Pearson is licensed under a
Creative Commons Attribution-Non-Commercial-Share Alike 2.0 UK: England & Wales License.
Permissions beyond the scope of this license may be available via the feedback page.
Creative Commons License