How to generate a random graph given the number of nodes and edges?
Question: 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 )


Answer: Do you have to use `numpy.random.rand`? If not, just use
[`Graph.Erdos_Renyi`](http://igraph.sourceforge.net/doc/python/igraph.GraphBase-
class.html#Erdos_Renyi), which lets you specify the number of nodes and edges
directly:

    
    
    g = Graph.Erdos_Renyi(n=10000, m=100000)
    

