brainpy.connect.ScaleFreeBA#

class brainpy.connect.ScaleFreeBA(m, directed=False, seed=None)[source]#

Build a random graph according to the Barabási–Albert preferential attachment model.

A graph of \(num\_node\) nodes is grown by attaching new nodes each with \(m\) edges that are preferentially attached to existing nodes with high degree.

Parameters
  • m (int) – Number of edges to attach from a new node to existing nodes

  • seed (integer, random_state, or None (default)) – Indicator of random number generation state.

Raises

ConnectorError – If m does not satisfy 1 <= m < n.

References

1

A. L. Barabási and R. Albert “Emergence of scaling in random networks”, Science 286, pp 509-512, 1999.

__init__(m, directed=False, seed=None)[source]#

Methods

__init__(m[, 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