tree_broadcast_time#
- graph_tool.structure.tree_broadcast_time(g, v=None)[git][source]#
Return the broadcast time of a tree, or from one of its vertices.
- Parameters:
- Returns:
- time
int The number of rounds needed to inform all vertices from
v(or, ifvisNone, the maximum over all vertices), when in each round every informed vertex can inform one neighbor.
- time
See also
tree_broadcast_centerBroadcast time and broadcast center
eccentricityEccentricity of every vertex
Notes
The time from a vertex is the broadcast time of the tree (see
tree_broadcast_center()) plus its distance to the nearest vertex of the broadcast center [slater-information-1981], which is the minimum over the broadcast schemes. The time is \(O(V\log V)\).References
[slater-information-1981]Peter J. Slater, Ernest J. Cockayne and Stephen T. Hedetniemi, “Information dissemination in trees”, SIAM Journal on Computing 10, 692-701 (1981), DOI: 10.1137/0210052 [sci-hub, @tor]
Examples
>>> g = gt.Graph([(0, 1), (1, 2), (1, 3), (3, 4), (3, 5), (5, 6)], ... directed=False) >>> print(gt.tree_broadcast_time(g), gt.tree_broadcast_time(g, 6)) 5 5