networkx.generators.random_graphs.barabasi_albert_graph¶
-
barabasi_albert_graph(n, m, seed=None)[source]¶ Returns a random graph according to the Barabási–Albert preferential attachment model.
A graph of \(n\) nodes is grown by attaching new nodes each with \(m\) edges that are preferentially attached to existing nodes with high degree.
- Parameters
n (
int) – Number of nodesm (
int) – Number of edges to attach from a new node to existing nodesseed (
integer,random_state, orNone (default)) – Indicator of random number generation state. See Randomness.
- Returns
G
- Return type
Graph- Raises
NetworkXError – If
mdoes not satisfy1 <= m < n.
References
- 1
A. L. Barabási and R. Albert “Emergence of scaling in random networks”, Science 286, pp 509-512, 1999.