cdlib.algorithms.ppr_sweep

cdlib.algorithms.ppr_sweep(g_original: object, seeds: list, min_comm_size: int = 3, max_comm_size: int = 50, alpha: float = 0.85, tol: float = 1e-06) NodeClustering

Personalized PageRank sweep-cut seed expansion.

The method solves the Personalized PageRank linear system from a seed set, degree-normalizes the resulting scores, and returns the sweep prefix with minimum conductance.

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

  • alpha – damping parameter, default 0.85

  • tol – tolerance for the linear solver, default 1e-6

Returns:

NodeClustering object

Example:

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

Andersen, R., Chung, F., & Lang, K. Local Computation of PageRank Contributions. Internet Mathematics, 3(3), 345-367, 2006.