conductance(graph: <Mock id='139911972696336'>, 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

  • 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.

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


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

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