pymnet.single_layer_conf¶
- pymnet.single_layer_conf(net, degs, degstype='distribution')¶
Generates a realization of configuration model network.
- Parameters:
- netMultilayerNetwork with aspects=0
Empty network object that is to be filled.
- degsdict
Degrees of the network. See degstype parameter.
- degstypestring
If ‘distribution’, then degs parameter gives the degree distribution, i.e., keys are degrees, and corresponding values are number of nodes with the given degree. If ‘nodes’, then degs parameter gives node degrees, i.e, keys are node names and corresponding values are degrees of those nodes.
Notes
The algorithm used here is similar to the one in article: B.D McKay, N.C Wormald ‘Uniform Generation of Random Regular Graphs of Moderate Degree’ Journal of Algorithms 11, pages 52-67 (1990)
The difference between the algorithm presented in the article and the one in this function is that the random restarts are not implemented here. This means that the sampled networks are not exactly statistically uniform. However, if the degrees are small compared to the number of nodes the error is likely to be small.