Exemple #1
0
def erange(cmatrix):
    """ Computes the range for each edge (i.e., the shortest path length
    between the nodes it connects after the edge has been removed from the
    graph). Shorcuts are links which significantly reduce the characteristic
    path length. This function detects shortcuts, hence being a variant of
    edge betweenness centrality.
    
    Parameters
    ----------
    cmatrix : connection/adjacency matrix
    
    Returns
    -------

    Erange : range for each edge, i.e. the length of the 
             shortest path from i to j for edge c(i,j) AFTER the edge 
             has been removed from the graph.

    eta      average range for entire graph.
    Eshort   entries are ones for edges that are shortcuts.
    fs       fraction of shortcuts in the graph.

    Follows the treatment of 'shortcuts' by Duncan Watts (1999)
    
    Olaf Sporns, Indiana University, 2002/2007/2008

    """
    m = bct.to_gslm(cmatrix.tolist())
    era = bct.erange(m)
    eranp = bct.from_gsl(era)
    bct.gsl_free(m)
    bct.gsl_free(era)
    return np.asarray(eranp)
Exemple #2
0
def erange(cmatrix):
    """ Computes the range for each edge (i.e., the shortest path length
    between the nodes it connects after the edge has been removed from the
    graph). Shorcuts are links which significantly reduce the characteristic
    path length. This function detects shortcuts, hence being a variant of
    edge betweenness centrality.
    
    Parameters
    ----------
    cmatrix : connection/adjacency matrix
    
    Returns
    -------

    Erange : range for each edge, i.e. the length of the 
             shortest path from i to j for edge c(i,j) AFTER the edge 
             has been removed from the graph.

    eta      average range for entire graph.
    Eshort   entries are ones for edges that are shortcuts.
    fs       fraction of shortcuts in the graph.

    Follows the treatment of 'shortcuts' by Duncan Watts (1999)
    
    Olaf Sporns, Indiana University, 2002/2007/2008

    """
    m = bct.to_gslm(cmatrix.tolist())
    era = bct.erange(m)
    eranp = bct.from_gsl(era)
    bct.gsl_free(m)
    bct.gsl_free(era)
    return np.asarray(eranp)
Exemple #3
0
def erange(*args):
  return _bct.erange(*args)
Exemple #4
0
def erange(*args):
    return _bct.erange(*args)
Exemple #5
0
def erange(*args):
  """erange(gsl_matrix CIJ) -> gsl_matrix"""
  return _bct.erange(*args)
Exemple #6
0
def erange(*args):
    """erange(gsl_matrix CIJ) -> gsl_matrix"""
    return _bct.erange(*args)