brainpy.connect.SmallWorld#
- class brainpy.connect.SmallWorld(num_neighbor, prob, directed=False, include_self=False, seed=None, **kwargs)[source]#
Build a Watts–Strogatz small-world graph.
- Parameters:
Notes
First create a ring over \(num\_node\) nodes [1]. Then each node in the ring is joined to its \(num\_neighbor\) nearest neighbors (or \(num\_neighbor - 1\) neighbors if \(num\_neighbor\) is odd). Then shortcuts are created by replacing some edges as follows: for each edge \((u, v)\) in the underlying “\(num\_node\)-ring with \(num\_neighbor\) nearest neighbors” with probability \(prob\) replace it with a new edge \((u, w)\) with uniformly random choice of existing node \(w\).
References
Methods
__init__
(num_neighbor, prob[, directed, ...])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