QuintineSol / DCiA

Data Consultancy in Action
0 stars 0 forks source link

Add a set number of communities to be set by the user #83

Open WouterMulder9 opened 2 months ago

imbanunes commented 2 months ago

Limiting the maximum number of communities directly in algorithms such as Fast Greedy, Louvain, Girvan-Newman, and Walktrap can be challenging due to their inherent design and method of operation, which do not typically include a parameter to set or cap the number of communities. These algorithms are structured around optimizing certain properties (like modularity or betweenness centrality) and not on achieving a specific number of communities. Likewise, it is not a common practice to predefine a number of communities for detection.

This is not a common practice and we should refrain from finding workarounds to make it work. Alternatively, we could use clustering. I tried implementing both K-means Clustering and Spectral Clustering. I found neither to yield meaningful communities. Here are some more details about these:

Through spectral clustering, the results would not mimic those of other algorithms at all. I got one huge community and then k-1 communities of roughly one node.

CONCLUSION: do not limit the number of communities. This was just a fun pastime :)