View Source Graph.Pathfindings.BellmanFord (hologram v0.2.0)
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
Returns nil when graph has negative cycle.
Functions
@spec call(Graph.t(), Graph.vertex()) :: %{required(Graph.vertex()) => integer() | :infinity} | nil
Returns nil when graph has negative cycle.