Custom Layout:
     
Home Page

About Page

Contact Page

Custom Page

 

Explanation of the algorithm
.



 

 

 


It is a  classic problem of computer science, and is solved using the principle of Backtracking—a useful principle of Artificial Intelligence. The problem is to place n queens on an nXn chess-board, so that none of them can threaten each other in one move. The problem is solved as follows : Place a queen on the 1st row, 1st column. Don’t place a queen anywhere on the same row. On the next row, start placing the queen on the 1st column.If there is an attack, place it in the next column and so on till there is no attack from the previous queen(from the previous queens in the general case). Continue for all rows. If a queen cant be placed anywhere on a given row, and is thrown out of the last column, then backtrack to the previous row(this is indicated by a momentary red flash)and increase the column position of that previous queen by 1.Then follow the usual procedure.The algorithm halts when the 1st queen(i.e. of the first row)is thrown out, and there is no row upwards of it to backtrack to. This is when all the solutions are over.


 The user has to enter an integer number ,which is the size of the chess board. Eg: Enter 8 if you want to solve for an 8X8 chess-board. When a solution is obtained, all the queens halt, for the user to view the solution. The algorithm proceeds for the next solution when the user hits any key.


This is one of my favorite images
This is my good friend Hal. I took this picture on his birthday. I think he likes to be in pictures.


This is one of my favorite images
This is my good friend Hal. I took this picture on his birthday. I think he likes to be in pictures.