Methods to generate a random graph.