ScaleFreeBA

ScaleFreeBA#

class brainpy.connect.ScaleFreeBA(m, directed=False, seed=None, **kwargs)[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

build_mat(isOptimized=True)[source]#

Build a binary matrix connection data.

If users want to customize their connections, please provide one of the following functions:

  • build_mat(): build a matrix binary connection matrix.

  • build_csr(): build a csr sparse connection data.

  • build_coo(): build a coo sparse connection data.

  • build_conn(): deprecated.

Returns:

conn – A binary matrix with the shape (num_pre, num_post).

Return type:

Array