brainpy.connect.ScaleFreeBADual#
- class brainpy.connect.ScaleFreeBADual(m1, m2, p, directed=False, seed=None, **kwargs)[source]#
Build a random graph according to the dual Barabási–Albert preferential attachment model.
A graph of :math::num_node 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:
m1 (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, or None (default)) – Indicator of random number generation state.
- Raises:
ConnectorError – If m1 and m2 do not satisfy
1 <= m1,m2 < n
or p does not satisfy0 <= p <= 1
.
References
Methods
__init__
(m1, m2, p[, directed, seed])build_conn
()build connections with certain data type.
build_coo
()Build a coo sparse connection data.
build_csr
()Build a csr sparse connection data.
build_mat
()Build a binary matrix connection data.
require
(*structures)Require all the connection data needed.
requires
(*structures)Require all the connection data needed.
Attributes
is_version2_style