Topological sort with parallelizable groups.