cdlib.algorithms.walkscan

cdlib.algorithms.walkscan(g_original: object, nb_steps: int = 2, eps: float = 0.1, min_samples: int = 3, init_vector: dict | None = None) NodeClustering

Random walk community detection method leveraging PageRank node scoring.

Supported Graph Types

Undirected

Directed

Weighted

Yes

No

No

Parameters:
  • g_original – a networkx/igraph object

  • nb_steps – the length of the random walk

  • eps – DBSCAN eps

  • min_samples – DBSCAN min_samples

  • init_vector – dictionary node_id -> initial_probability to initialize the random walk. Default, random selected node with probability set to 1.

Returns:

NodeClustering object

Example:

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

Hollocou, A., Bonald, T., & Lelarge, M. (2016). Improving PageRank for local community detection. arXiv preprint arXiv:1610.08722.

Note

Reference implementation: https://github.com/ahollocou/walkscan