Using label propagation
Label propagation is another fast approach for identifying communities that exist in a network. In my experience, the results haven’t been as good as with the Louvain method, but this is another tool that can be explored as part of community detection. You can read about label propagation at https://arxiv.org/pdf/0709.2938.pdf.
How does it work?
This is an iterative approach. Each node is initialized with a unique label, and during each iteration of the algorithm, each node adopts the label that most of its neighbors have. For instance, if the David node had seven neighbor nodes, and four out of seven neighbors were label 1 with the other three were label 0, then the David node would pick up label 1. During each step of the process, each node picks up the majority label, and the process concludes by grouping nodes with the same labels together as communities.
Label propagation in action!
This algorithm can be imported directly from NetworkX...