Implementation of the Albert and Barabasi preferential attachment algorithm as described in ‘Topology of Evolving Networks: Local Events and Universality’, Physical Review Letters Vol 85, Number 24, 1999.
This version interprets the algorithm in such a way that it is always guaranteed to finish. The ‘corners’ that are cut are a) If no new link can be added in case i (i.e. saturated network) the algorithm gives up and continues having attached less than m links. (The rigorous interpretation would have the algorithm fail or start over from the beginning which may lead to extreme run times depending on p.) b) If one of the two nodes connected by the link in case ii has no other neighbor we do no update at all and continue. This not avoid creating disconnected graphs.
Parameters : | N : int
m :int :
m0 : int, optional
p :float, optional :
q : float, optional
|
---|---|
Returns : | G : networkx.Graph
|
Notes
If p = q = 0 then the algorithm will default to the algorithm described in ‘Emergence of Scaling in Random Networks’ by Barabasi and Albert, Science Vol 286, October 1999.