GATE CS 2012 · Question 40 · Algorithms · Multiple choice (MCQ) · 2 marks · −2/3 for a wrong answer

Consider the directed graph shown in the figure below. There are multiple shortest paths between vertices S and T. Which one will be reported by Dijkstra's shortest path algorithm? Assume that, in any iteration, the shortest path to a vertex v is updated only when a strictly shorter path to v is discovered.

Directed weighted graph with vertices S, A, B, C, D, E, F, G, T. Directed edges with weights: S→A (4), A→C (1), C→E (1), C→D (3), S→D (7), S→B (3), B→S (3, curved edge with arrowhead at S), B→D (4), D→E (1), D→T (3), D→F (5), E→G (2, curved edge with arrowhead at G), G→E (2), E→T (4), G→T (3), T→F (5).
  1. (A) SDT
  2. (B) SBDT
  3. (C) SACDT
  4. (D) SACET
Answer

Answer (D)

Answer from the official GATE CS 2012 answer key.

The step-by-step solution, where available, is part of GATE CS Pro. See what Pro includes