# Eight Queens Problem

• 11-08-2012, 04:38 PM
Kareem Mesbah
Eight Queens Problem
I know I made it pretty complex :( but really I got tired of thinking how to solve this problem although I know what the algorithm is

the question is 7.24 (Eight Queens) Another puzzler for chess buffs is the Eight Queens problem, which asks the
following: Is it possible to place eight queens on an empty chessboard so that no queen is “attacking”
any other (i.e., no two queens are in the same row, in the same column or along the same diagonal)?
Use the thinking developed in Exercise 7.22 to formulate a heuristic for solving the Eight Queens
problem. Run your application. [Hint: It’s possible to assign a value to each square of the chessboard
to indicate how many squares of an empty chessboard are “eliminated” if a queen is placed in that
square. Each of the corners would be assigned the value 22, as demonstrated by Fig. 7.31. Once
these “elimination numbers” are placed in all 64 squares, an appropriate heuristic might be as follows:
Place the next queen in the square with the smallest elimination number. Why is this strategy
intuitively appealing?]

and this is the algorithm I am trying to use
http://docs.jboss.org/drools/release...gNQueens04.png

• 11-09-2012, 12:44 PM
Kareem Mesbah
Re: Eight Queens Problem
up.......
• 11-09-2012, 06:23 PM