A Bit of History
Larry Page and Sergey Brin, then Stanford PhD students, described PageRank in a 1998 technical report, "The PageRank Citation Ranking: Bringing Order to the Web," and the same year in "The Anatomy of a Large-Scale Hypertextual Web Search Engine" — the paper that effectively described the founding architecture of Google. The algorithm's core mathematical idea — ranking importance via a graph's dominant eigenvector — connects directly back to the spectral graph theory of Part 20, applied here to a directed "who links to whom" web graph rather than an undirected graph.
Working Principle: The Random Surfer
Model a hypothetical "random surfer" browsing the web: at each step, with probability \(d\) (the damping factor, typically 0.85), they click a uniformly random outgoing link on the current page; with probability \(1-d\), they instead "teleport" to a uniformly random page anywhere on the web (modeling someone typing a fresh URL rather than following a link). A page's PageRank is defined as the long-run fraction of time this random surfer spends on that page:
$$PR(p) = \frac{1-d}{N} + d \sum_{q \to p} \frac{PR(q)}{L(q)}$$
where \(N\) is the total number of pages, the sum runs over every page \(q\) linking to \(p\), and \(L(q)\) is the number of outgoing links on page \(q\) (so each page distributes its rank equally among its own outgoing links).
Key Insight
This equation is self-referential — a page's rank depends on the ranks of pages linking to it, which themselves depend on the ranks of pages linking to them. This is precisely the defining property of an eigenvector: the PageRank vector \(\mathbf{PR}\) satisfies \(\mathbf{PR} = M \mathbf{PR}\) for an appropriately constructed transition matrix \(M\), meaning PageRank is exactly the dominant eigenvector (eigenvalue 1) of the web's link-following transition matrix.
Worked Example
Consider 3 pages: A links to B and C; B links only to C; C links only to A. Initializing all three pages with equal rank \(1/3\), one iteration redistributes rank according to the linking structure: C receives contributions from both A (split between B and C) and B (all going to C), quickly accumulating the highest rank, since it is the most "linked-to" page overall — reflecting the intuitive idea that pages many other pages point to should rank higher, exactly like citation counts in academic papers, which directly inspired the algorithm's name and original framing.
Why Power Iteration Converges
Computing PageRank via power iteration — repeatedly applying the update equation to an initial guess vector, normalizing, and repeating — is guaranteed to converge to the true dominant eigenvector because the damping factor \(d < 1\) guarantees the transition matrix is irreducible and aperiodic (the "teleportation" possibility ensures every page can, in principle, reach every other page), which by the Perron-Frobenius theorem guarantees a unique dominant eigenvalue of exactly 1, with an all-positive eigenvector that power iteration is mathematically guaranteed to converge toward regardless of the starting guess.
Complexity Analysis
Each power iteration step touches every edge once, and convergence typically requires \(O(\log N)\) iterations in practice for web-scale graphs (formally bounded by the "spectral gap" between the top two eigenvalues):
$$\text{Time per iteration: } O(E) \qquad \text{Total: } O(E \log N) \text{ (typical practical convergence)}$$
This linear-per-iteration cost is precisely why PageRank scales to web-sized graphs with billions of pages — and precisely why it is a natural candidate for the distributed Pregel-style "think like a vertex" processing model from Part 23, since each iteration only requires each page to exchange rank estimates with its direct neighbors.
Implementation
Real-World Applications
Beyond the Web: Citation Networks & Recommendation Systems
Though designed for web pages, PageRank's underlying mathematics — importance flows through a directed graph based on incoming connections, weighted by the importance of the source — applies directly to academic citation networks (ranking papers by citation importance, not just citation count), and to recommendation systems modeling "users who bought X also bought Y" as a directed graph, where PageRank-style scores surface globally influential items rather than just locally popular ones.
Exercises
- Trace through 2-3 power iterations by hand on the 3-page worked example, confirming that page C's rank grows fastest across iterations.
- Explain, in your own words, why the damping factor \(d < 1\) (teleportation) is necessary for the algorithm to converge, connecting this to the Perron-Frobenius theorem's irreducibility requirement.
- Modify the implementation to correctly redistribute a "dangling page" (a page with zero outgoing links) rank uniformly across all pages, rather than silently discarding it as the simplified version above does.
- Challenge: Research how PageRank connects to Markov chain stationary distributions, and explain why the random-surfer model is equivalent to finding a Markov chain's steady-state probabilities.
Limitations
Static Link Structure, Vulnerable to Manipulation
Basic PageRank considers only link structure, ignoring content relevance entirely — modern search engines combine it with dozens of other signals rather than relying on it alone. It is also famously vulnerable to manipulation via "link farms" (artificially created networks of mutually-linking pages designed to inflate rank), motivating an entire ongoing arms race in search-engine spam detection that goes well beyond the pure graph-theoretic algorithm described here.