Defined in File DegreeCentrality.hpp
public NetworKit::Centrality
(Class Centrality)
Node centrality index which ranks nodes by their degree. Optional normalization by maximum degree.
Public Functions
Constructs the DegreeCentrality class for the given Graph G. If the centrality scores should be normalized, then set normalized to true
. run() runs in O(n) time if ignoreSelfLoops is false or the graph has no self-loops; otherwise it runs in O(m).
G – The graph.
normalized – Set this parameter to true
if scores should be normalized in the interval [0,1].
outDeg – If set to true
, computes the centrality based on the out-degrees, otherwise based on the in-degrees.
ignoreSelfLoops – If set to true
, self loops will not be taken into account.
Computes degree centraity on the graph passed in constructor.
the theoretical maximum degree centrality, which is $n$ (including the possibility of a self-loop)