k_edge_subgraphs(G, k)
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.
If the input graph is a multigraph.
If k is less than 1
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.
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.
>>> 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 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]]
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
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