• edited by
359 views
2 2 votes

Which of the following is/are TRUE?

  1. Dijkstra's algorithm may not terminate if the graph contains negative-weight edges.
  2. Given a graph $\text{G = (V, E)}$ with positive edge weights, the Bellman-Ford algorithm and Dijkstra's algorithm can produce different shortest-path trees despite always producing the same shortest-path weights.
  3. The Bellman-Ford algorithm applies to instances of the single-source shortest path problem which do not have a negative-weight directed cycle, but it does not detect the existence of a negative-weight directed cycle if there is one.
  4. On a connected, directed graph with only positive edge weights, Bellman-Ford runs asymptotically as fast as Dijkstra.

1 Answer

2 2 votes
  1. False.
    It always terminates after $\text{|E|}$ relaxations and $\text{|V| + |E|}$ priority queue operations, but may produce incorrect results.

    Source:  https://courses.csail.mit.edu/6.006/oldquizzes/solutions/quiz2-s2011-sol.pdf
     
  2. True. Both algorithms are guaranteed to produce the same shortest-path weight, but if there are multiple shortest paths, Dijkstra's will choose the shortest path according to the greedy strategy, and Bellman-Ford will choose the shortest path depending on the order of relaxations, and the two shortest path trees may be different.

    Source:  https://courses.csail.mit.edu/6.006/oldquizzes/solutions/quiz2-s2011-sol.pdf
     
  3. False. Bellman-Ford detects negative-weight directed cycles in its input graph if the cycle is reachable from the source.

    Source:  https://courses.csail.mit.edu/6.006/oldquizzes/solutions/final-s2008-sol-1.pdf

     
  4. False. Bellman-Ford requires $\Theta\text{(VE)}$, regardless of the edge weights. Dijkstra runs in $\Theta(\text{E + V} \lg \text{V})$. Because the graph is connected, $\text{E}=\Omega\text{(V)}$, so $\Theta\text{(VE)}=\Omega\left(\text{V}^2\right)$, which is clearly worse than Dijkstra.


    Source: https://courses.csail.mit.edu/6.006/oldquizzes/solutions/final-s2009-sol.pdf

Answer:
Position:
Show:

Related questions

1 1 vote
1 1 answer
234
234 views
GO Classes asked Oct 16, 2024
234 views
Let $\text{G = (V, E)}$ be a weighted directed graph. The shortest path from a node $s \in \text{V}$ to a node $t \in \text{V}$ will remain unchanged if: (Multiple option...
0 0 votes
2 2 answers
255
255 views
GO Classes asked Oct 16, 2024
255 views
Which of the following is/are TRUE ?If we perform DFS on an undirected graph, there are no cross edges.If the DFS tree has no back edges, then there are no cycles in the ...
0 0 votes
1 1 answer
234
234 views
GO Classes asked Oct 16, 2024
234 views
Consider the following directed, weighted graph:Even though the graph has negative weight edges, we use Dijkstra’s algorithm to calculate supposedly shortest paths from A...
3 3 votes
3 3 answers
676
676 views
GO Classes asked Oct 16, 2024
676 views
Consider the given graph $\text{G}.$ Traversal trees $\text{T1}$ and $\text{T2}$ (given below) are made by DFS or BFS traversals starting from s..Which of the following i...