Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/plm with custom initialization #784

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

jukaradayi
Copy link

This is a suggestion to add a partition as an optional parameter for the PLM algorithm. This partition can then be used to initialize the PLM.
This is particularly useful (in my case) when dealing with dynamic graphs, to check the influence of new links on current communities.

The PLM run can still be called without a partition and would run as usual; the CI is unaffected.

@@ -33,7 +34,7 @@ class PLM final : public CommunityDetectionAlgorithm {
* @param[in] recurse use recursive coarsening, see http://journals.aps.org/pre/abstract/10.1103/PhysRevE.89.049902 for some explanations (default: true)
*
*/
PLM(const Graph& G, bool refine=false, double gamma = 1.0, std::string par="balanced", count maxIter=32, bool turbo = true, bool recurse = true);
PLM(const Graph& G, bool refine=false, double gamma = 1.0, std::string par="balanced", count maxIter=32, bool turbo = true, bool recurse = true, Partition zeta=Partition(0));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding an initial partition looks like a good idea. However, the parameter list is already quite long and setting the partition this way seems inconvenient. What about adding a setInitialPartition method? This method could also be overloaded to also take an rvalue ref, so that we can avoid unnecessary copies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants