StreakPeaked· Practice

ExamsGATETechnical

The Floyd-Warshall algorithm for all-pair shortest paths computation is based on

  1. Greedy paradigm.
  2. Divide-and-Conquer paradigm.
  3. Dynamic Programming paradigm.
  4. neither Greedy nor Divide-and-Conquer nor Dynamic Programming paradigm.

Correct answer: Dynamic Programming paradigm.

Solution

The Floyd-Warshall algorithm utilizes dynamic programming by systematically considering all pairs of vertices and updating the shortest path estimates based on previously computed paths, ensuring that all possible paths are evaluated efficiently.

Related GATE Technical questions

⚔️ Practice GATE Technical free + battle 1v1 →