taynaud / python-louvain

Louvain Community Detection
BSD 3-Clause "New" or "Revised" License
964 stars 200 forks source link

How to trace the process of community evolution? #57

Closed tomorrow1pan closed 4 years ago

tomorrow1pan commented 4 years ago

Thanks @taynaud ! Very appreciate this projects. It helps me a lot.

Now the problem is when I study these communities how to evolve (new nodes and relationships will be added into the graph with time), it will generate new community ids everytime. I failed to fix ids on these existing communities to trace the process of community evolution.

For example, this month I find a community {'a': 1, 'b': 1, 'c': 1, 'd': 1}. It has four nodes: 'a', 'b', 'c', 'd'. A week later, New nodes, 'e' and 'f', join this community. But when I restart the code, I get a community {'a': 2, 'b': 2, 'c': 2, 'd': 2, 'e': 2, 'f': 2}. It's difficult to know the community 1 and community 2 are the same community actually, just in diffrent time. How can I solve this problem? Thanks.

taynaud commented 4 years ago

Hello,

In fact, even with exactly the same network, you would observe differences. I study a similar cases in http://hal.archives-ouvertes.fr/inria-00492058/en/

The experiment is to run several community detection on a fake dynamic: removing nodes one by one.

I observe that many nodes change of communities even without any structural change (removing one random node is not in general a deep structural change of the network).

I also propose some solution to do the matching between 2 partitions, but I do not believe that these algorithm should be implemented in this package for the moment.

If you have more questions, do not hesitate,

Best,