Loading...
Searching...
No Matches
DfsWizard< TR > Class Template Reference

## Detailed Description

template<class TR>
class lemon::DfsWizard< TR >

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

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

Template Parameters

  TR | The traits class that defines various types used by the algorithm.

`#include <lemon/dfs.h>`

## Public Member Functions

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

## Constructor & Destructor Documentation

## DfsWizard()

template<class TR>

DfsWizard | ( | const Digraph & | g | ) |

inline

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

Parameters

  g | The digraph the algorithm runs on.

## Member Function Documentation

## run() [1/3]

template<class TR>

void run | ( | Node | s | ) |

inline

This method runs DFS algorithm from node `s` in order to compute the DFS path to each node.

## run() [2/3]

template<class TR>

bool run | ( | Node | s,
|  | Node | t )

inline

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

Returns
  `true` if `t` is reachable form `s`.

## run() [3/3]

template<class TR>

void run | ( |  | ) |

inline

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

## predMap()

template<class TR>
template<class T>

DfsWizard< SetPredMapBase< T > > predMap | ( | const T & | t | ) |

inline

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

## reachedMap()

template<class TR>
template<class T>

DfsWizard< SetReachedMapBase< T > > reachedMap | ( | const T & | t | ) |

inline

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

## distMap()

template<class TR>
template<class T>

DfsWizard< 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.

## processedMap()

template<class TR>
template<class T>

DfsWizard< SetProcessedMapBase< T > > processedMap | ( | const T & | t | ) |

inline

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

## path()

template<class TR>
template<class T>

DfsWizard< SetPathBase< T > > path | ( | const T & | t | ) |

inline

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

## dist()

template<class TR>

DfsWizard dist | ( | const int & | d | ) |

inline

Named parameter for getting the distance of the target node.