barabasi_albert_graph(n, m, seed=None, initial_graph=None)
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.
Number of nodes
Number of edges to attach from a new node to existing nodes
Indicator of random number generation state. See Randomness<randomness>
.
Initial network for Barabási–Albert algorithm. It should be a connected graph for most use cases. A copy of :None:None:`initial_graph`
is used. If None, starts from a star graph on (m+1) nodes.
If m
does not satisfy 1 <= m < n
, or the initial graph number of nodes m0 does not satisfy m <= m0 <= n
.
Returns a random graph using Barabási–Albert preferential attachment
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