rustworkx.digraph_core_number#
- digraph_core_number(graph, /)#
Return the core number for each node in the directed graph.
A k-core is a maximal subgraph that contains nodes of degree k or more. For directed graphs, the degree is calculated as in_degree + out_degree.
Note
The function implicitly assumes that there are no parallel edges or self loops. It may produce incorrect/unexpected results if the input graph has self loops or parallel edges.
- Parameters:
PyDiGraph – The directed graph to get core numbers
- Returns:
A dictionary keyed by node index to the core number
- Return type:
dict