Template Class AlgebraicBellmanFord

Inheritance Relationships

Base Type

Class Documentation

template<class Matrix>
class AlgebraicBellmanFord : public NetworKit::Algorithm

Implementation of the Bellman-Ford algorithm using the GraphBLAS interface.

Public Functions

inline AlgebraicBellmanFord(const Graph &graph, node source)

Construct an instance of the BellmanFord algorithm for the Graph graph and the given source node.

  • graph

  • source

~AlgebraicBellmanFord() = default

Default destructor

virtual void run()

Compute the shortest path from the source to all other nodes.

inline edgeweight distance(node t) const

Returns the distance from the source node to t.


t – Target node.


The distance from source to target node t.

inline bool hasNegativeCycle() const

True if there is a negative cycle present in the graph, otherwise false.