GATE DA 2025 | Question 44
The state graph shows the action cost along the edges and the heuristic function h associated with each state.

Suppose \(A^{*}\) algorithm is applied on this state graph using priority queue to store the frontier. In what sequence are the nodes expanded?
Explanation
Answer: (C)
A* always expands the frontier node with the smallest \(f = g + h\), where \(g\) is the path cost from S.
- Expand S: frontier A (\(4 + 2 = 6\)) and E (\(1 + 6 = 7\)).
- Expand A (6): add B (\(6 + 2 = 8\)).
- Expand E (7): add C (\(3 + 6 = 9\)).
- Expand B (8): reaching C through B costs 8, worse than 3, so C keeps \(f = 9\).
- Expand C (9): add D (\(6 + 2 = 8\)).
- Expand D (8): add G (\(9 + 0 = 9\)), and finally expand G.
The order is S, A, E, B, C, D, G. Option A expands C (9) before B (8), and ordering by \(h\) alone would put B before E, as in option D.
Answer: C