#include <dfs.h>
GR | The graph type the algorithm runs on. |
Definition at line 47 of file dfs.h.
Public Types | |
typedef GR | Graph |
The type of the underlying graph. | |
typedef Graph::Node | Node |
| |
typedef Graph::NodeIt | NodeIt |
| |
typedef Graph::Edge | Edge |
| |
typedef Graph::OutEdgeIt | OutEdgeIt |
| |
typedef Graph::template NodeMap< Edge > | PredMap |
The type of the map that stores the last edges of the paths on the DFS tree. | |
typedef Graph::template NodeMap< Node > | PredNodeMap |
The type of the map that stores the last but one nodes of the paths on the DFS tree. | |
typedef Graph::template NodeMap< int > | DistMap |
The type of the map that stores the dists of the nodes on the DFS tree. | |
Public Member Functions | |
Dfs (const Graph &_G) | |
Constructor. | |
~Dfs () | |
Destructor. | |
Dfs & | setPredMap (PredMap &m) |
Sets the map storing the predecessor edges. | |
Dfs & | setPredNodeMap (PredNodeMap &m) |
Sets the map storing the predecessor nodes. | |
Dfs & | setDistMap (DistMap &m) |
Sets the map storing the distances calculated by the algorithm. | |
void | run (Node s) |
Runs DFS algorithm from node s . | |
int | dist (Node v) const |
The distance of a node from the root on the DFS tree. | |
Edge | pred (Node v) const |
Returns the 'previous edge' of the DFS path tree. | |
Node | predNode (Node v) const |
Returns the 'previous node' of the DFS tree. | |
const DistMap & | distMap () const |
Returns a reference to the NodeMap of distances on the DFS tree. | |
const PredMap & | predMap () const |
Returns a reference to the DFS tree map. | |
const PredNodeMap & | predNodeMap () const |
Returns a reference to the map of last but one nodes of the DFS tree. | |
bool | reached (Node v) |
Checks if a node is reachable from the root. |
|
References Dfs::Graph. |
|
Sets the map storing the predecessor edges. If you don't use this function before calling run(), it will allocate one. The destuctor deallocates this automatically allocated map, of course.
References Dfs::PredMap. |
|
Sets the map storing the predecessor nodes. If you don't use this function before calling run(), it will allocate one. The destuctor deallocates this automatically allocated map, of course.
References Dfs::PredNodeMap. |
|
Sets the map storing the distances calculated by the algorithm. If you don't use this function before calling run(), it will allocate one. The destuctor deallocates this automatically allocated map, of course.
References Dfs::DistMap. |
|
This method runs the DFS algorithm from a root node
References lemon::INVALID, Dfs::Node, Dfs::NodeIt, and Dfs::OutEdgeIt. |
|
Returns the distance of a node from the root on the DFS tree.
References Dfs::Node. |
|
For a node
|
|
For a node
References Dfs::Node. |
|
Returns a reference to the NodeMap of distances on the DFS tree.
References Dfs::DistMap. |
|
Returns a reference to the NodeMap of the edges of the DFS tree.
References Dfs::PredMap. |
|
Returns a reference to the NodeMap of the last but one nodes of the paths on the DFS tree.
References Dfs::PredNodeMap. |
|
Returns
References lemon::INVALID, and Dfs::Node. |