Set partitioning in hierarchical trees