BellmanFordWizard
Declared in lemon/bellman_ford.h, in the group Shortest Path Algorithms; the same class on the Doxygen site.
-
template< class TR >
class BellmanFordWizard : public TR Auxiliary class for the function-type interface of the Bellman-Ford algorithm.
This auxiliary class is created to implement the function-type interface of the Bellman-Ford algorithm. It does not have own run() method, it uses the functions and features of the plain BellmanFord.
This class should only be used through the bellmanFord() function, which makes it easier to use the algorithm.
- Template Parameters:
TR – The traits class that defines various types used by the algorithm.
Public Functions
-
inline BellmanFordWizard()
Constructor.
-
inline BellmanFordWizard( const Digraph & gr , const LengthMap & len )
Constructor that requires parameters. These parameters will be the default values for the traits class.
- Parameters:
gr – The digraph the algorithm runs on.
len – The length map.
-
inline void run( Node s )
Runs the Bellman-Ford algorithm from the given source node.
This method runs the Bellman-Ford algorithm from the given source node in order to compute the shortest path to each node.
-
inline bool run( Node s , Node t )
Runs the Bellman-Ford algorithm to find the shortest path between
sandt.This method runs the Bellman-Ford algorithm from node
sin order to compute the shortest path to nodet. Actually, it computes the shortest path to each node, but using this function you can retrieve the distance and the shortest path for a single target node easier.- Returns:
trueiftis reachable forms.
-
template< class T >
inline BellmanFordWizard< SetPredMapBase< T > > predMap( const T & t ) Named parameter for setting the predecessor map.
Named parameter for setting the map that stores the predecessor arcs of the nodes.
-
template< class T >
inline BellmanFordWizard< SetDistMapBase< T > > distMap( const T & t ) Named parameter for setting the distance map.
Named parameter for setting the map that stores the distances of the nodes calculated by the algorithm.
-
template< class T >
inline BellmanFordWizard< SetPathBase< T > > path( const T & t ) Named parameter for getting the shortest path to the target node.
-
inline BellmanFordWizard dist( const Value & d )
Named parameter for getting the distance of the target node.
-
template< class T >
struct SetPredMapBase : public Base
-
template< class T >
struct SetDistMapBase : public Base
-
template< class T >
struct SetPathBase : public Base