Q.Which of the following algorithms solves the all-pairs shortest path problem?
Correct answer: Floyd's algorithm
Explanation
The floyd - Warshall algorithm (also known as floyd's algorithm) is an algorithm for finding shortest paths in a directed weighted graph with positive or negative (or zero) edge weights (but with no negative cycles). It is used to solve the all - pairs shortest path problem.
The floyd - Warshall algorithm (also known as floyd's algorithm) is an algorithm for finding shortest paths in a directed weighted graph with positive or negative (or zero) edge weights (but with no negative cycles). It is used to solve the all - pairs shortest path problem.