|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Determines if a digraph contains a cycle and constructs it. More...
#include <Tarjan.H>
Public Member Functions | |
| Compute_Cycle_In_Digraph (SA __sa=SA()) | |
| Constructs a cycle computation instance with an arc filter. | |
| bool | operator() (const GT &g, Path< GT > &path) const |
| Invokes the computation of a cycle in a digraph. | |
| Path< GT > | operator() (const GT &g) const |
| Computes and returns a cycle in the digraph. | |
| Path< GT > | operator() (const GT &g, typename GT::Node *src) const |
| Computes and returns a cycle starting from a specific node. | |
Private Attributes | |
| SA | sa |
Determines if a digraph contains a cycle and constructs it.
Compute_Cycle_In_Digraph() takes a digraph g, determines if it contains a cycle, and if so, constructs a path containing the cycle in question.
The class is based on Tarjan's algorithm.
The function uses two type parameters:
The class uses the build_subtree bit to mark visited nodes and arcs.
|
inline |
Computes and returns a cycle in the digraph.
| [in] | g | The graph to search for cycles. |
| bad_alloc | if there is not enough memory. |
Definition at line 1056 of file Tarjan.H.
References Aleph::maps(), and Aleph::Compute_Cycle_In_Digraph< GT, Itor, SA >::sa.
|
inline |
Invokes the computation of a cycle in a digraph.
| [in] | g | the graph on which to compute its blocks. |
| [out] | path | path that defines the cycle. |
| bad_alloc | if there is not enough memory. |
Definition at line 1043 of file Tarjan.H.
References Aleph::maps(), and Aleph::Compute_Cycle_In_Digraph< GT, Itor, SA >::sa.
|
inline |
Computes and returns a cycle starting from a specific node.
| [in] | g | The graph to search for cycles. |
| [in] | src | The source node to start the search from (must not be null). |
| domain_error | if src is null. |
| bad_alloc | if there is not enough memory. |
Definition at line 1071 of file Tarjan.H.
References Aleph::Tarjan_Connected_Components< GT, Itor, SA >::compute_cycle(), Aleph::maps(), and Aleph::Compute_Cycle_In_Digraph< GT, Itor, SA >::sa.
|
private |
Definition at line 1022 of file Tarjan.H.
Referenced by Aleph::Compute_Cycle_In_Digraph< GT, Itor, SA >::operator()(), Aleph::Compute_Cycle_In_Digraph< GT, Itor, SA >::operator()(), and Aleph::Compute_Cycle_In_Digraph< GT, Itor, SA >::operator()().