Which one of the following algorithm design techniques is used in finding all…
2008
Which one of the following algorithm design techniques is used in finding all pairs of shortest distances in a graph?
Answer: A. Dynamic programming — The Floyd-Warshall algorithm is the standard approach for finding all-pairs shortest paths in a weighted graph. It operates using dynamic programming by…
- A.
Dynamic programming
- B.
Backtracking
- C.
Greedy
- D.
Divide and Conquer
Attempted by 533 students.
Show answer & explanation
Correct answer: A
The Floyd-Warshall algorithm is the standard approach for finding all-pairs shortest paths in a weighted graph. It operates using dynamic programming by iteratively improving path estimates through intermediate vertices. Unlike greedy algorithms (like Dijkstra) which typically handle single-source paths, or backtracking methods used for constraint satisfaction, dynamic programming is the core technique here.
Explore the full course: Iocl Engineers Officers Grade A Paper 2