This documents the development version of NetworkX. Documentation for the current release can be found here.
Finds all bridge-connected components G.
- GNetworkX undirected graph
- bridge_componentsa generator of 2-edge-connected components
If the input graph is directed or a multigraph.
this function is a special case for an undirected graph where k=2.
similar to this function, but is defined using 2-node-connectivity instead of 2-edge-connectivity.
Bridge-connected components are also known as 2-edge-connected components.
>>> # The barbell graph with parameter zero has a single bridge >>> G = nx.barbell_graph(5, 0) >>> from networkx.algorithms.connectivity.edge_kcomponents import bridge_components >>> sorted(map(sorted, bridge_components(G))) [[0, 1, 2, 3, 4], [5, 6, 7, 8, 9]]