Open In App

ISRO | ISRO CS 2017 – May | Question 74

Like Article
Like
Save
Share
Report

Which of the following algorithm solves the all-pair shortest path problem?
(A) Prim’s algorithm
(B) Dijikstra’s algorithm
(C) Bellman-Ford’s algorithm
(D) Floyd-Warshall’s algorithm


Answer: (D)

Explanation: Prim’s Algorithm is used to find MST of a given graph. Refer: Prim’s Minimum Spanning Tree (MST)
Dijikstra’s Algorithm is used to find the shortest path from source to all the other nodes in a weighted graph. Refer: Dijkstra’s Algorithm
BellmanFord’s Algorithm is used to find the shortest distance from source to all other nodes in a graph that can contain negative weight edges. Refer:Bellman–Ford Algorithm
Floyd-Warshall’s Algorithm: It is an All-pair-shortest path algorithm, used to find shortest distance between every pair of vertices. Refer: Floyd Warshall Algorithm
So, option (D) is correct.

Quiz of this Question


Last Updated : 22 Sep, 2021
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads