Which of the following is a limitation of Dijkstra's algorithm?

Practice Questions

Q1
Which of the following is a limitation of Dijkstra's algorithm?
  1. It cannot handle negative weight edges
  2. It is not efficient for dense graphs
  3. It cannot find paths in directed graphs
  4. It requires a complete graph

Questions & Step-by-Step Solutions

Which of the following is a limitation of Dijkstra's algorithm?
  • Step 1: Understand what Dijkstra's algorithm is. It is a method used to find the shortest path from one point to another in a graph.
  • Step 2: Know that a graph is made up of nodes (points) and edges (connections between points).
  • Step 3: Recognize that edges can have weights, which represent the cost or distance to travel from one node to another.
  • Step 4: Learn that Dijkstra's algorithm works well when all edge weights are positive (greater than zero).
  • Step 5: Identify the limitation: Dijkstra's algorithm cannot correctly handle edges that have negative weights (less than zero).
  • Step 6: Understand that if a graph has negative weight edges, Dijkstra's algorithm may give incorrect shortest path results.
No concepts available.
Soulshift Feedback ×

On a scale of 0–10, how likely are you to recommend The Soulshift Academy?

Not likely Very likely