Four pages link to each other. Watch importance flow along the links until every page’s share stops changing.
Ranking the web
Importance flows along links until the shares stop changing.
Four pages, each starting with a quarter of the importance. Nobody links to page 4.
Describe this picture
Four pages drawn as boxes at the corners of a square, each with a bar for its share of importance and a dotted line at its final share, and arrows for the links, thicker for more importance flowing: page 1 links to pages 2 and 3, page 2 to page 3, page 3 to pages 1 and 2, and page 4 to pages 1 and 3. Nobody links to page 4. Over about 13 s the bars start equal at 0.25 each, and at every step each page splits 85 % of its bar evenly among its links, while the other 15 % is shared out to all four pages. The bars settle on : page 3 first, page 4 last. Readouts give the step and the shares. One control after the clip: a slider for the damping from 0.5 to 0.95; at 0.5 the bars flatten to .
Importance flows along links
One way to rank pages imagines that importance flows along links. A page passes its importance on, split evenly among the pages it links to, and a page is important when important pages link to it. Write that flow as a matrix with the convention of Markov matrices: column says where page sends its share.
Page 1 links to pages 2 and 3, so column 1 has 0.5 in rows 2 and 3. Every column adds up to 1. The ranking is a steady state, : here . Page 3 wins, since three pages link to it. Page 4 gets nothing, since nobody does.
Multiply and rescale
For four pages the steady state can be solved by elimination. For billions of pages it can’t. What still works is the simplest thing possible: start anywhere, and multiply by the matrix again and again.
Diagonalisation and matrix powers explains why this finds an eigenvector. Write the start as a mix of eigenvectors, . After steps
If is larger in size than every other eigenvalue, and , its part outgrows the rest, and the vector turns towards . The length may grow or shrink without limit, so rescale after every step:
This is power iteration. Once has settled, the eigenvalue follows from , for a unit . For a Markov matrix the largest eigenvalue is exactly 1, and rescaling to a total of 1 keeps the shares as shares.
How fast
The leftover part shrinks relative to the main one by each step, where is the next largest in size.
Arrow turning in
Multiply by A = [1.5 1; 0.5 1], rescale to length 1, repeat.
The arrow u_{0} = (1, 0) and the eigen-line of A through (2, 1), at 26.57°.
Describe this picture
The plane with the eigen-line of through , dashed, at 26.57° (0.4636 rad). A unit arrow starts at . Step after step it is multiplied by and rescaled to length 1, and it swings up towards the line, leaving faint copies behind. It turns to 18.43°, 24.44°, 26.03°, 26.43° and 26.53°. Readouts give the step, the arrow’s angle and its gap to the line: 26.57°, then 8.13°, 2.12°, 0.54°, 0.13° and 0.03°, about four times smaller each step. The clip runs for about 11 s. There is no control.
For the matrix of Eigenvectors, with eigenvalues 2 and 0.5, the factor is . Track the ratio of the arrow’s second entry to its first. One step sends it to , and from it runs
Its distance from goes : about a quarter each time.
For the three-towns matrix of the Markov page, with eigenvalues 1, 0.6 and 0.5, the factor is 0.6, and after 10 steps , about 0.006, of the starting error is left.
Damping
The bare link matrix has two problems. A page with no links in, like page 4, ends up with nothing, and a group of pages that only link to each other can trap all the importance or make it swing back and forth. The fix is damping: at every step a share of the importance follows the links, and the rest, , is spread evenly over all pages. With the all-ones vector :
Every entry of this matrix is positive, so by the Markov page it has one steady state, reached from every start. With , from equal shares:
- after 1 step: ;
- after 2 steps: ;
- after 3 steps: ;
- settled: .
Page 4 now keeps exactly the damping share, . Damping also guarantees the speed: any difference between two share vectors shrinks by at least the factor each step. That bound promises the error falls below within 61 steps; this small web gets there in 14, since the other eigenvalues of its damped matrix have size 0.425.
Where this leads · random walks
Markov chains, in the probability and statistics course, reads the same matrix as a walker who clicks a random link from each page, and with chance jumps to a random page instead. The ranking is the share of time the walker spends on each page.
Worked example
1. The arrow. From under the ratio goes towards , the direction , the gap shrinking by about 0.25 each step.
2. The web without damping. gives . Check row 2: .
3. The web with damping. At : . At : , flatter, since more is shared out evenly.
4. Scale. A web of pages with about 10 links each has links. One step costs about multiplications, one per link, and 50 steps . A full table would have entries, which no computer could store.
Try these before you read the answers.
- What sets the speed of power iteration? .
- Does converge? No: its eigenvalues 1 and tie in size, and the arrow flips back and forth.
- As approaches 1, what happens to page 4’s share? It falls towards 0.
Where you’ll meet this
Ranking. Pages, scientific papers and accounts in a social network have all been ranked by a damped steady state of this kind.
Big eigenproblems. When a matrix is too big to handle whole, power iteration still finds its dominant eigenvector: the main vibration mode of a structure, or the top principal direction of huge data, as in Principal components.
Inside eigenvalue software. General eigenvalue programs run refined versions of the same iteration, shifted and applied to many vectors at once.
Reference card
| Quantity | Formula | Notes |
|---|---|---|
| Power iteration | multiply and rescale | |
| Limit | the dominant eigenvector | needs one eigenvalue largest in size |
| Speed | error shrinks by per step | 0.25 for eigenvalues 2 and 0.5 |
| Eigenvalue estimate | for a unit | |
| Link matrix | , column = where page sends its share | columns add to 1 |
| Damped | every page gets at least | |
| Ranking | the steady state | shrinks errors by at least per step |