def charpath(D): """ Distance based measures This function outputs four distance based measures. Characteristic path length is the average shortest path length. Node eccentricity is the maximal shortest path length between a node and any other node. Network radius is the minimum eccentricity, while network diameter is the maximum eccentricity. Characteristic path length is calculated as the global mean of the distance matrix D, not taking into account any 'Infs' but including the distances on the main diagonal. Parameters ---------- D : distance matrix Returns ------- ecc : eccentricity (for each vertex) Notes ----- The radius of the graph is min(ecc) The diameter of the graph is max(ecc) See Also -------- charpath_lambda(D) for characteristic path length Olaf Sporns, Indiana University, 2002/2007/2008 """ m = bct.to_gslm(D.tolist()) str = bct.charpath_ecc(m) strnp = bct.from_gsl(str) bct.gsl_free(m) bct.gsl_free(str) return np.asarray(strnp)
def charpath_ecc(*args): return _bct.charpath_ecc(*args)
def charpath_ecc(*args): """charpath_ecc(gsl_matrix D) -> gsl_vector""" return _bct.charpath_ecc(*args)