How to generate a random graph given the number of nodes and edges?
igraph, python, random
Solution
Do you have to use `numpy.random.rand`? If not, just use `Graph.Erdos_Renyi`, which lets you specify the number of nodes and edges directly:
g = Graph.Erdos_Renyi(n=10000, m=100000)
Problem
I am using python with igraph library: ``` from igraph import * g = Graph() g.add_vertices(4) g.add_edges([(0,2),(1,2),(3,2)]) print g.betweenness() ``` I would like to generate a random graph with 10000 nodes and 100000 edges. The edges can be random. Please suggest a way to have random edges (using numpy.random.rand )