public static Graph CreateGraphMaxSize(int maxDepth, int maxNumOfNodes) { System.Random rnd = new System.Random(); Graph grph = new Graph(rnd, maxDepth); while(allNodes.Count < maxNumOfNodes) { grph.IterateGenerationMaxSize(maxNumOfNodes); } return grph; }