brainconn.distance.reachdist

reachdist(CIJ, ensure_binary=True)[source]

The binary reachability matrix describes reachability between all pairs of nodes. An entry (u,v)=1 means that there exists a path from node u to node v; alternatively (u,v)=0.

The distance matrix contains lengths of shortest paths between all pairs of nodes. An entry (u,v) represents the length of shortest path from node u to node v. The average shortest path length is the characteristic path length of the network.

Parameters:
  • CIJ (NxN numpy.ndarray) – binary directed/undirected connection matrix
  • ensure_binary (bool) – Binarizes input. Defaults to true. No user who is not testing something will ever want to not use this, use distance_wei instead for unweighted matrices.
Returns:

Notes

faster but more memory intensive than “breadthdist.m”.