Reference · The Applied Higher-Order Functions catalogue
rainbow.algorithms.proofs.ahof.pagerank
AHoF PageRank: rank the nodes of a directed graph by importance -- the stationary distribution of a random surfer who follows out-links with probability d (the damping factor) and teleports to a uniformly random node with probability 1-d. Computed by POWER ITERATION of the update: pagerank-update teleport damping incoming = teleport + damping * incoming where teleport = (1-d)/N and incoming = sum over in-links q of PR(q)/outdeg(q), over exact-rational ranks. Proved native and axiom-free: the rank update as the affine combination of the teleport term and the damped incoming mass; a worked update (stated as rational equivalence via the cross-product certificate, since the sum of fractions is not in lowest terms); and that a dangling node with no incoming mass keeps only the teleport rank. The link structure and the power-iteration loop are executable; what is proved is the rank-update combination. Requires nnrat/add, nnrat/multiply, nnrat/equivalent (all in the D63 checkpoint). Scope (measured by the kernel): this module has 2 worked instances (statements about specific values). None of its theorems is a guarantee about the algorithm for all inputs; `lein verify rainbow.algorithms.proofs.ahof.pagerank` prints this classification.
pagerank/update
pagerank/update : (x₁ x₂ x₃ : ℚ≥0) → ℚ≥0
ℚ≥0 = nnrat/NonnegativeRational
pagerank/update-example
pagerank/update-example : → pagerank/update 1/4 1/2 1 = 3/4
= = nnrat/equivalent: equality of rational values
pagerank/dangling-keeps-teleport
pagerank/dangling-keeps-teleport : → pagerank/update 1/4 1/2 0 = 1/4
= = nnrat/equivalent: equality of rational values