Unformatted text preview: will necessarily compute an incorrect result for some δ (s, v ).
Solution: False. The negative-weight cycle has to be reachable from s. (k) T F [2 points] In a weighted directed graph G = (V, E, w) containing no zero- or
positive-weight cycles, Bellman-Ford can ﬁnd a longest (maximum-weight) path
from vertex s to vertex t.
(l) T F True. Negate the weights. [2 points] In a weighted directed graph G = (V, E, w) containing a negativeweight cycle, running the Bellman-Ford algorithm from s will ﬁnd a shortest
acyclic path from s to a given destination vertex t.
Solution: False. Bellman-Ford will terminate, and can detect the presence of
that negative-weight cycle, but it can’t “route around it.” (You could always
remove an edge to break the cycle and try again, though.) (m) T F [2 points] The bidirectional Dijkstra algorithm runs asymptotically faster than
the Dijkstra algorithm. 2 6.006 Quiz 2 Solutions Name Solution: False. The constant factor behind bidirectional Dijkstra is better, but
the worst-case running time is the same.
(n) T F [2 points] Given a weighted directed graph G = (V, E, w) and a shortest path p
from s to t, if we doubled the weight of eve...
View Full Document
This document was uploaded on 03/17/2014 for the course ELECTRICAL 6.006 at MIT.
- Fall '11