Find the root(s) that reduce tree height. There are at most such roots, and they're the tree's centroid(s). Approach : Root at each node, compute height, take minimum. naive, with rerooting.
Approach : Peel leaves layer by layer. Remove all degree- nodes, repeat. The last - nodes remaining are the answer. Both approaches give the centroid(s). The peeling approach is simpler and naturally handles the "at most " property.