#include <tpl_graph_utils.H>
Public Member Functions | |
| Breadth_First_Traversal (SA __sa=SA()) | |
| size_t | operator() (const GT &g, Operation op) |
| size_t | operator() (const GT &g, typename GT::Node *p, Operation &&op=Operation()) |
| size_t | operator() (const GT &g, typename GT::Node *p, Operation &op) |
Generic functor for breadth first traversal of a graph.
This functor class traverses a graph in breadth 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 |
Constructor of functor Breadth_First_Traversal whose arcs are filtered by sa
|
inline |
Invoke to traversal.
| [in] | g | the graph |
| [in] | op | visit operation |
| bad_alloc | if there is no enough memory |
|
inline |
Invoke to traversal.
| [in] | g | the graph |
| [in] | p | pointer to starting node |
| [in] | op | visit operation |
| bad_alloc | if there is no enough memory |