It is possible to set 2 options for one of FindGraphCommunities's methods "Modularity". They are "Weighted" and "StopTest".
The question is how can one use the second option "StopTest"? What values/pure functions does it take?
It is possible to set 2 options for one of FindGraphCommunities's methods "Modularity". They are "Weighted" and "StopTest".
The question is how can one use the second option "StopTest"? What values/pure functions does it take?
Method "Modularity" starts with each vertex in its own community and then iteratively merges them to maximize the proportion of edges contained within communities minus the expected proportion that would be in the communities if the edges were randomly placed.
Details here: http://en.wikipedia.org/wiki/Modularity_(networks)
The "StopTest" option expects a boolean-valued function that takes the graph as the first parameter and the list of vertex communities for the current iteration as the second parameter. You can, for example, use the stop test to halt the merging of communities early if there is a specific number of communities that you want to be returned. Using an example from the documentation that contains three communities with default options, we can stop it early to find five communities.
g = Graph[{1 \[UndirectedEdge] 2, 2 \[UndirectedEdge] 3,
1 \[UndirectedEdge] 3, 3 \[UndirectedEdge] 4,
4 \[UndirectedEdge] 5, 7 \[UndirectedEdge] 6,
8 \[UndirectedEdge] 6, 5 \[UndirectedEdge] 7,
7 \[UndirectedEdge] 8}]
FindGraphCommunities[g,
Method -> {"Modularity", "StopTest" -> (Length@#2 == 5 &)}]
FindGraphCommunitiesI only see theMethodoption. – bill s Jul 03 '13 at 18:05OptionName->"Weighted"orOptionName->"StopTest". So it's not clear these options are really implemented. Have you been able to do anything with them? – bill s Jul 04 '13 at 08:01Weighted->Falseanalyzes a weighted graph as if it were unweighted. Not sure aboutStopTest. If you find any documentation about these, please post so we can all see it. – bill s Jul 04 '13 at 16:45