BfsWizard< TR > Class Template Reference


Detailed Description

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

This class is created to make it easier to use Bfs algorithm. It uses the functions and features of the plain Bfs, but it is much simpler to use it.

Simplicity means that the way to change the types defined in the traits class is based on functions that returns the new class and not on templatable built-in classes. When using the plain Bfs the new class with the modified type comes from the original class by using the :: operator. In the case of BfsWizard only a function have to be called and it will return the needed class.

It does not have own run method. When its run method is called it initiates a plain Bfs class, and calls the Bfs::run method of it. #include <lemon/bfs.h>

List of all members.

Public Member Functions

 BfsWizard ()
 Constructor.
 BfsWizard (const Graph &g, Node s=INVALID)
 Constructor that requires parameters.
 BfsWizard (const TR &b)
 Copy constructor.
void run ()
 Runs Bfs algorithm from a given node.
void run (Node s)
 Runs Bfs algorithm from the given node.
template<class T >
BfsWizard< DefPredMapBase< T > > predMap (const T &t)
template<class T >
BfsWizard< DefReachedMapBase< T > > reachedMap (const T &t)
template<class T >
BfsWizard< DefProcessedMapBase
< T > > 
processedMap (const T &t)
template<class T >
BfsWizard< DefDistMapBase< T > > distMap (const T &t)
BfsWizard< TR > & source (Node s)
 Sets the source node, from which the Bfs algorithm runs.

Private Types

typedef TR::Graph Graph
 The type of the underlying graph.
typedef TR::ReachedMap ReachedMap
 The type of the map that stores the reached nodes.
typedef TR::ProcessedMap ProcessedMap
 The type of the map that stores the processed nodes.
typedef TR::PredMap PredMap
 The type of the map that stores the last edges of the shortest paths.
typedef TR::DistMap DistMap
 The type of the map that stores the dists of the nodes.


Constructor & Destructor Documentation

BfsWizard ( const Graph g,
Node  s = INVALID 
) [inline]

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


Member Function Documentation

void run (  )  [inline]

Runs Bfs algorithm from a given node. The node can be given by the source function.

void run ( Node  s  )  [inline]

Runs Bfs algorithm from the given node.

Parameters:
s is the given source.

BfsWizard<DefPredMapBase<T> > predMap ( const T &  t  )  [inline]

Named parameter function for setting PredMap

BfsWizard<DefReachedMapBase<T> > reachedMap ( const T &  t  )  [inline]

Named parameter function for setting ReachedMap

BfsWizard<DefProcessedMapBase<T> > processedMap ( const T &  t  )  [inline]

Named parameter function for setting ProcessedMap

BfsWizard<DefDistMapBase<T> > distMap ( const T &  t  )  [inline]

Named parameter function for setting DistMap type

BfsWizard<TR>& source ( Node  s  )  [inline]

Sets the source node, from which the Bfs algorithm runs.

Parameters:
s is the source node.


Generated on Thu Jun 4 04:03:28 2009 for LEMON by  doxygen 1.5.9