#include <tpl_graph_utils.H>
Public Member Functions | |
| Depth_First_Traversal (SA __sa=SA()) | |
| size_t | operator() (const GT &g, Operation op=Operation()) |
| size_t | operator() (const GT &g, typename GT::Node *sn, Operation op=Operation()) |
Generic functor for depth first traversal of a graph.
This functor class traverses a graph in depth first order and by each seen node it is called an operation.
The functor receives the following template parameters;
GT: the graph typeOperation: functor for the visit operation,SA: arc filterOperation functor must match the following signature:
struct Operation
{
bool operator () (const GT & g, typename GT::Node * node,
typename GT::Arc * arc)
{
return true if you want to stop the traversal } };
G is the graph, node is the current visited node and arc is the arc from which the current node was seen. If the operator returns true, then the traversal stops; otherwise this continues.
The control bit Depth_First is used both the nodes and arcs
@see breadth_first_traversal() test_connectivity() Filter_Iterator
|
inline |
Construct a depth first traversal whose arcs are filtered by s filtro de arcos del iterador interno.
|
inline |
Invoke to traversal starting on any node of graph
| [in] | g | the graph |
| [in] | op | visit operation |
|
inline |
Invoke to traversal starting on any node of graph
| [in] | g | the graph |
| [in] | sn | pointer to starting node |
| [in] | op | visit operation |