Fix performance regression in initial partition creation for large
graphs.