cdlib.algorithms.hk_sweep

cdlib.algorithms.hk_sweep(g_original: object, seeds: list, min_comm_size: int = 3, max_comm_size: int = 50, t: float = 5.0, max_k: int = 25) NodeClustering

Heat-kernel sweep-cut seed expansion.

The method approximates heat kernel PageRank with a truncated Poisson/Taylor expansion, then sweeps degree-normalized scores to find the best conductance boundary.

Supported Graph Types

Undirected

Directed

Weighted

Yes

No

Yes

Parameters:
  • g_original – a networkx graph

  • seeds – node list used as personalization seeds

  • min_comm_size – minimum community size, default 3

  • max_comm_size – maximum community size, default 50

  • t – heat diffusion time, default 5.0

  • max_k – Taylor truncation term, default 25

Returns:

NodeClustering object

Example:

>>> from cdlib import algorithms
>>> import networkx as nx
>>> G = nx.karate_club_graph()
>>> coms = algorithms.hk_sweep(G, [0, 2, 3], min_comm_size=3, max_comm_size=10)
References:

Chung, F. The heat kernel as the pagerank of a graph. Journal of Combinatorics, 1(3-4), 269-290, 2009.