tree_broadcast_time#

tree_broadcast_time(G, node=None)[source]#

返回树 G 的广播时间。

节点的最小广播时间定义为从发起者开始完成广播所需的最短时间。图的广播时间是所有节点中最小广播时间的最大值 [1]。此函数返回节点 node 的最小广播时间。如果 node 为 None,则返回图的广播时间。

Parameters:
G无向图

该图应为一个无向树

node: int, 可选

起始节点的索引。如果为 None ,则算法返回树的广播时间。

Returns:
BTint

树中节点的广播时间

Raises:
NetworkXNotImplemented

如果图是有向的或是一个多重图。

References

[1]

Harutyunyan, H. A. 和 Li, Z. “A Simple Construction of Broadcast Graphs.” In Computing and Combinatorics. COCOON 2019 (Ed. D. Z. Du 和 C. Tian.) Springer, pp. 240-253, 2019.