greedypartition