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

Notes

Attempts to use the most efficient implementation available based on k. If k=1, or k=2 and the graph is undirected, then this simply calls k_edge_components . Otherwise the algorithm from _[1] 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_subgraphs : a generator of k-edge-subgraphs

Each k-edge-subgraph is a maximal set of nodes that defines a subgraph of G that is k-edge-connected.

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

See Also

edge_connectivity

func

k_edge_components

similar to this function, but nodes only need to have k-edge-connctivity within the graph G and the subgraphs might not be k-edge-connected.

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 does not return {1, 4} unlike k_edge_components
... sorted(map(sorted, nx.k_edge_subgraphs(G, k=3))) [[1], [2], [3], [4], [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.bridge_components networkx.algorithms.connectivity.edge_kcomponents.k_edge_components

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#109
type: <class 'function'>
Commit: