As long as all the edge weights are nonnegative, the shortest-paths tree is well defined. Unfortunately,
things get somewhat complicated in the presence of negative edge weights. For an
undirected graph, a long path gets “shorter” when we repeatedly add an edge with negative weight
to it. In this situation, a shortest path that contains an edge with negative weight is not well defined
since a lesser-weight path can always be found by going back and forth on the negative-weight
edge. Consider the graph in Figure 4. In this graph, edge (d; e) is of negative weight. Since, for an
undirected graph, an edge can be traversed in both directions, a path that repeatedly uses (d; e) will
reduce its length. However, for a directed graph, as long as there exists no negative-weight cycle
reachable from the source, the shortest-path weights are well defined. Thus when talking about the