Generate a random network with nodes and edges.