All mock tests are FREE till 31 December — register to save your progress
Unit 7 · Data Structures and Algorithms Paper 2 CS · December 2019

When using Dijkstra's algorithm to find shortest path in a graph, which of the following statement is not true?

Pick an option to check yourself, or open the answer below.

Show answer & explanation

Correct answer: C. Shortest path always passes through least number of vertices

Explanation

Dijkstra finds the cheapest path, not the one with the fewest vertices, so C is false. It always visits the closest unvisited node next and needs non-negative weights.

More Data Structures and Algorithms questions