brainpy.connect.SmallWorld
brainpy.connect.SmallWorld#
- class brainpy.connect.SmallWorld(num_neighbor, prob, directed=False, include_self=False)[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
- 1
Duncan J. Watts and Steven H. Strogatz, Collective dynamics of small-world networks, Nature, 393, pp. 440–442, 1998.
Methods
__init__
(num_neighbor, prob[, directed, ...])build_conn
()build connections with certain data type.
check
(structures)make_returns
(structures, conn_data[, csr, ...])Make the desired synaptic structures and return them.
require
(*structures)requires
(*structures)