"Rui Carvalho" <rui.carvalho(a)ucl.ac.uk> writes:

Hello,

I'd like to use graph-tool to generate random graphs obeying example

(d) from Newman et al., PRE 64, 026118.Basically, there are 1000 people and each person knows between zero

and five others, the number of people in each category being from zero

to five:{86,150,363,238,109,54} -this is the histogram.Can I use graph-tool to generate graphs with this pdf a la Newman et

al.? Did I miss an example in the documentation detailing how to do

this?Also can I use graph tool to generate random graphs *exactly* with

this degree sequence as in the configurational model?

With graph-tool you can specify the sampling function for the degrees,

so you could (inside your function) simply sample one degree from each

bucket, and subtract from one from it, and stop when it's empty. This

implies also that you could supply a function which "samples" in a

specific sequence, and thus achieves what you asked for in the second

question.

For details on how to implement this see this part of the documentation:

http://projects.forked.de/graph-tool/wiki/RandomGraphGeneration#Moreelaboratedistributions

Cheers,

Tiago