UGC-NET Jun 2019 · Shortest Path Algorithms

MCQ · 2 marks · Problem PROG-GRPH-0007

Match List-I with List-II:$$\begin{array}{|c|c|c|c|} \hline {} & \text{List-I} & {} & \text{List-II} \\ \hline (a) & \text{Prim’s algorithm} & (i) & O(V^3 \log V) \\ \hline (b) & \text{Dijkstra’s algorithm} & (ii) & O(VE^2) \\ \hline (c) & \text{Faster all-pairs shortest path} & (iii) & O(ElgV) \\ \hline (d) & \text{Edmonds-Karp algorithm} & (iv) & O(V^2) \\ \hline \end{array}$$Choose the correct option from those options given below:
  1. A
    (a) – (ii); (b)-(iv); (c)-(i); (d)-(iii)
  2. B
    (a) – (iii); (b)-(iv); (c)-(i); (d)-(ii)
  3. C
    (a) – (ii); (b)-(i); (c)-(iv); (d)-(iii)
  4. D
    (a) – (iii); (b)-(i); (c)-(iv); (d)-(ii)

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

Show the worked solution(a) Prim's algorithm with a binary heap: \(O(E\lg V)\), so (a)-(iii).(b) Dijkstra's algorithm with an array (no heap): \(V\) extract-mins of \(O(V)\) each, \(O(V^2)\), so (b)-(iv).(c) Faster all-pairs shortest paths by repeated squaring of the weight matrix: \(\lg V\) products of \(O(V^3)\), \(O(V^3\lg V)\), so (c)-(i).(d) Edmonds-Karp (BFS augmenting paths): \(O(VE)\) augmentations of \(O(E)\) each, \(O(VE^2)\), so (d)-(ii).The code (a)-(iii), (b)-(iv), (c)-(i), (d)-(ii) is option B.Answer: B

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