Instead of allocating new vectors for each partition, simply partion the nodes in place and pass the corresponding ranges to the next phase.