[graph-tool] Random graph generation in graph-tool

Snehal Shekatkar snehalshekatkar at gmail.com
Mon Feb 13 17:07:41 CET 2017

Dear all,

This must be a quite studip question. I am slightly confused about the
random graph generation in graph-tool. So I tried generating an ER network:

def deg_samp(k0 = 3):
     return np.random.poisson(k0)

G = gt.random_graph(500, lambda : deg_samp(3), directed = False)

This gives reasonable result:

<Graph object, undirected, with 500 vertices and 780 edges at

However, I think that the following call is equivalent:

G = gt.random_graph(500, deg_samp, directed = False)

But this results into an extremely dense graph:

<Graph object, undirected, with 500 vertices and 62252 edges at

What am I missing exactly?

Thank you


Snehal Madhukar Shekatkar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.skewed.de/pipermail/graph-tool/attachments/20170213/9c5db4a4/attachment.htm>

More information about the graph-tool mailing list