Examveda

In which case is the Floyd-Warshall algorithm preferred?

A. When finding shortest paths between all pairs of nodes.

B. When finding the shortest path from a single source.

C. When the graph is sparse.

D. When edge weights are all positive.

Answer: Option A


Join The Discussion

Related Questions on Graph Algorithms (DFS, BFS, Dijkstras, etc)