6. [14 points] Shortest Path
Given the costs of edges in the following graph (note the negative-valued edges):
5
X
W
(a) Use the Bellman-Ford shortest path algorithm to find the shortest paths using the node t as the source. You may choose the order of iterating the edges in each pass. Show the d and n values after each pass and list the final shortest paths to each node and corresponding costs.
(b) If you apply Dijkstra's algorithm to find the shortest paths using the node t as the source in this graph, what are the weights of the shortest paths from t to every other node? Are the answers the same as (a) and why?