tree_broadcast_time#
- tree_broadcast_time(G, node=None)[source]#
返回树
G
的广播时间。节点的最小广播时间定义为从发起者开始完成广播所需的最小时间量。图的广播时间是所有节点的最小广播时间的最大值 [1]。此函数返回
node
的最小广播时间。如果node
为 None,则返回图的广播时间。- 参数:
- G无向图
该图应该是一棵无向树
- node: int, 可选
起始节点的索引。如果为
None
,则算法返回树的广播时间。
- 返回值:
- BTint
树中节点的广播时间
- 引发异常:
- NetworkXNotImplemented
如果图是有向图或多重图。
参考文献
[1]Harutyunyan, H. A. and Li, Z. “A Simple Construction of Broadcast Graphs.” In Computing and Combinatorics. COCOON 2019 (Ed. D. Z. Du and C. Tian.) Springer, pp. 240-253, 2019.