Which algorithm uses the concept of "relaxation" for finding shortest paths ?
2026
Which algorithm uses the concept of "relaxation" for finding shortest paths ?
- A.
Kruskal's algorithm
- B.
Prim's algorithm
- C.
Dijkstra's algorithm
- D.
Topological sort
Attempted by 120 students.
Show answer & explanation
Correct answer: C
Dijkstra's algorithm uses relaxation to iteratively improve shortest path estimates. For each neighbor, it checks if a shorter path exists through the current node and updates distances accordingly.