Open deemeetree opened 10 months ago
Hello @deemeetree,
Doesn't it mean I run the community partition twice?
Yes it does mean you are running the partition twice indeed.
Unfortunately the library does not expose a way to both assign the communities to the graph in the same time as returning the details. But there exist 2 workarounds for now:
Hello @Yomguithereal
Thank you for your response.
So what do you think would be the most optimal solution?
As I understand, the first option i get the detailed results (with modularity), then need to reiterate through the graph and assign the community values manually.
In the second option, I didn't quite understand: you suggest I calculate community using the louvain
method above and then calculate it again using the community
metric? Will the result be the same as in louvain
then?
Wouldn't it make sense to expose a method which would both assign and get the results out?
So what do you think would be the most optimal solution?
The second one. Especially if you only need to retrieve the modularity score.
In the second option, I didn't quite understand: you suggest I calculate community using the louvain method above and then calculate it again using the community metric? Will the result be the same as in louvain then?
No, the modularity metric is just a continuous score, not a community partition.
Wouldn't it make sense to expose a method which would both assign and get the results out?
It could indeed, but I don't know what would be the good solution here. Because in your case you want only the modularity score, but some people might want to assign the community and retrieve the dendrogram for instance, so I am not sure, currently, what would be the useful thing to implement yet.
Suppose I want to detect and assign the community structure of a graph to the nodes and to retrieve the modularity measure.
Currently, the documentation proposes these two functions:
In the browser (btw hard to find documentation on this):
In node.js:
Doesn't it mean I run the community partition twice?
Is there a more efficient way to calculate the partition, assign it to the nodes, and retrieve the modularity measure?
Thanks!