cdlib.algorithms.spinglass

spinglass(g_original: object) → cdlib.classes.node_clustering.NodeClustering

Spinglass relies on an analogy between a very popular statistical mechanic model called Potts spin glass, and the community structure. It applies the simulated annealing optimization technique on this model to optimize the modularity.

Parameters:g_original – a networkx/igraph object
Returns:NodeClustering object
Example:
>>> from cdlib import algorithms
>>> import networkx as nx
>>> G = nx.karate_club_graph()
>>> com = algorithms.spinglass(G)
References:

Reichardt, Jörg, and Stefan Bornholdt. Statistical mechanics of community detection. Physical Review E 74.1 (2006): 016110.