networkx.generators.random_graphs.dual_barabasi_albert_graph¶
-
dual_barabasi_albert_graph(n, m1, m2, p, seed=None)[source]¶ Returns a random graph according to the dual Barabási–Albert preferential attachment model.
A graph of \(n\) nodes is grown by attaching new nodes each with either \(m_1\) edges (with probability \(p\)) or \(m_2\) edges (with probability \(1-p\)) that are preferentially attached to existing nodes with high degree.
- Parameters
n (
int) – Number of nodesm1 (
int) – Number of edges to attach from a new node to existing nodes with probability \(p\)m2 (
int) – Number of edges to attach from a new node to existing nodes with probability \(1-p\)p (
float) – The probability of attaching \(m_1\) edges (as opposed to \(m_2\) edges)seed (
integer,random_state, orNone (default)) – Indicator of random number generation state. See Randomness.
- Returns
G
- Return type
Graph- Raises
NetworkXError – If
m1andm2do not satisfy1 <= m1,m2 < norpdoes not satisfy0 <= p <= 1.
References
- 1
Moshiri “The dual-Barabasi-Albert model”, arXiv:1810.10538.