is_k_edge_connected

is_k_edge_connected#

graph_tool.flow.is_k_edge_connected(g, k)[git][source]#

Test whether the graph is \(k\)-edge-connected.

Parameters:
gGraph

Graph to be used.

kint

Required edge connectivity.

Returns:
is_connectedbool

True if the graph has at least two vertices and its edge connectivity (strong, if it is directed) is at least \(k\).

See also

edge_connectivity

Edge connectivity

k_edge_augmentation

Edges that make the graph k-edge-connected

label_k_edge_components

K-edge-connected components

Notes

This is equivalent to edge_connectivity(g) >= k (see edge_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)\) (with label_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 in label_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