assert numNodes == numVariables ();
if (vertexPots == null) {
setCachesCapacity (numNodes);
} else if (numNodes > vertexPots.length) {
List[] oldVertexPots = vertexPots;
CSIntInt2ObjectMultiMap oldEdgePots = pairwiseFactors;
List[] oldFactorsByVar = factorsByVar;
int[] oldM2G = my2global;
setCachesCapacity (2*numNodes);
assert (oldEdgePots != null);