bridge_components#
- bridge_components(G)[源代码]#
查找所有桥接组件G。
- 参数
- G网络X无向图
- 返回
- bridge_components一个两边连通分支的生成器
- 加薪
- NetworkXNotImplemented
如果输入图是有向图或多重图。
参见
k_edge_subgraphs()
这个函数是无向图的特例,其中k=2。
biconnected_components()
类似于此函数,但使用2节点连接而不是2边缘连接进行定义。
笔记
桥接元件也称为2边接元件。
实例
>>> # 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]]