Path.BellmanFordmodule W : Sig.WEIGHT with type edge = G.E.texception NegativeCycle of G.E.t listshortest_path g vs computes the distances of shortest paths from vertex vs to all other vertices in graph g. They are returned as a hash table mapping each vertex reachable from vs to its distance from vs. If g contains a negative-length cycle reachable from vs, raises NegativeCycle l where l is such a cycle.
Complexity: at most O(VE)
find_negative_cycle_from g vs looks for a negative-length cycle in graph g that is reachable from vertex vs and returns it as a list of edges. If no such a cycle exists, raises Not_found.
Complexity: at most O(VE).