IAE Academy

GATE 2025 DA Q.58: solution and answer

GATE 2025 · DAQ.58 · 2 marks · MSQ

Let be a simple, unweighted, and undirected graph. A subset of the vertices and edges of are shown below.

It is given that is a shortest path between and ; is a shortest path between and ; is a shortest path between and . Which of the following is/are NOT the edges of ?

GATE 2025 DA question 58: Eight vertices in two rows.Tap to open full size
Figure from the GATE 2025 DA paper. It is part of the question.
Figure description

Eight vertices in two rows. Top row left to right: a, b, c, d. Bottom row left to right: e, f, g, h. Drawn edges: a-b, b-c, c-d (top row path); e-f, f-g, g-h (bottom row path); diagonal a-f (from a down-right to f); diagonal c-f (from c down-left to f); diagonal c-h (from c down-right to h). No other edges are drawn.

  1. (A)

  2. (B)

  3. (C)

  4. (D)

Answer and solution

ANSWER

The edges that cannot be in are , and , so the answer is (A), (C), (D).

Official answer: A, C, DSource: Official answer key, GATE 2025 DA (IIT Roorkee)

  1. The figure shows the edges , , , , , , , and . In an unweighted graph the length of a path is its number of edges, and a path is a shortest path only if no edge of gives a shorter route between its end points.

  2. is a shortest path, so . If were an edge, would have length . So is NOT an edge of .

  3. is a shortest path, so . If were an edge, would have length . So is NOT an edge of .

  4. is a shortest path, so . If were an edge, would have length . So is NOT an edge of .

  5. Now test . Suppose it is added to the drawn edges. The route has length , which equals , so is still shortest. Any route from to that uses must first reach , which takes at least edges from ( or ), so it is longer than . Any route from to that uses must pass through and then reach only via , so it is longer than . All three given shortest-path conditions still hold, so is allowed to be an edge. It is not forced to be absent.

  6. Hence the pairs that are definitely NOT edges of are , and , which are options (A), (C) and (D).

KEY IDEA

In an unweighted graph a path is shortest only if no edge of the graph creates a shorter route between its end points. Each given shortest path therefore forbids every chord that would shorten it.

WATCH OUT FOR

Marking as a non-edge because it looks like a chord. It creates the route of length 3, which only ties and does not shorten any of the three given shortest paths, so it is allowed. Also forgetting that comes from the third path, which is what rules out .

From the GATE 2025 DA paper. Every question of this paper · Download the full paper · All 28 Graph algorithms questions, with notes

More Graph algorithms questions