This documents an unmaintained version of NetworkX. Please upgrade to a maintained version and see the current NetworkX documentation.
random_powerlaw_tree(n, gamma=3, seed=None, tries=100)¶
Returns a tree with a power law degree distribution.
NetworkXError– If no valid sequence is found within the maximum number of attempts.
A trial power law degree sequence is chosen and then elements are swapped with new elements from a powerlaw distribution until the sequence makes a tree (by checking, for example, that the number of edges is one smaller than the number of nodes).