Making Heuristic State Space Search Optimal

A: One is deeper in the tree than the other.

Recall that h(s) is the heuristic value for any state s in the search tree.

Let d(s) be the depth of s in the search tree. Recall that this depth, or the distance of a vertex from the start, is calculated and stored in each vertex by the state space search algorithm.

If we order the priority queue by the key value h(s) + d(s), state J-as-a-descendant-of-C will be removed from the priority queue before state J-as-a-descendant-of-B, and the shorter path will be found first.