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 )
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)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With