Warning
This documents an unmaintained version of NetworkX. Please upgrade to a maintained version and see the current NetworkX documentation.
scale_free_graph¶

scale_free_graph
(n, alpha=0.41, beta=0.54, gamma=0.05, delta_in=0.2, delta_out=0, create_using=None, seed=None)[source]¶ Returns a scalefree directed graph.
Parameters:  n (integer) – Number of nodes in graph
 alpha (float) – Probability for adding a new node connected to an existing node chosen randomly according to the indegree distribution.
 beta (float) – Probability for adding an edge between two existing nodes. One existing node is chosen randomly according the indegree distribution and the other chosen randomly according to the outdegree distribution.
 gamma (float) – Probability for adding a new node conecgted to an existing node chosen randomly according to the outdegree distribution.
 delta_in (float) – Bias for choosing ndoes from indegree distribution.
 delta_out (float) – Bias for choosing ndoes from outdegree distribution.
 create_using (graph, optional (default MultiDiGraph)) – Use this graph instance to start the process (default=3cycle).
 seed (integer, optional) – Seed for random number generator
Examples
Create a scalefree graph on one hundred nodes:
>>> G = nx.scale_free_graph(100)
Notes
The sum of
alpha
,beta
, andgamma
must be 1.References
[1] B. Bollobás, C. Borgs, J. Chayes, and O. Riordan, Directed scalefree graphs, Proceedings of the fourteenth annual ACMSIAM Symposium on Discrete Algorithms, 132–139, 2003.