find_threshold_graph#

find_threshold_graph(G, create_using=None)[源代码]#

返回接近中最大的阈值子图 G .

阈值图将包含G中最大的度节点。

参数
G网络X图形实例

的一个实例 Graph ,或 MultiDiGraph

create_usingNetworkX图形类或

构造阈值图形时要使用的图形类型。如果 None 从输入中推断出适当的图形类型。

返回
graph

表示阈值图的图实例

工具书类

1

阈值图:https://en.wikipedia.org/wiki/Threshold_图形

实例

>>> from networkx.algorithms.threshold import find_threshold_graph
>>> G = nx.barbell_graph(3, 3)
>>> T = find_threshold_graph(G)
>>> T.nodes # may vary
NodeView((7, 8, 5, 6))