cdlib.algorithms.chinesewhispers

chinesewhispers(g_original: object, weighting: str = 'top', iterations: int = 20, seed: int = None) → cdlib.classes.node_clustering.NodeClustering

Fuzzy graph clustering that (i) creates an intermediate representation of the input graph, which reflects the “ambiguity” of its nodes, and (ii) uses hard clustering to discover crisp clusters in such “disambiguated” intermediate graph.

Parameters:
  • g_original
  • weighting – edge weighing schemas. Available modalities: [‘top’, ‘lin’, ‘log’]
  • iterations – number of iterations
  • seed – random seed
Returns:

NodeClustering object

Example:
>>> from cdlib import algorithms
>>> import networkx as nx
>>> G = nx.karate_club_graph()
>>> coms = algorithms.chinesewhispers(G)
References:

Ustalov, D., Panchenko, A., Biemann, C., Ponzetto, S.P.: `Watset: Local-Global Graph Clustering with Applications in Sense and Frame Induction.`_ Computational Linguistics 45(3), 423–479 (2019)

Note

Reference implementation: https://github.com/nlpub/chinese-whispers-python