Which of the following algorithms finds the shortest path in a weighted graph with non-negative edge weights?
25 views
- Prim’s Algorithm
- Dijkstra’s Algorithm (Correct Answer)
- Depth-First Search
- Breadth-First Search
Explanation
Dijkstra’s Algorithm computes the shortest path from a source vertex to all other vertices in a graph with non-negative edge weights using a greedy approach.