加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > Python > 正文

python – 什么是吸引组件子图?

发布时间:2020-12-20 11:20:08 所属栏目:Python 来源:网络整理
导读:什么是图形的吸引组件子图? Networkx has an algorithm for this.但我无法理解这是什么,因为: g.edges()[(0,1),(1,2),(2,3),5),(3,4)] for l in nx.algorithms.components.attracting.attracting_component_subgraphs(g):... print l.edges()... print l.n
什么是图形的吸引组件子图?

Networkx has an algorithm for this.但我无法理解这是什么,因为:

>>> g.edges()
[(0,1),(1,2),(2,3),5),(3,4)]
>>> for l in nx.algorithms.components.attracting.attracting_component_subgraphs(g):
...     print l.edges()
...     print l.nodes()
... 
[]
[4]
[]
[5]

解决方法

nx.algorithms.components.attracting_components的文档中提供了吸引组件的定义.

An attracting component in a directed graph is a strongly connected
component with the property that a random walker on the graph will
never leave the component,once it enters the component.

The nodes in attracting components can also be thought of as recurrent
nodes. If a random walker enters the attractor containing the node,
then the node will be visited infinitely often.

http://networkx.lanl.gov/reference/generated/networkx.algorithms.components.attracting.attracting_components.html#networkx.algorithms.components.attracting.attracting_components

因此,吸引组件子图将是引起满足该定义的子图的节点列表.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读