cdlib.algorithms.wCommunity

wCommunity(g_original: object, min_bel_degree: float = 0.7, threshold_bel_degree: float = 0.7, weightName: str = 'weight') → cdlib.classes.node_clustering.NodeClustering

Algorithm to identify overlapping communities in weighted graphs

Supported Graph Types

Undirected Directed Weighted
Yes No Yes
Parameters:
  • g_original – a networkx/igraph object
  • min_bel_degree – the tolerance, in terms of beloging degree, required in order to add a node in a community
  • threshold_bel_degree – the tolerance, in terms of beloging degree, required in order to add a node in a ‘NLU’ community
  • weightName – name of the edge attribute containing the weights
Returns:

NodeClustering object

Example:
>>> from cdlib import algorithms
>>> import networkx as nx
>>> G = nx.karate_club_graph()
>>> nx.set_edge_attributes(G, values=1, name='weight')
>>> coms = algorithms.wCommunity(G, min_bel_degree=0.6, threshold_bel_degree=0.6)
References:

Chen, D., Shang, M., Lv, Z., & Fu, Y. (2010). Detecting overlapping communities of weighted networks via a local algorithm. Physica A: Statistical Mechanics and its Applications, 389(19), 4177-4187.

Note

Implementation provided by Marco Cardia <cardiamc@gmail.com> and Francesco Sabiu <fsabiu@gmail.com> (Computer Science Dept., University of Pisa, Italy)