|
Public Types |
typedef TR::Graph | Graph |
| The type of the underlying graph.
|
typedef Graph::Node | Node |
|
|
typedef Graph::NodeIt | NodeIt |
|
|
typedef Graph::Edge | Edge |
|
|
typedef Graph::OutEdgeIt | OutEdgeIt |
|
|
typedef TR::PredMap | PredMap |
| The type of the map that stores the last edges of the DFS paths.
|
typedef TR::ReachedMap | ReachedMap |
| The type of the map indicating which nodes are reached.
|
typedef TR::ProcessedMap | ProcessedMap |
| The type of the map indicating which nodes are processed.
|
typedef TR::DistMap | DistMap |
| The type of the map that stores the dists of the nodes.
|
Public Member Functions |
| Dfs (const Graph &_G) |
| Constructor.
|
| ~Dfs () |
| Destructor.
|
Dfs & | predMap (PredMap &m) |
| Sets the map storing the predecessor edges.
|
Dfs & | distMap (DistMap &m) |
| Sets the map storing the distances calculated by the algorithm.
|
Dfs & | reachedMap (ReachedMap &m) |
| Sets the map indicating if a node is reached.
|
Dfs & | processedMap (ProcessedMap &m) |
| Sets the map indicating if a node is processed.
|
|
The simplest way to execute the algorithm is to use one of the member functions called run (...).
If you need more control on the execution, first you must call init(), then you can add a source node with addSource(). Finally start() will perform the actual path computation.
|
void | init () |
| Initializes the internal data structures.
|
void | addSource (Node s) |
| Adds a new source node.
|
Edge | processNextEdge () |
| Processes the next edge.
|
OutEdgeIt | nextEdge () |
| Next edge to be processed.
|
bool | emptyQueue () |
| Returns false if there are nodes to be processed in the queue.
|
int | queueSize () |
| Returns the number of the nodes to be processed in the queue.
|
void | start () |
| Executes the algorithm.
|
void | start (Node dest) |
| Executes the algorithm until dest is reached.
|
template<class EM> |
void | start (const EM &em) |
| Executes the algorithm until a condition is met.
|
void | run (Node s) |
| Runs DFS algorithm from node s .
|
int | run (Node s, Node t) |
| Finds the DFS path between s and t .
|
|
The result of the DFS algorithm can be obtained using these functions.
Before the use of these functions, either run() or start() must be called.
|
template<class P> |
bool | getPath (P &p, Node t) |
| Copies the path to t on the DFS tree into p .
|
int | dist (Node v) const |
| The distance of a node from the root(s).
|
Edge | predEdge (Node v) const |
| Returns the 'previous edge' of the DFS 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.
|
const PredMap & | predMap () const |
| Returns a reference to the DFS edge-tree map.
|
bool | reached (Node v) |
| Checks if a node is reachable from the root.
|
Classes |
struct | DefDistMap |
| Named parameter for setting DistMap type More...
|
struct | DefPredMap |
| Named parameter for setting PredMap type More...
|
struct | DefProcessedMap |
| Named parameter for setting ProcessedMap type More...
|
class | DefProcessedMapToBeDefaultMap |
| Named parameter for setting the ProcessedMap type to be Graph::NodeMap<bool>. More...
|
struct | DefReachedMap |
| Named parameter for setting ReachedMap type More...
|
class | UninitializedParameter |
| Exception for uninitialized parameters. More...
|