Pathfindings.BellmanFord (libgraph v0.16.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)

Link to this section Summary

Functions

Returns nil when graph has negative cycle.

Link to this section Types

@type distance() :: %{required(Graph.vertex_id()) => integer()}

Link to this section Functions

@spec call(Graph.t(), Graph.vertex()) :: [Graph.vertex()] | nil

Returns nil when graph has negative cycle.