code: public GridGraph addDimension(long size, boolean wrapEndpoints) {
  		Preconditions.checkArgument(size >= 2, "Dimension size must be at least 2");
  
  		vertexCount = Math.multiplyExact(vertexCount, size);
  
  		// prevent duplicate edges
  		if (size == 2) {
  			wrapEndpoints = false;
  		}
  
  		dimensions.add(new Tuple2<>(size, wrapEndpoints));
  
  		return this;
  	}
docs: Required configuration for each dimension of the graph.
  
  @param size number of vertices; dimensions of size 1 are prohibited due to having no effect
  on the generated graph
  @param wrapEndpoints whether to connect first and last vertices; this has no effect on
  dimensions of size 2
  @return this