grinpy.invariants.residue.k_residue(G, k)

Return the k-residue of G.

The k-residue of a graph G is defined as follows:

\[\frac{1}{k}\sum_{i=0}^{k-1}(k - i)f(i)\]

where f(i) is the frequency of i in the elmination sequence of the graph. The elimination sequence is the sequence of deletions made during the Havel Hakimi process together with the zeros obtained in the final step.

Parameters:G (NetworkX graph) – An undirected graph.
Returns:The k-residue of G.
Return type:float

See also

residue(), havel_hakimi_process(), elimination_sequence()