Open qiemem opened 10 years ago
A few things to decide on this:
For the second two points, I realized there's a deterministic way to realize these networks:
If there's a network that realizes the degree distribution, this will realize it.
Then, we can attempt to swap links to randomize. So, we grab two random links and attempt to swap the end of one with an end other the other. Make a bunch of such attempts (some number times the number of links).
I believe this will at least approach a uniform pull from the set of networks with that degree distribution as the number of attempted swaps approaches infinity. Unfortunately, since we can't perform an infinite number of attempted swaps, it will be a different distribution. I'm also not sure if you can work yourself into a network where you can't make any swaps but other realizations exist.
I'm leaning towards implementing this, and then including netlogo code to do actual, guaranteed uniform sampling from the set of realizations for people for whom that's an absolute requirement.
The configuration model takes a specified degree distribution and generates a random network with that exact degree distribution. It works as follows: give each node
i
k_i
link stubs, where ak_i
is the degree assigned to nodei
and a link stub is simply a link with only one end connected. Connect the link stubs to each other uniformly at random. This can result in networks with multiple links between nodes and self-loops. If any appear, just reshuffle the connections.The nice thing about the configuration model is that it's so flexible. Generating a regular network becomes one line:
Arbitrary scale-free networks can be generated like so:
This is partially inspired by this SO question: http://stackoverflow.com/questions/25332514/assigning-neighbors-to-agents-in-symmetric-manner