madeeasy
closed

closed by
355 views
1 votes
1 votes

Consider the following statements with respect to a directed graph G in which edges can have positive or negative edge length but that has no negative cycles:

  • S1  : The Bellman-Ford algorithm correctly computes shortest path lengths from a given origin ‘s’ to every other vertex ‘v ’.
  • S2 : The Floyd-Warshall algorithm correctly computes shortest path lengths between every pair of vertices.

Which of the following is correct?

closed by

1 Answer

0 votes
0 votes
I think S2 is correct only because if the graph is disconnected you can't apply bellman ford into it but you can apply Floyd Warshall algorithm into it. Please correct me if I am wrong

Related questions

1 votes
1 votes
1 answer
3
Souvik33 asked Dec 19, 2022
675 views
If a -ve weight cycle is reachable from source, the Dijkstra's algorithm gets into an infinite loop TRUEFALSE