Dynamic Hierarchical Decomposition of Networks