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

Add Leiden community detection algorithm? #191

Open
nicolaspayette opened this issue Mar 26, 2019 · 1 comment
Open

Add Leiden community detection algorithm? #191

nicolaspayette opened this issue Mar 26, 2019 · 1 comment

Comments

@nicolaspayette
Copy link
Member

This got published today: https://www.nature.com/articles/s41598-019-41695-z

A Java implementation is available at https://github.com/CWTSLeiden/networkanalysis.

I haven't looked at any of it in details, but it might warrant future consideration.

@qiemem
Copy link
Member

qiemem commented Mar 28, 2019

Thanks @nicolaspayette! That paper looks great. The point about disconnected communities in Louvain is really interesting; obvious in retrospect, but never occurred to me before.

Looks like the algorithm is broadly as follows. Initialize each node to its singleton community, then:

  1. Locally move nodes between communities to maximize objective function. It uses a faster local move than Louvain; nodes are processed in a queue. When you move a node, you add any of its neighbors to the queue that aren't in its new community. This way, you don't have to scan every node every pass. Pretty clever; this is strictly better than the traditional Louvain local move, yes? I think it could actually be incorporated into Louvain without impacting behavior.
  2. This is the new bit that adds the new guarantees; within each community:
    a. Put each node in a singleton subcommunity
    b. Merge subcommunities that are well connected. I don't totally get this step. Looking at the pseudocode, it looks like will only merge singletons into a subcommunity, but that seems a little weird to me. It will only merge into subcommunities that are sufficiently well connected to the other subcommunities, and randomly merges weighted on how much it improves the objective function.
    c. Replace the original community with the subcommunities in a new partition.
  3. Use the partition generated in 2 to create a meta-network, Louvain-style. Repeat steps until nothing changes.

It inherits the gamma parameter from CPM (which I hadn't heard of until this paper; definitely something we should consider adding). Gamma here then defines how well connected and well separated the communities are. For a community C and subset S, S and C-S will have at least gamma * ||S|| * ||C - S|| internal links. This is the main guarantee that this algorithm has over Louvain.

They also say the algorithm is faster, though AFAICT, most of that speed boost comes from the fast local move, which (again AFAICT) could be used in Louvain.

Anyway, great find @nicolaspayette!

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

No branches or pull requests

2 participants