reservoirpy.mat_gen.small_world#

reservoirpy.mat_gen.small_world = _small_world()[source]#

Create a small-world network using the Watts-Strogatz model. This function generates a small-world network adjacency matrix with a specified number of close neighbours and a probability of rewiring edges. The small-world network is characterized by a high clustering coefficient and a short average path length, making it suitable for modeling complex networks. Small-world networks are often used in various fields such as sociology, neuroscience, and computer science to represent systems with local connections. See : Watts, D. J.; Strogatz, S. H. (1998). “Collective dynamics of ‘small-world’ networks”

Parameters:
  • *shape ((int, int)) – Shape of the matrix. Must be square.

  • nb_close_neighbours (int) – Number of close neighbours per node (must be even).

  • proba_rewire (float) – Probability of rewiring edges (between 0 and 1).

  • dtype (numpy.dtype) – Output matrix dtype.

  • seed (int or np.random.Generator) – Random seed or generator.

  • distribution (Literal["normal", "uniform", "random_sparse", "bernoulli"], default to "normal") – Distribution to use for the weights of the connections.

  • sparsity_type ({"csr", "csc", "dense"}, default to "csr") – Format of the output matrix. “csr” and “csc” corresponds to the Scipy sparse

  • **kwargs (unused) – For compatibility.

Returns:

Adjacency matrix of the small-world network.

Return type:

numpy.ndarray