Previous topic


Next topic


This Page


nepidemix.utilities.networkxtra.albert_barabasi_physrevlett_quick(N, m, m0=None, p=0, q=0)

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

Final network size,

m :int :

Number of links to add for each new node.

m0 : int, optional

Number of nodes in the original, simply connected graph. Requirement: m0 >= m if m0 == None, a default value of m will be used.

p :float, optional :

Probability of adding m new links to the existing network

q : float, optional

Probability of rewiring m existing links in the network

Returns :

G : networkx.Graph

The resulting graph.


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.