[Networkit] centrality.ApproxCloseness

Elisabetta Bergamini elisabetta.bergamini at kit.edu
Wed Sep 9 11:05:00 CEST 2015


It’s not supposed to work on disconnected graphs (closeness is defined only on connected graphs).
I agree that an exception should be thrown.

However, there are extensions of the definition of closeness that work also for disconnected graphs, e.g.:
c(v) = (r(v)-1)^2/((n-1)*f(v)), where r(v) is the number of node reachable from v and f(v) is the sum of the distances from v to these nodes.

We could either implement that (also in Closeness, not only in ApproxCloseness) or restrict ourselves to connected graphs and throw an exception.


On Sep 9, 2015, at 10:43, Christian Staudt <christian.staudt at kit.edu> wrote:

> Is that supposed to work on disconnected graphs? An example output for
> 
> centrality.ApproxCloseness(G, 42).run().scores()
> 
> on a disconnected graph looks like this:
> 
> [inf,
>  inf,
>  inf,
>  inf,
>  inf,
>  0.00525,
>  inf,
>  0.008571428571428572,
>  0.07,
>  inf,
>  0.21,
>  inf,
>  inf,
>  0.006885245901639345,
>  0.011052631578947368,
>  0.105,
>  inf,
>  inf,
> 
> Maybe that is on purpose. If not it should throw an exception. Could we please clarify this?
> 
> Best,
> Chris
> 
> _______________________________________________
> NetworKit mailing list
> NetworKit at ira.uni-karlsruhe.de
> https://lists.ira.uni-karlsruhe.de/mailman/listinfo/networkit

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ira.uni-karlsruhe.de/mailman/private/networkit/attachments/20150909/b406a54c/attachment.html>


More information about the NetworKit mailing list