k_edge_components(G, k)
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.
If the input graph is a multigraph.
If k is less than 1
will have k-edge-connectivity in the graph G.
Generates nodes in each maximal k-edge-connected component in G.
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.
>>> import itertools as itSee :
... 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]]
The following pages refer to to this document either explicitly or contain code examples using this.
networkx.algorithms.connectivity.edge_kcomponents.k_edge_subgraphs
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