当前位置: 首页>>代码示例 >>用法及示例精选 >>正文


Python NetworkX bridge_components用法及代码示例


本文简要介绍 networkx.algorithms.connectivity.edge_kcomponents.bridge_components 的用法。

用法:

bridge_components(G)

查找所有 bridge-connected 组件 G。

参数

GNetworkX 无向图

返回

bridge_components2-edge-connected 组件的生成器

抛出

NetworkXNotImplemented

如果输入图是有向图或多重图。

注意

Bridge-connected 组件也称为 2-edge-connected 组件。

例子

>>> # 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]]

相关用法


注:本文由纯净天空筛选整理自networkx.org大神的英文原创作品 networkx.algorithms.connectivity.edge_kcomponents.bridge_components。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。