higra / Higra

Hierarchical Graph Analysis
Other
98 stars 20 forks source link

Add tree attribute: topological height #192

Closed PerretB closed 4 years ago

PerretB commented 4 years ago

For a given node n, its topological height is defined as the number of edges on the longest path from the node to a leaf.

new_altitudes = hg.accumulate_and_add_sequential(tree, np.ones(tree.num_vertices()), np.zeros(tree.num_leaves()), hg.Accumulators.max)