Hi,

There are a number of problems involving trees in which we have to find LCA, distances etc. Such problems require that a node is assigned as a root node of the tree.

Like in case of LCA-

Dist(a,b) = Dist(a,root) + Dist(b,root) - 2*Dist(LCA(a,b), root)

Are there any known, good methods for finding out the most optimal root for the tree(As any node can be considered as a root).

Thanks