is_k_edge_connected#
- graph_tool.flow.is_k_edge_connected(g, k)[git][source]#
Test whether the graph is \(k\)-edge-connected.
- Parameters:
- g
Graph Graph to be used.
- k
int Required edge connectivity.
- g
- Returns:
- is_connected
bool Trueif the graph has at least two vertices and its edge connectivity (strong, if it is directed) is at least \(k\).
- is_connected
See also
edge_connectivityEdge connectivity
k_edge_augmentationEdges that make the graph k-edge-connected
label_k_edge_componentsK-edge-connected components
Notes
This is equivalent to
edge_connectivity(g) >= k(seeedge_connectivity()), but faster for small \(k\): after the tests of the minimum degree and of connectivity, the cases \(k=1\) and \(k=2\) of undirected graphs are decided in time \(O(V+E)\) (withlabel_bridge_components()for the latter), and otherwise the maximum flows from one vertex to all others (and back, for directed graphs) stop at \(k\), with the speed-ups described inlabel_k_edge_components(), in time \(O(kVE)\).Parallel edges are counted with their multiplicities, so that two vertices joined by \(k\) parallel edges form a \(k\)-edge-connected graph; self-loops are ignored.
Parallel implementation.
If enabled during compilation, this algorithm will run in parallel using OpenMP. See the parallel algorithms section for information about how to control several aspects of parallelization.
Examples
>>> g = gt.collection.data["football"] >>> print(gt.is_k_edge_connected(g, 7), gt.is_k_edge_connected(g, 8)) True False