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

dga-graphx LouvainCore.louvain do-while loop #82

Open
5abhim opened this issue Jan 20, 2015 · 3 comments
Open

dga-graphx LouvainCore.louvain do-while loop #82

5abhim opened this issue Jan 20, 2015 · 3 comments

Comments

@5abhim
Copy link

5abhim commented Jan 20, 2015

Thanks a lot for making your implementation public. I am able to understand this do-while in bits and pieces but not fully. I am not able to understand when this loop breaks
{
(stop <= progressCounter && (even || (updated > 0 && count < maxIter)))
}
This loop should break only when even=false (means on odd cycles). Would you be kind to explain this do-while loop in detail?

Also you compress this graph to a new graph only when numberOfPasses (=2*count) > 2, why?
Thanks in advance.

@5abhim
Copy link
Author

5abhim commented Apr 16, 2015

I am still waiting for your comments. It will be a great help for me.
LouvainCore.louvain() - I am not able to understand why you have communityRDD as Map[(communityId, commnitySigmaTotal), edgeWeightSum]. May be my understanding is wrong but I think we will have only one commnitySigmaTotal for one communityId so why do we have commnitySigmaTotal as a part of Map key?
In other words, it is possible to have one vertex with one communityId but different commnitySigmaTotal?

@eric-kimbrel
Copy link
Contributor

Hello. To my knowledge no one here has been working on this project for awhile now, so I am sure there are issues to be found and improvements to be made. That said here are the answers to your questions.

  1. Loop condition. Its correct that the loop only breaks on odd cycles. Thats because nodes are restricted in their movement to move only to higher numbered communities on even cycles and lower numbered communities on odd cycles. This slows down computation but prevents a very common case where nodes enter an infinite loop continually switching back and forth to each others community.
  2. graph compression condition. we only decide to compress the graph and continue the louvain process if a significant amount of work has been done, otherwise we find that there may be many levels of compression that make very little change to the overall graph and take up a lot of computation time while adding very little value. 2* count refers to the number of full cycles, (every node in the graph has had the chance to move this many times). We decided that if it took 2 or fewer full cycles to stop making progress graph compression and another iteration of the algorithm would likely be un-necessary.
  3. community stats - I think you are correct, for any given communityId the sigmal total and edgeWeightSum should be the same, so only the Id should need to be in the map key.

@5abhim
Copy link
Author

5abhim commented Jul 23, 2015

Thanks Eric for your response. Regarding loop condition: node movement from low->high communities (odd cycle) and hight->low (even cycle). You mentioned just opposite that made me confuse.
(even && louvainData.community > bestCommunity) || (!even && louvainData.community < bestCommunity)

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

No branches or pull requests

2 participants