Power iteration converges to the unique PageRank vector full
This proof shows: correctness, termination.
We use the notation of the page. Vectors are row vectors, ∥z∥1=∑v∣zv∣, and Δ={x∈Rn:x≥0,∑vxv=1} is the set of probability vectors. Let 0≤α<1.
The matrices. Let S be the n×n matrix with Suv=cuv/d+(u) when d+(u)>0, and Suv=1/n when u is dangling. Each row of S is non-negative and sums to 1, so S is stochastic. Let J=n111T. The Google matrix is P=αS+(1−α)J, which is the matrix of the page: for a dangling u, α/n+(1−α)/n=1/n.
Lemma 1 (one round computes xP). If x∈Δ at the start of a round, then at the end of line L6, y=xP, and y∈Δ.
Proof. After line L5, yv=∑(u,v)∈Exu/d+(u)=∑u:d+(u)>0xuSuv, because the cuv copies of an arc from u to v each add xu/d+(u). Line L4 sets d=∑u danglingxu, and ∑u danglingxuSuv=d/n. So after line L6,
yv=αu∑xuSuv+n1−α=α(xS)v+(1−α)(xJ)v=(xP)v, where (xJ)v=n1∑uxu=n1 because x∈Δ. Every entry of P is non-negative and each row sums to 1, so xP≥0 and ∑v(xP)v=∑uxu=1. □
Lemma 2 (S does not expand the L1 norm). For every z∈Rn, ∥zS∥1≤∥z∥1.
Proof. ∥zS∥1=∑v∣∑uzuSuv∣≤∑v∑u∣zu∣Suv=∑u∣zu∣∑vSuv=∥z∥1. □
Lemma 3 (contraction). For x,x′∈Δ, ∥xP−x′P∥1≤α∥x−x′∥1.
Proof. Let z=x−x′. Then ∑uzu=0, so zJ=0, and zP=αzS. By Lemma 2, ∥zP∥1≤α∥z∥1. □
Theorem. (a) There is exactly one π∈Δ with π=πP. (b) Let x(0) be the uniform vector of line L1 and x(k) the vector after k rounds. Then ∥x(k)−π∥1≤2αk. (c) The loop stops after a finite number of rounds, and the returned vector x satisfies ∥x−π∥1≤αε/(1−α).
Proof. By Lemma 1 and induction on k, every x(k) lies in Δ and x(k+1)=x(k)P.
(a) The set Δ is a closed subset of Rn, so it is complete under ∥⋅∥1. By Lemma 1 the map f(x)=xP sends Δ into Δ, and by Lemma 3 it is a contraction with factor α<1. The Banach fixed-point theorem gives exactly one fixed point π∈Δ. For a direct proof of uniqueness: if π and π′ are both fixed, then ∥π−π′∥1=∥πP−π′P∥1≤α∥π−π′∥1, so ∥π−π′∥1=0.
(b) Since π=πP, Lemma 3 gives ∥x(k+1)−π∥1=∥x(k)P−πP∥1≤α∥x(k)−π∥1. By induction, ∥x(k)−π∥1≤αk∥x(0)−π∥1. Two probability vectors are at L1 distance at most ∥x(0)∥1+∥π∥1=2.
(c) Termination. The value of δ computed in round k≥1 is δ(k)=∥x(k)−x(k−1)∥1. By Lemma 3 applied k−1 times, δ(k)≤αk−1δ(1)≤2αk−1. If α=0, then $x^{(1)} = x^{(0)}P = $ the uniform vector, so δ(1)=0<ε and the loop stops after one round. If 0<α<1, then 2αk−1<ε as soon as k−1>log(ε/2)/logα, so the loop stops after at most ⌈log(ε/2)/logα⌉+1 rounds.
Error at the stop. Let the loop stop after round k, so δ(k)<ε and the result is x=x(k). By the triangle inequality and (b),
∥x(k−1)−π∥1≤∥x(k−1)−x(k)∥1+∥x(k)−π∥1≤δ(k)+α∥x(k−1)−π∥1, so ∥x(k−1)−π∥1≤δ(k)/(1−α). Then ∥x(k)−π∥1≤α∥x(k−1)−π∥1≤αδ(k)/(1−α)<αε/(1−α). ■
The fixed point is the PageRank vector. The equation π=πP, read entry by entry with ∑uπu=1, is the formula of the page: πv=α∑(u,v)∈Eπu/d+(u)+nα∑u danglingπu+n1−α. Since every entry of P is at least (1−α)/n, the chain is irreducible and aperiodic for α<1, and π is its stationary distribution.