IAE Academy

GATE 2025 DA Q.44: solution and answer

GATE 2025 · DAQ.44 · 2 marks · MCQ

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?

GATE 2025 DA question 44: Directed graph.Tap to open full size
Figure from the GATE 2025 DA paper. It is part of the question.
Figure description

Directed graph. Edges with costs: S->A (4), S->E (1), A->B (2), B->C (2), E->C (2), C->D (3), D->G (3). Heuristic values in boxes: A h=2, B h=2, C h=6, D h=2, G h=0, E h=6. S has no heuristic printed. S is the start and G the goal.

  1. (A)

    S,A,E,C,B,D,G

  2. (B)

    S,E,A,C,B,D,G

  3. (C)

    S,A,E,B,C,D,G

  4. (D)

    S,A,B,E,C,D,G

Answer and solution

ANSWER

The nodes are expanded in the order S, A, E, B, C, D, G, which is option (C).

Official answer: CSource: Official answer key, GATE 2025 DA (IIT Roorkee)

  1. A* always expands the frontier node with the smallest , where is the cheapest path cost found so far from and is the printed heuristic. Edge costs: , , , , , , .

  2. Expand . Its successors enter the frontier: with , , and with , .

  3. The smallest is (6), so expand . Push with , . Frontier: , .

  4. The smallest is (7), so expand . Push with , . Frontier: , .

  5. The smallest is (8), so expand . It reaches with , . This is worse than the existing entry for (, ), so the entry is kept. Frontier: .

  6. Expand . Push with , .

  7. Expand (8). Push with , .

  8. Expand , the goal. The expansion order is , which is option (C). No ties occurred, so no tie-break rule was needed.

KEY IDEA

A* orders the frontier by , not by alone and not by alone. Keep, for each node, the cheapest found so far, and discard a later path that is costlier.

WATCH OUT FOR

Expanding before because is cheaper to reach ( against ). That ignores : is larger than . Another slip is expanding before . is reached early through , but its is larger than .

From the GATE 2025 DA paper. Every question of this paper · Download the full paper · All 7 Search questions, with notes

More Search questions