Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python: Create a graph with defined number of edges per node

How I can create a graph with

-predefined number of connections for each node, say 3

-given distribution of connections (say Poisson distribution with given mean)

Thanks

like image 706
user40 Avatar asked Feb 19 '26 05:02

user40


1 Answers

If you are using NetworkX you might try the "configuration model". This was discussed in the SO question Generating a graph with certain degree distribution?

In graph theory terminology the number of connections is called "degree". And graphs with uniform degree (all nodes the same) are called "regular graphs".

like image 137
Aric Avatar answered Feb 20 '26 19:02

Aric



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!