For each node with children, pick the child with the largest size[u]. The edge from to is heavy. All other edges from are light. If there is a tie for largest child, pick any one arbitrarily. Leaf nodes have no children, so no edges from them need classification.
This simple rule guarantees the chain property. Every node has at most one heavy edge going down to a child. A node can have multiple light edges down, but only one heavy edge.
Space complexity is for the data structures used.