Lecture 9 analysis of large graphs link analysis, pagerank

Pagerank: The “Flow” Formulation

Every link’s vote is proportional to the importance of its source page. So if page $j$ has importance $r_j$ and $n$ out-links, each links gets $r_j/n$ votes.

Pagerank: The Matrix Formulation

PageRank Algorithm: Power Iteration

Two modifications to amek it converge, and to make it converge to what we want: 2 problems:

Screenshot 2019-10-25 at 8.51.56 PM.png

Screenshot 2019-10-25 at 8.52.31 PM.png

Actually computing PageRank

We need to do Power Iteration to compute PageRank: $r^{new} = A r^{old}$. However, we usually don’t have enough main memory to hold $A$, $r^{old}$, $r^{new}$. (4) We rearrange the equation to the sparse matrix formulation:

Screenshot 2019-10-25 at 8.56.41 PM.png

Screenshot 2019-10-25 at 8.58.29 PM.png

Since M is a sparse matrix (with no dead-ends). Approx $O(N)$ entries, not $O(N^2)$. So in each iteration in PageRank, we need to:

Screenshot 2019-10-25 at 9.01.16 PM.png

Optimized PageRank Algo (Used in Regular Google Jobs)

Optimization 1: list of pages O(N) barely fits in memory Assume enough memory to fit just $r^{new}$ in memory.

Basic Memory Saving PageRank

Screenshot 2019-10-25 at 9.06.55 PM.png

Assume enough memory to fit just $r^{new}$ in memory. Store $r^{old}$ and matrix $M$ on disk.

Screenshot 2019-10-25 at 9.15.00 PM.png

Assumes enough memory to fit $r^{new}$ into memory, cost per iteration of power method = $2|r| + |M|$. What if r^{new} does not fit into memory?

Block based algorithm (breaking up $r^{new}$ which does not fit in memory)

Screenshot 2019-10-25 at 9.19.12 PM.png

Trades off using less memory for more disk reads. Total cost: k scans of $M$ and $r^{old}$ once for each block.

Block-Stripe Update Algorithm (Optimization using partitioning)

Screenshot 2019-10-25 at 9.23.18 PM.png

Break M into partitions/stripes such that each partition contains only destination nodes in the corresponding block of $r^{new}$ Cost per iteration of Power Method: $(1+overhead)|M| + (k+1) |r|$

Problems with PageRank:

Notes

(1) Every column sums to 1. M is essentially the adjacency matrix with each column divided by the out-degree. (2) In steady state (3) For graphs that satisfy certian conditions, the stationary distribution is uniqye and will eventually be reached no matter what the inital proabilty distribution is. (4) If N = 1 billion pages, we need 4 bytes for each entry, Matrix A has N^2 entries = 10^18 !!