cdlib.evaluation.modularity_overlap

modularity_overlap(graph: <Mock id='140619399401296'>, communities: object, weight: str = None) → cdlib.evaluation.fitness.FitnessResult

Determines the Overlapping Modularity of a partition C on a graph G.

Overlapping Modularity is defined as

\[M_{c_{r}}^{ov} = \sum_{i \in c_{r}} \frac{\sum_{j \in c_{r}, i \neq j}a_{ij} - \sum_{j \not \in c_{r}}a_{ij}}{d_{i} \cdot s_{i}} \cdot \frac{n_{c_{r}}^{e}}{n_{c_{r}} \cdot \binom{n_{c_{r}}}{2}}\]
Parameters:
  • graph – a networkx/igraph object
  • communities – NodeClustering object
  • weight – label identifying the edge weight parameter name (if present), default None
Returns:

FitnessResult object

Example:

>>> from cdlib.algorithms import louvain
>>> from cdlib import evaluation
>>> g = nx.karate_club_graph()
>>> communities = louvain(g)
>>> mod = evaluation.modularity_overlap(g, communities)
References:
    1. Lazar, D. Abel and T. Vicsek, “Modularity measure of networks with overlapping communities” EPL, 90 (2010) 18001 doi: 10.1209/0295-5075/90/18001