GATE DA 2025 · Shortest Path Algorithms

MSQ · 2 marks · Problem PROG-DIVC-0061

Let \(G\) be a simple, unweighted, and undirected graph whose vertices include \(a, b, c, d, e, f, g, h\).It is given that \(a - b - c - d\) is a shortest path between \(a\) and \(d\); \(e - f - g - h\) is a shortest path between \(e\) and \(h\); and \(a - f - c - h\) is a shortest path between \(a\) and \(h\). Which of the following is/are NOT the edges of \(G\)?
  1. A
    (b, d)
  2. B
    (b, g)
  3. C
    (b, h)
  4. D
    (e, g)

Solve it on GATE DA practice →More Graph Theory & Algorithms problems

Show the worked solution\[\boxed{\text{An edge that creates a path shorter than a given shortest path cannot be in } G}\]Each of the three given shortest paths has length \(3\).(A) \((b,d)\) would give \(a-b-d\), of length \(2\), between \(a\) and \(d\). Not an edge.(B) \((b,g)\) gives no path shorter than \(3\) between \(a,d\), between \(e,h\) or between \(a,h\) (for example \(a-b-g-h\) has length \(3\)), so it can be an edge.(C) \((b,h)\) would give \(a-b-h\), of length \(2\), between \(a\) and \(h\). Not an edge.(D) \((e,g)\) would give \(e-g-h\), of length \(2\), between \(e\) and \(h\). Not an edge.Answer: A, C, D

GATE DA practice: past exam problems by chapter, with worked solutions · gatedaprep.com