Second decision: Does the problem ask for an answer from one specific root, or do you need answers for all nodes as roots?
If it is 'from node ' or 'from the root', use subtree DP or diameter (if it is about distances). One root means one DFS.
If it is 'for each node' or 'for all possible roots', you need rerooting. Running DFS from each node separately is . Rerooting is .
Diameter is special: it finds the farthest pair without checking all roots. Two BFS or one DP.
Example: Distance sum from node = subtree DP. Distance sum for all nodes = rerooting.