Optimal Node Ranking of Trees in Linear Time

Abstract Iyer, Ratliff, and Vijayan [Inform. Process. Lett. 28 (1988) 225–229] defines a ranking of an unrooted tree to be any mapping from the nodes of the tree to the set {1,2,…} such that if two distinct nodes v, w have the same rank, then there exists a node x on the path between v and w such that the rank of x is greater than the rank of v and w. They also define a ranking to be optimal if the largest rank assigned to some node is as small as possible among all rankings. They give an O(n log n) time algorithm to find an optimal ranking of an n-node tree. This note describes an O(n) time algorithm to find an optimal ranking of a tree.

[1]  H. D. Ratliff,et al.  Optimal Node Ranking of Trees , 1988, Inf. Process. Lett..