networkx 2.8.2 Pypi GitHub Homepage
Other Docs
NotesParametersRaisesReturnsBackRef
k_edge_components(G, k)

Notes

Attempts to use the most efficient implementation available based on k. If k=1, this is simply connected components for directed graphs and connected components for undirected graphs. If k=2 on an efficient bridge connected component algorithm from _[1] is run based on the chain decomposition. Otherwise, the algorithm from _[2] is used.

Parameters

G : NetworkX graph
k : Integer

Desired edge connectivity

Raises

NetworkXNotImplemented

If the input graph is a multigraph.

ValueError:

If k is less than 1

Returns

k_edge_components : a generator of k-edge-ccs. Each set of returned nodes

will have k-edge-connectivity in the graph G.

Generates nodes in each maximal k-edge-connected component in G.

See Also

k_components

similar to this function, but uses node-connectivity instead of edge-connectivity

k_edge_subgraphs

similar to this function, but the subgraph defined by the nodes must also have k-edge-connectivity.

local_edge_connectivity

func

Examples

>>> import itertools as it
... from networkx.utils import pairwise
... paths = [
...  (1, 2, 4, 3, 1, 4),
...  (5, 6, 7, 8, 5, 7, 8, 6),
... ]
... G = nx.Graph()
... G.add_nodes_from(it.chain(*paths))
... G.add_edges_from(it.chain(*[pairwise(path) for path in paths]))
... # note this returns {1, 4} unlike k_edge_subgraphs
... sorted(map(sorted, nx.k_edge_components(G, k=3))) [[1, 4], [2], [3], [5, 6, 7, 8]]
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

networkx.algorithms.connectivity.edge_kcomponents.k_edge_subgraphs

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /networkx/algorithms/connectivity/edge_kcomponents.py#26
type: <class 'function'>
Commit: