Set number of vertices when preparing a graph