rewrote the test testRandomGraphGeneration for compatibility