|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Determines if a graph g is connected. More...
#include <tpl_test_connectivity.H>
Public Member Functions | |
| bool | operator() (GT &g, SA &&sa=SA()) const |
| Invokes the connectivity test. | |
| bool | operator() (GT &g, SA &sa) const |
| Invokes the connectivity test. | |
Determines if a graph g is connected.
This class performs a connectivity test on graph g. The test uses a depth-first traversal.
The class verifies the number of arcs. If this number is less than the number of nodes minus one, then the graph is considered disconnected.
The function takes two type parameters:
Definition at line 67 of file tpl_test_connectivity.H.
|
inline |
Invokes the connectivity test.
This version is used when the arc filter needs to maintain state.
| g | the graph or digraph to verify |
| sa | the arc filter for the graph (rvalue reference, default: Dft_Show_Arc<GT>) |
| domain_error | if the routine is invoked on a digraph. |
Definition at line 82 of file tpl_test_connectivity.H.
References ah_domain_error_if, GraphCommon< GT, Node, Arc >::get_num_arcs(), GraphCommon< GT, Node, Arc >::get_num_nodes(), GraphCommon< GT, Node, Arc >::is_digraph(), and Aleph::maps().
|
inline |
Invokes the connectivity test.
This version is used when the arc filter needs to maintain state.
| g | the graph or digraph to verify |
| sa | the arc filter for the graph (lvalue reference) |
| domain_error | if the routine is invoked on a digraph. |
Definition at line 106 of file tpl_test_connectivity.H.
References ah_domain_error_if, GraphCommon< GT, Node, Arc >::get_num_arcs(), GraphCommon< GT, Node, Arc >::get_num_nodes(), GraphCommon< GT, Node, Arc >::is_digraph(), and Aleph::maps().