All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
NetworKit::AlgebraicBellmanFord< Matrix > Class Template Reference

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

#include <AlgebraicBellmanFord.h>

Public Member Functions

 AlgebraicBellmanFord (const Graph &graph, node source)
 Construct an instance of the BellmanFord algorithm for the Graph graph and the given source node. More...
 
 ~AlgebraicBellmanFord ()=default
 Default destructor. More...
 
void run ()
 Compute the shortest path from the source to all other nodes. More...
 
edgeweight distance (node t) const
 Returns the distance from the source node to t. More...
 
bool hasNegativeCycle () const
 
- Public Member Functions inherited from NetworKit::Algorithm
 Algorithm ()
 Constructor to the algorithm base class. More...
 
virtual ~Algorithm ()=default
 Virtual default destructor. More...
 
bool hasFinished () const
 Indicates whether an algorithm has completed computation or not. More...
 
void assureFinished () const
 Assure that the algorithm has been run, throws a std::runtime_error otherwise. More...
 
virtual std::string toString () const
 Returns a string with the algorithm's name and its parameters, if there are any. More...
 
virtual bool isParallel () const
 

Additional Inherited Members

- Protected Attributes inherited from NetworKit::Algorithm
bool hasRun
 A boolean variable indicating whether an algorithm has finished its computation or not. More...
 

Detailed Description

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

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

Constructor & Destructor Documentation

template<class Matrix >
NetworKit::AlgebraicBellmanFord< Matrix >::AlgebraicBellmanFord ( const Graph graph,
node  source 
)
inline

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

Parameters
graph
source
template<class Matrix >
NetworKit::AlgebraicBellmanFord< Matrix >::~AlgebraicBellmanFord ( )
default

Default destructor.

Member Function Documentation

template<class Matrix >
edgeweight NetworKit::AlgebraicBellmanFord< Matrix >::distance ( node  t) const
inline

Returns the distance from the source node to t.

Parameters
tTarget node.
Returns
The distance from source to target node t.
template<class Matrix >
bool NetworKit::AlgebraicBellmanFord< Matrix >::hasNegativeCycle ( ) const
inline
Returns
True if there is a negative cycle present in the graph, otherwise false.
template<class Matrix >
void NetworKit::AlgebraicBellmanFord< Matrix >::run ( )
virtual

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

Implements NetworKit::Algorithm.


The documentation for this class was generated from the following file: