easygraph.functions.community.modularity_max_detection module#
- easygraph.functions.community.modularity_max_detection.greedy_modularity_communities(G, weight='weight')[source]#
Communities detection via greedy modularity method.
Find communities in graph using Clauset-Newman-Moore greedy modularity maximization. This method currently supports the Graph class.
Greedy modularity maximization begins with each node in its own community and joins the pair of communities that most increases modularity until no such pair exists.
- Parameters:
G (easygraph.Graph or easygraph.DiGraph) –
weight (string (default : 'weight')) – The key for edge weight. For undirected graph, it will regard each edge weight as 1.
- Return type:
Yields sets of nodes, one for each community.
References
[1]Newman, M. E. J. “Networks: An Introduction Oxford Univ.” (2010).
[2]Clauset, Aaron, Mark EJ Newman, and Cristopher Moore.
“Finding community structure in very large networks.” Physical review E 70.6 (2004): 066111.