283 views
5 votes
5 votes

Which of the following algorithm can be used to efficiently calculate single source shortest paths in a Directed Acyclic Graph where all edge weights are equal?

  1. Dijkstra's algorithm
  2. Bellman-Ford algorithm
  3. Topological Sort
  4. Prim's algorithm

1 Answer

Best answer
5 votes
5 votes
For a Directed Acyclic Graph Topological Sort can be done to find the shortest path in $\Theta(|V| + |E|)$ time which is better than the time complexities of Dijkstra's $(O(|V| \lg |V| + E)$ best known implementation with Fibonacci heap) and Bellman-Ford $(O(VE))$ .
selected by
Answer:

Related questions

4 votes
4 votes
1 answer
3
4 votes
4 votes
1 answer
4