networkx 2.8.2 Pypi GitHub Homepage
Other Docs
_powerlaw_sequence(gamma, low, high, condition, length, max_iters, seed)

gamma and low are the parameters for the Zipf distribution.

high is the maximum allowed value for values draw from the Zipf distribution. For more information, see _zipf_rv_below .

condition and length are Boolean-valued functions on lists. While generating the list, random values are drawn and appended to the list until length is satisfied by the created list. Once condition is satisfied, the sequence generated in this way is returned.

max_iters indicates the number of times to generate a list satisfying length . If the number of iterations exceeds this value, ~networkx.exception.ExceededMaxIterations is raised.

seed

seed

Returns a list of numbers obeying a constrained power law distribution.

Examples

See :

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /networkx/generators/community.py#669
type: <class 'function'>
Commit: