netneurotools.metrics.communicability_bin

netneurotools.metrics.communicability_bin(adjacency, normalize=False)[source]

Compute the communicability of pairs of nodes in adjacency.

Parameters:
  • adjacency ((N, N) array_like) – Unweighted, direct/undirected connection weight/length array

  • normalize (bool, optional) – Whether to normalize adjacency by largest eigenvalue prior to calculation of communicability metric. Default: False

Returns:

comm – Symmetric array representing communicability of nodes {i, j}

Return type:

(N, N) numpy.ndarray

References

Estrada, E., & Hatano, N. (2008). Communicability in complex networks. Physical Review E, 77(3), 036111.

Examples

>>> from netneurotools import metrics
>>> A = np.array([[1, 0, 1], [0, 1, 1], [1, 0, 1]])
>>> Q = metrics.communicability_bin(A)
>>> Q
array([[4.19452805, 0.        , 3.19452805],
       [1.47624622, 2.71828183, 3.19452805],
       [3.19452805, 0.        , 4.19452805]])