Graph.Pathfindings.BellmanFord
(multigraph v0.16.1-mg.2)
Copy Markdown
The Bellman–Ford algorithm is an algorithm that computes shortest paths from a single source vertex to all of the other vertices in a weighted digraph. It is capable of handling graphs in which some of the edge weights are negative numbers Time complexity: O(VLogV)
Summary
Functions
@spec call(Graph.t(), Graph.vertex()) :: %{required(Graph.vertex()) => integer() | :infinity} | nil
Returns nil when graph has negative cycle.