States, Initial state, Successor function, Action, Goal test, and Path cost to formulate 8-Queens problem.
asked by MU in Nov-2019 examination
The 8-Queens problem can be defined as follows :
Place 8 queens on a (8 by 8) chess board such that none of the queen attack any of other.
States:
Any arrangement of 0 to 8 queens on the board.
Initial State:
No queen on the board.
Successor Function:
Add a queen to an empty field on the board.
Action:
Placing a queen on the board.
Goal Test:
8 queens on the board such that no queen attack another.
Path Cost:
0 (We are only interested in solution).
Theory:
- This problem can be solved by searching for a solution.
- This formulation as a search problem can be improved when we realize that, in any solution, there must be exactly one queen in each of the column.
- Thus, the possible action can be restricted to placing a queen in the next column that does not yet contain a queen. This reduces the branching factor from (initially) 64 to 8.
- Furthermost, we need to consider only those rows in the next column that are not already attacked by a queen that was previously on the board.
- This is because placing of further queens on the board can never remove the mutual attack and turn the configuration into a solution.
Comments
Post a Comment