graph/pagerank_utils library

PageRank via power iteration on a directed graph (roadmap #541).

Computes the stationary distribution of a random surfer who follows an out-edge with probability damping and teleports to a uniformly random node otherwise. Dangling nodes (no out-edges) would leak probability mass, so their rank is redistributed across all nodes every iteration.

Functions

pageRank(Adjacency graph, {double damping = 0.85, int iterations = 100, double tolerance = 1e-9}) List<double>
PageRank scores for every node, summing to approximately 1.0.