Let n
be the size of the network, and t
be the power-law exponent. The goal is to generate a random graph G
of n
vertices with a power-law degree distribution specified by t
.
There are several existing answers: (1) answer 1 and (2) answer 2, which all use random.paretovariate()
function. However, this is no guarantee that the resulting sequence is a valid degree sequence.
I also checked networkx and failed to find any function that produces a power-law degree sequence. Is there a way to do this in Python?