cdlib.evaluation.conductance

conductance(graph: <Mock id='140619399399760'>, community: object, summary: bool = True) → object

Fraction of total edge volume that points outside the community.

\[f(S) = \frac{c_S}{2 m_S+c_S}\]

where \(c_S\) is the number of community nodes and, \(m_S\) is the number of community edges

Parameters:
  • graph – a networkx/igraph object
  • community – NodeClustering object
  • summary – boolean. If True it is returned an aggregated score for the partition is returned, otherwise individual-community ones. Default True.
Returns:

If summary==True a FitnessResult object, otherwise a list of floats.

Example:

>>> from cdlib.algorithms import louvain
>>> from cdlib import evaluation
>>> g = nx.karate_club_graph()
>>> communities = louvain(g)
>>> mod = evaluation.conductance(g,communities)
References:

1.Shi, J., Malik, J.: Normalized cuts and image segmentation. Departmental Papers (CIS), 107 (2000)