brainpy.simulation.connectivity.PowerLaw

class brainpy.simulation.connectivity.PowerLaw(m, p, directed=False, seed=None)[source]

Holme and Kim algorithm for growing graphs with powerlaw degree distribution and approximate average clustering.

Parameters
  • m (int) – the number of random edges to add for each new node

  • p (float,) – Probability of adding a triangle after adding a random edge

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

Notes

The average clustering has a hard time getting above a certain cutoff that depends on m. This cutoff is often quite low. The transitivity (fraction of triangles to possible triangles) seems to decrease with network size.

It is essentially the Barabási–Albert (BA) growth model with an extra step that each random edge is followed by a chance of making an edge to one of its neighbors too (and thus a triangle).

This algorithm improves on BA in the sense that it enables a higher average clustering to be attained if desired.

It seems possible to have a disconnected graph with this algorithm since the initial m nodes may not be all linked to a new node on the first iteration like the BA model.

Raises

ValueError – If m does not satisfy 1 <= m <= n or p does not satisfy 0 <= p <= 1.

References

1

P. Holme and B. J. Kim, “Growing scale-free networks with tunable clustering”, Phys. Rev. E, 65, 026107, 2002.

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

Methods

__init__(m, p[, directed, seed])

make_conn_mat()

make_mat2ij()

make_post2pre()

make_post2syn()

make_post_slice()

make_pre2post()

make_pre2syn()

make_pre_slice()

requires(*syn_requires)