Image: en:User:345Kai, User:Stannered, public domainHow Google ranked the web with an eigenvector
In 1998 Sergey Brin and Larry Page, then doctoral students at Stanford, published a paper describing a search engine whose ranking of pages depended on the structure of the links between them and not on their text. The paper, The anatomy of a large-scale hypertextual Web search engine, appeared in the journal Computer Networks and ISDN Systems, and the ranking method, PageRank, is a computation on a graph with a few hundred million vertices at the time and a few hundred billion now. The idea takes a paragraph. The computation is an eigenvector.
The random surfer
The web is a directed graph: pages are vertices, and a link from page A to page B is an arrow from A to B. Imagine a surfer who starts on some page and, at every step, clicks a link chosen uniformly at random among the links on the current page. The fraction of time the surfer spends on a page, in the long run, is that page's rank. A page with many incoming links is visited often; a page linked from a page that is itself visited often inherits some of that traffic, which is what distinguishes the method from simply counting links. The definition is circular, a page is important if important pages link to it, and the circularity is resolved by linear algebra.
Two things go wrong with the plain random walk. A page with no outgoing links traps the surfer forever. And a group of pages that link only to each other, once entered, is never left, so the long-run fractions depend on where the surfer started. Brin and Page fix both at once: at every step, with probability 0.85 the surfer follows a random link, and with probability 0.15 the surfer jumps to a page chosen uniformly at random from the whole web. A page without links is treated as linking to everything. The number 0.85 is the damping factor, and with it the walk can get from any page to any other, so that the long-run fractions exist, are unique, and do not depend on the start.
Four pages by hand
Take four pages A, B, C, and D with links A to B, A to C, B to C, C to A, and D to C. The transition matrix M has entry (j, i) equal to 1 divided by the number of links on page i if i links to j, and 0 otherwise; its columns sum to 1. Column A is (0, 1/2, 1/2, 0), column B is (0, 0, 1, 0), column C is (1, 0, 0, 0), column D is (0, 0, 1, 0). The Google matrix is G = 0.85 M + 0.15 J, where J has every entry equal to 1/4. The rank vector r is the vector with r = G r and entries summing to 1, which is to say the eigenvector of G for the eigenvalue 1.
Power iteration finds it: start with r = (1/4, 1/4, 1/4, 1/4) and multiply by G repeatedly. After one step the vector is (0.250, 0.144, 0.569, 0.038). After two it is (0.521, 0.144, 0.298, 0.038). After three it is (0.291, 0.259, 0.413, 0.038). The vector oscillates, because A and C link to each other and the walk sloshes back and forth, and the oscillation decays geometrically. The limit is (0.372, 0.196, 0.394, 0.038): C is the most important page, with three incoming links, A is close behind with only one incoming link, because that link comes from C, and D, which nobody links to, keeps the 0.0375 that the random jump alone gives it. Unit 12 of the Graph Theory Masterclass works this example through and explains why the entries of D are exactly 0.15/4.
Why the eigenvector exists and is unique
The columns of G sum to 1, so G is a column-stochastic matrix, and every entry of G is positive, because of the 0.15 J term. A theorem of Perron from 1907, extended by Frobenius in 1912, says that a matrix with positive entries has a largest eigenvalue that is real, positive, and simple, with an eigenvector whose entries are all positive, and that every other eigenvalue is smaller in absolute value. For a column-stochastic matrix the largest eigenvalue is 1. So r exists, is unique once normalized, and has positive entries, and power iteration converges to it at a rate given by the second eigenvalue, which for the Google matrix is at most 0.85 in absolute value whatever the web looks like. That last fact, due to Haveliwala and Kamvar in 2003, is why the damping factor matters for the computation and not only for the model: each iteration reduces the error by a factor of 0.85, so 50 iterations bring it below 0.0003, and 50 passes over the link graph of the web was a feasible computation in 1998 and still is.
The connection to the rest of Unit 12 is that the same matrix governs random walks on any graph. For an undirected graph the stationary distribution is proportional to the degrees, with no eigenvector computation needed; what makes the web hard is the direction of the links, which destroys that symmetry and makes the eigenvector genuinely new information.
What the paper did not say
The ranking is only one input to a search engine, and the 1998 paper is clear about this: text matching, the anchor text of links, and the position of words on the page were combined with PageRank from the beginning, and the combination has changed beyond recognition since. The pure eigenvector is also easy to manipulate, by building farms of pages that link to each other and to the target, and much of the engineering of the following decade went into detecting that. PageRank as a number shown to users was retired in 2016. The method itself lives on wherever one wants to rank the vertices of a directed graph by a random walk: citation networks, protein interaction networks, the ranking of sports teams by who beat whom, and the identification of influential words in a text all use it.
The name is a pun on Page's surname, and the patent belonged to Stanford University, which licensed it to Google in exchange for shares it sold in 2005 for 336 million dollars. The mathematics belonged to Perron and Frobenius, and to the theory of Markov chains, which Andrey Markov began in 1906 and illustrated in 1913 with the sequence of vowels and consonants in Pushkin's Eugene Onegin. An eigenvector of a matrix with a few hundred billion rows is what one of the largest companies in the world is built on, and the four-page example above contains all of it.


