Difference between all pair shortest path and single source shortest path
Answers
Answered by
4
Dijkstra's Algorithm is one example of a single-source shortest or SSSP algorithm, i.e., given a source vertex it finds shortest path from source to allother vertices. Floyd Warshall Algorithm is an example of all-pairs shortest path algorithm, meaning it computes the shortest path between all pair of nodes.
Answered by
1
Answer:
We can find SSSP Using Bellman Ford algorithm and also by Dijkstra's algorithm whereas for finding APSP we use Floyd Warshall algorithm
The main difference b/w the two is that Dijkstra's algorithm doesn't work for negative edges in the graph but Floyd algo works for negative edges as well but won't work if any negative cycle is there in the graph
Explanation:
Similar questions
English,
8 months ago
Physics,
8 months ago
Business Studies,
1 year ago
English,
1 year ago
Biology,
1 year ago