Message Boards Message Boards

2
|
7675 Views
|
3 Replies
|
7 Total Likes
View groups...
Share
Share this post:

What method does FindGraphCommunities use with Method -> "Centrality"?

Posted 6 years ago

Cross-posted to M.SE


I would like to know what method FindGraphCommunities uses with the option Method -> "Centrality" when given an edge-weighted graph.

Based on the name of the Method option value, I think it is not unreasonable to assume that it uses the Girvan–Newman algorithm, described in dx.doi.org/10.1073/pnas.122653799 and also in the review paper https://arxiv.org/abs/0906.0612 (see section V.A).

This method constructs a hierarchical clustering tree by repeatedly removing the graph edge with the highest edge betweenness.

This does not appear to be the case, as evidenced by the following example:

g = Graph3D[{1 <-> 2, 2 <-> 3, 3 <-> 1, 4 <-> 5, 5 <-> 6, 6 <-> 4, 1 <-> 4, 2 <-> 5, 3 <-> 6}, 
  EdgeWeight -> {1, 1, 1, 1, 1, 1, 5, 5, 5}]

FindGraphCommunities[g, Method -> "Centrality"]
(* {{1, 4}, {2, 5}, {3, 6}} *)

This result couldn't have been obtained with a direct application of the Girvan–Newman algorithm because the edges 1 <-> 4, 2 <-> 5, 3 <-> 6 have the highest betweenness, therefore they are removed first.

EdgeBetweennessCentrality[g]
(* {4., 4., 4., 4., 4., 4., 6., 6., 6.} *)

So far I was able to get the following information from WRI: FindGraphCommunities implements methods from the paper https://arxiv.org/abs/0906.0612 However, I do not know which specific method is being used in this particular case, and how Mathematica arrives to this result. The problem of community detection is not precisely defined in network science. There are many different methods which may be reasonable in different situations. Therefore I couldn't possibly use such a result in a published paper without knowing how Mathematica obtained it.

I do not need to know how Mathematica computes e.g. eigenvalues to understand what an eigenvalue is, or even to verify that the result it gave me is correct. The situation with FindGraphCommunities is different: what it computes and how it computes it are basically the same question.

While I tagged this as implementation-details on M.SE, I want to emphasize that this question is really about what this function is doing at all, not how it does it. Of what use is such a function if users don't know what it really does?


If I am misunderstanding something, please do correct me.

POSTED BY: Szabolcs Horvát
3 Replies

I'd like to suggest including this information in the documentation itself.

Many people have asked about these methods, and generally, it proved to be difficult to get information in the past.

Having them included in Mathematica can be very useful—but only if they are actually documented. If they are not documented, then all the effort that went into implementing them would be a waste.

Another comment is that it is rare to see any paper references within the Mathematica documentation. This is not specific to the graph/network stuff, so I suspect that it is done this way intentionally. The Tutorials do frequently have them, but I can't recall a single reference page that does. In this specific case, the best way to document the function would be to simply give references like Jaebum did above. There is just not enough room to explain the methods in full in a reference page, but a few references could take care of this.

POSTED BY: Szabolcs Horvát

Hi Jaebum,

Thank you, that's exactly what I was looking for.

If you also post this on M.SE, I'll accept there. Otherwise, I'll post it myself with a link to W|C.

POSTED BY: Szabolcs Horvát
Posted 6 years ago

P 24 in the paper you mentioned,

The method can be simply extended to the case of weighted graphs, by suitably generalizing the edge betweenness. The betweenness of a weighted edge equals the betweenness of the edge in the corresponding unweighted graph, divided by the weight of the edge

So,

g2 = Graph3D[{1 <-> 2, 2 <-> 3, 3 <-> 1, 4 <-> 5, 5 <-> 6, 6 <-> 4, 
    1 <-> 4, 2 <-> 5, 3 <-> 6}];
EdgeBetweennessCentrality[g2]/{1, 1, 1, 1, 1, 1, 5, 5, 5}
(*{4., 4., 4., 4., 4., 4., 1.2, 1.2, 1.2}*)

{1 <-> 2, 2 <-> 3, 3 <-> 1, 4 <-> 5, 5 <-> 6, 6 <-> 4} are edges with the highest centrality. Compare the result with

FindGraphCommunities[g2, Method -> "Centrality"]
(*{{1, 2, 3}, {4, 5, 6}}*) 
POSTED BY: Jaebum Jung
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract