cdlib.algorithms.scd

scd(g_original: object, iterations: int = 25, eps: float = 1e-06, seed: int = 42) → cdlib.classes.node_clustering.NodeClustering

The procedure greedily optimizes the approximate weighted community clustering metric. First, clusters are built around highly clustered nodes. Second, we refine the initial partition by using the approximate WCC. These refinements happen for the whole vertex set.

Supported Graph Types

Undirected Directed Weighted
Yes No No
Parameters:
  • g_original – a networkx/igraph object
  • iterations – Refinemeent iterations. Default is 25.
  • eps – Epsilon score for zero division correction. Default is 10**-6.
  • seed – Random seed value. Default is 42.
Returns:

NodeClustering object

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

Prat-Pérez, A., Dominguez-Sal, D., & Larriba-Pey, J. L. (2014, April). High quality, scalable and parallel community detection for large real graphs. In Proceedings of the 23rd international conference on World wide web (pp. 225-236).

Note

Reference implementation: https://karateclub.readthedocs.io/