cdlib.algorithms.belief¶
-
belief
(g_original, max_it=100, eps=0.0001, reruns_if_not_conv=5, threshold=0.005, q_max=7)¶ Belief community seeks the consensus of many high-modularity partitions. It does this with a scalable message-passing algorithm, derived by treating the modularity as a Hamiltonian and applying the cavity method.
Parameters: - g_original – a networkx/igraph object
- max_it –
- eps –
- reruns_if_not_conv –
- threshold –
- q_max –
Returns: NodeClustering object
Example: >>> from cdlib import algorithms >>> import networkx as nx >>> G = nx.karate_club_graph() >>> coms = algorithms.belief(G)
References: Zhang, Pan, and Cristopher Moore. “Scalable detection of statistically significant communities and hierarchies, using message passing for modularity.” Proceedings of the National Academy of Sciences 111.51 (2014): 18144-18149.
Note
Reference implementation: https://github.com/weberfm/belief_propagation_community_detection