[Networkit] Inconsistencies in centrality.DegreeCentrality

Maximilian Vogel maximilian.vogel at student.kit.edu
Tue Jun 7 11:19:43 CEST 2016


Hi,

I noticed a few inconsistencies in the DegreeCentrality implementation:

  * When passing normalize=True the values are normalized by the highest
    occurring value. The function maximum() however returns n-1 with n
    being the number of nodes in the graph, where as the documentation
    explicitly states n as it includes the possiblity of a self-loop.
  * Only the out-degree is considered, which is no problem for
    undirected graphs. When passing directed graphs, there is no
    possiblity to specify whether to compute the in- or out-degree (or
    combined) centrality.

I'd take care of the necessary changes once we settled on the desired 
behaviour.

  * For the first issue I suggest to add a flag called
    ignoreSelfloops=True to decide whether to normalize with n or n-1.
    This could also be automatically detected by calling G.hasSelfloops().
  * For directed graphs another flag should be added that the user can
    choose between in- our out-degree. Is it of interest/use to offer
    also a combined degree centrality?

Best,
Max
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ira.uni-karlsruhe.de/pipermail/networkit/attachments/20160607/5ffade1b/attachment.html>


More information about the NetworKit mailing list