brainconn.core
.kcore_bd¶
-
kcore_bd
(CIJ, k, peel=False)[source]¶ The k-core is the largest subnetwork comprising nodes of degree at least k. This function computes the k-core for a given binary directed connection matrix by recursively peeling off nodes with degree lower than k, until no such nodes remain.
Parameters: - CIJ (NxN
numpy.ndarray
) – binary directed adjacency matrix - k (int) – level of k-core
- peel (bool) – If True, additionally calculates peelorder and peellevel. Defaults to False.
Returns: - CIJkcore (NxN
numpy.ndarray
) – connection matrix of the k-core. This matrix only contains nodes of degree at least k. - kn (int) – size of k-core
- peelorder (Nx1
numpy.ndarray
) – indices in the order in which they were peeled away during k-core decomposition. only returned if peel is specified. - peellevel (Nx1
numpy.ndarray
) – corresponding level - nodes in at the same level have been peeled away at the same time. only return if peel is specified
Notes
‘peelorder’ and ‘peellevel’ are similar the the k-core sub-shells described in Modha and Singh (2010).
- CIJ (NxN