0 votes
Given all queens are in their own columns, and a move is defined as picking up a queen and moving to any other row in the same column, what is an admissible heuristic for this problem?

[We note that by the structure of the problem, we always have a queen in each column.]
in Informed Search by AlgoMeister (1.6k points)

2 Answers

+1 vote
  1. f(row): I count the number D of queens in each row. If D>1, then this row has conflicts and I record D-1 which means that D-1 queens have conflicts with the 1st queen in this row. If D<2, I record 0 which means that no conflict in this row. (I only consider the conflicts in the horizontal direction.)
  2. Admissible heuristic: Add the records in each row from the 1st row to the nth row. 
    Sum(f(row)) for all 1<= row <= n
by (128 points)
+1 vote
Amount of empty rows.

For example 4-queen problem.

1 0 0 0

0 1 1 1

0 0 0 0

0 0 0 0

Then h = 2;
by (148 points)

Related questions

The Book: Analysis and Design of Algorithms | Presentations on Slideshare | Lecture Notes, etc
...