extended_barabasi_albert_graph#

extended_barabasi_albert_graph(n, m, p, q, seed=None, *, create_using=None)[source]#

Returns an extended Barabási–Albert model graph.

An extended Barabási–Albert model graph is a random graph constructed using preferential attachment. The extended model allows new edges, rewired edges or new nodes. Based on the probabilities \(p\) and \(q\) with \(p + q < 1\), the growing behavior of the graph is determined as:

1) With \(p\) probability, \(m\) new edges are added to the graph, starting from randomly chosen existing nodes and attached preferentially at the other end.

2) With \(q\) probability, \(m\) existing edges are rewired by randomly choosing an edge and rewiring one end to a preferentially chosen node.

3) With \((1 - p - q)\) probability, \(m\) new nodes are added to the graph with edges attached preferentially.

When \(p = q = 0\), the model behaves just like the Barabási–Alber model.

Parameters:
nint

Number of nodes

mint

Number of edges with which a new node attaches to existing nodes

pfloat

Probability value for adding an edge between existing nodes. p + q < 1

qfloat

Probability value of rewiring of existing edges. p + q < 1

seedinteger, random_state, or None (default)

Indicator of random number generation state. See Randomness.

create_usingGraph constructor, optional (default=nx.Graph)

Graph type to create. If graph instance, then cleared before populated. Multigraph and directed types are not supported and raise a NetworkXError.

Returns:
GGraph
Raises:
NetworkXError

If m does not satisfy 1 <= m < n or 1 >= p + q

References

[1]

Albert, R., & Barabási, A. L. (2000) Topology of evolving networks: local events and universality Physical review letters, 85(24), 5234.