-
Notifications
You must be signed in to change notification settings - Fork 5
Description
In testing the clustering given by the louvain_communities algorithm I found that the resolution parameter worked counter to literature behaviour and also stated documentation behaviour.
As the resolution increases we expect the size of the communities to get smaller, but as implemented we see precisely the inverse behaviour. A brief look at louvain.rs I think reveals the error, specifically in the function Modularity::q calculating the change in modularity when an isolated vertex
You include the scaling factor of
Note that
self.resolution_over_m * d_ij - (d_i * d_j) / (self.m_half * self.m)
The resolution is in front of the first term. This is a problem because there's no way for us to try fix it from the outside. This is a trivial fix to simply move the resolution parameter over (and presumably change some cached values) but I'm unfamiliar with pull requests and the like so didn't want to mess anything up.