networkx.algorithms.core.core_number¶

core_number
(G)[source]¶ Returns the core number for each vertex.
A kcore is a maximal subgraph that contains nodes of degree k or more.
The core number of a node is the largest value k of a kcore containing that node.
Parameters: G (NetworkX graph) – A graph or directed graph Returns: core_number – A dictionary keyed by node to the core number. Return type: dictionary Raises: NetworkXError
– The kcore is not implemented for graphs with self loops or parallel edges.Notes
Not implemented for graphs with parallel edges or self loops.
For directed graphs the node degree is defined to be the indegree + outdegree.
References
[1] An O(m) Algorithm for Cores Decomposition of Networks Vladimir Batagelj and Matjaz Zaversnik, 2003. https://arxiv.org/abs/cs.DS/0310049