easygraph.functions.core package
Submodules
easygraph.functions.core.k_core module
- easygraph.functions.core.k_core.k_core(G: Graph) Graph | List [source]
Returns the k-core of G.
A k-core is a maximal subgraph that contains nodes of degree k or more.
- Parameters:
G (EasyGraph graph) – A graph or directed graph
k (int, optional) – The order of the core. If not specified return the main core.
return_graph (bool, optional) – If True, return the k-core as a graph. If False, return a list of nodes.
- Returns:
G – The k-core subgraph
- Return type:
EasyGraph graph, if return_graph is True, else a list of nodes