All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
List of all members | Public Member Functions
BfsWizard< TR > Class Template Reference

Detailed Description

template<class TR>
class lemon::BfsWizard< TR >

This auxiliary class is created to implement the function-type interface of Bfs algorithm. It does not have own run() method, it uses the functions and features of the plain Bfs.

This class should only be used through the bfs() function, which makes it easier to use the algorithm.

Template Parameters
TRThe traits class that defines various types used by the algorithm.

#include <lemon/bfs.h>

Inherits TR.

Public Member Functions

 BfsWizard ()
 Constructor.
 
 BfsWizard (const Digraph &g)
 Constructor that requires parameters. More...
 
 BfsWizard (const TR &b)
 Copy constructor.
 
void run (Node s)
 Runs BFS algorithm from the given source node. More...
 
bool run (Node s, Node t)
 Finds the shortest path between s and t. More...
 
void run ()
 Runs BFS algorithm to visit all nodes in the digraph. More...
 
template<class T >
BfsWizard< SetPredMapBase< T > > predMap (const T &t)
 Named parameter for setting the predecessor map. More...
 
template<class T >
BfsWizard< SetReachedMapBase< T > > reachedMap (const T &t)
 Named parameter for setting the reached map. More...
 
template<class T >
BfsWizard< SetDistMapBase< T > > distMap (const T &t)
 Named parameter for setting the distance map. More...
 
template<class T >
BfsWizard< SetProcessedMapBase
< T > > 
processedMap (const T &t)
 Named parameter for setting the processed map. More...
 
template<class T >
BfsWizard< SetPathBase< T > > path (const T &t)
 Named parameter for getting the shortest path to the target node. More...
 
BfsWizard dist (const int &d)
 Named parameter for getting the distance of the target node. More...
 

Constructor & Destructor Documentation

BfsWizard ( const Digraph &  g)
inline

Constructor that requires parameters. These parameters will be the default values for the traits class.

Parameters
gThe digraph the algorithm runs on.

Member Function Documentation

void run ( Node  s)
inline

This method runs BFS algorithm from node s in order to compute the shortest path to each node.

bool run ( Node  s,
Node  t 
)
inline

This method runs BFS algorithm from node s in order to compute the shortest path to node t (it stops searching when t is processed).

Returns
true if t is reachable form s.
void run ( )
inline

This method runs BFS algorithm in order to visit all nodes in the digraph.

BfsWizard<SetPredMapBase<T> > predMap ( const T &  t)
inline

Named parameter function for setting the map that stores the predecessor arcs of the nodes.

BfsWizard<SetReachedMapBase<T> > reachedMap ( const T &  t)
inline

Named parameter function for setting the map that indicates which nodes are reached.

BfsWizard<SetDistMapBase<T> > distMap ( const T &  t)
inline

Named parameter function for setting the map that stores the distances of the nodes calculated by the algorithm.

BfsWizard<SetProcessedMapBase<T> > processedMap ( const T &  t)
inline

Named parameter function for setting the map that indicates which nodes are processed.

BfsWizard<SetPathBase<T> > path ( const T &  t)
inline

Named parameter for getting the shortest path to the target node.

BfsWizard dist ( const int &  d)
inline

Named parameter for getting the distance of the target node.