37
Fast Iterative Solvers for Markov Chains, with Application to Google's PageRank Hans De Sterck Department of Applied Mathematics University of Waterloo, Ontario, Canada joint work with Steve McCormick, John Ruge, Tom Manteuffel, Geoff Sanders (University of Colorado at Boulder), Jamie Pearson (Waterloo) Departamento de Ingeniería Matemática Universidad de Chile, 25 April 2008

Fast Iterative Solvers for Markov Chains, with Application ...hdesterc/websiteW/Data/presentations/pres... · Fast Iterative Solvers for Markov Chains, with Application to Google's

  • Upload
    buinhi

  • View
    219

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Fast Iterative Solvers for Markov Chains, with Application ...hdesterc/websiteW/Data/presentations/pres... · Fast Iterative Solvers for Markov Chains, with Application to Google's

Fast Iterative Solvers for Markov Chains,with Application to Google's PageRank

Hans De SterckDepartment of Applied Mathematics

University of Waterloo, Ontario, Canada

joint work with Steve McCormick, John Ruge, Tom Manteuffel, GeoffSanders (University of Colorado at Boulder), Jamie Pearson (Waterloo)

Departamento de Ingeniería MatemáticaUniversidad de Chile, 25 April 2008

Page 2: Fast Iterative Solvers for Markov Chains, with Application ...hdesterc/websiteW/Data/presentations/pres... · Fast Iterative Solvers for Markov Chains, with Application to Google's

[email protected]

1. Ranking Pages in Web Search

• Google search:- keyword-basedquery results in list ofweb pages- pages are listed inorder of ‘importance’:PageRank

• how does PageRankwork?

• Markov chains

Page 3: Fast Iterative Solvers for Markov Chains, with Application ...hdesterc/websiteW/Data/presentations/pres... · Fast Iterative Solvers for Markov Chains, with Application to Google's

[email protected]

Ranking Pages in Web Search...

• how does PageRank work?

• “a page has high rank if thesum of the ranks of itsbacklinks is high”

(‘The PageRank Citation Ranking:Bringing Order to the Web’ (1998),Page, Brin, Motwani, Winograd)

Page 4: Fast Iterative Solvers for Markov Chains, with Application ...hdesterc/websiteW/Data/presentations/pres... · Fast Iterative Solvers for Markov Chains, with Application to Google's

[email protected]

Ranking Pages in Web Search...

• “a page has high rank if thesum of the ranks of itsbacklinks is high”(‘The PageRank Citation Ranking:Bringing Order to the Web’ (1998),Page, Brin, Motwani, Winograd)

• PageRank = stationary vector ofMarkov chain

• ‘random surfer’, random walk ongraph, robust against ‘spam’

Page 5: Fast Iterative Solvers for Markov Chains, with Application ...hdesterc/websiteW/Data/presentations/pres... · Fast Iterative Solvers for Markov Chains, with Application to Google's

[email protected]

2. Stationary Vector of Markov Chain

• B is column-stochastic

• if B is irreducible (every state can be reachedfrom every other state in the directed graph)⇒

(no probability sinks!)• largest eigenvalue of B:

Page 6: Fast Iterative Solvers for Markov Chains, with Application ...hdesterc/websiteW/Data/presentations/pres... · Fast Iterative Solvers for Markov Chains, with Application to Google's

[email protected]

3. Web Matrix Regularization

• PageRank (used by Google):

Page 7: Fast Iterative Solvers for Markov Chains, with Application ...hdesterc/websiteW/Data/presentations/pres... · Fast Iterative Solvers for Markov Chains, with Application to Google's

[email protected]

Web Matrix Regularization

• BackButton (add reverse of each link):

1-|λ2| ≈ O(1/n)

Page 8: Fast Iterative Solvers for Markov Chains, with Application ...hdesterc/websiteW/Data/presentations/pres... · Fast Iterative Solvers for Markov Chains, with Application to Google's

[email protected]

4. One-level Iterative Methods for MarkovChains

• largest eigenvalue of B:

• power method:

– convergence factor:

– convergence is very slow when

(slow mixing)

Page 9: Fast Iterative Solvers for Markov Chains, with Application ...hdesterc/websiteW/Data/presentations/pres... · Fast Iterative Solvers for Markov Chains, with Application to Google's

[email protected]

Convergence of Power Method for PageRank

• convergence factor independent of problem size• convergence is fast, linear in the number of web pages (15+

billion!)• model is accurate (hence Google’s $150B market cap...)

Page 10: Fast Iterative Solvers for Markov Chains, with Application ...hdesterc/websiteW/Data/presentations/pres... · Fast Iterative Solvers for Markov Chains, with Application to Google's

[email protected]

But How About Slowly Mixing Markov Chains?

• slow mixing:

• one-level methods (Power, Jacobi, Gauss Seidel, ...)are way too slow

• need multi-level methods! (multigrid)

• applications: PageRank , BackButton, manyother applications

Page 11: Fast Iterative Solvers for Markov Chains, with Application ...hdesterc/websiteW/Data/presentations/pres... · Fast Iterative Solvers for Markov Chains, with Application to Google's

[email protected]

5. Principle of Multigrid (for PDEs)

• 1D model problem:

• discretization:

• matrix form:

!

A =1

h2

2 "1

"1 2 "1

"1 2 "1

O O O

"1 2 "1

"1 2

#

$

% % % % % % %

&

'

( ( ( ( ( ( (

Page 12: Fast Iterative Solvers for Markov Chains, with Application ...hdesterc/websiteW/Data/presentations/pres... · Fast Iterative Solvers for Markov Chains, with Application to Google's

[email protected]

• use relaxation method (Gauss method)

• high-frequency error is removed by relaxation (Gauss-Seidel, ...)

• low-frequency-error needs to be removed by coarse-gridcorrection

Principle of Multigrid (for PDEs)

Page 13: Fast Iterative Solvers for Markov Chains, with Application ...hdesterc/websiteW/Data/presentations/pres... · Fast Iterative Solvers for Markov Chains, with Application to Google's

[email protected]

• high-frequency error is removed by relaxation (weighted Jacobi, Gauss-Seidel, ...)

• low-frequency-error needs to be removed by coarse-grid correction

Principle of Multigrid (for PDEs)

Page 14: Fast Iterative Solvers for Markov Chains, with Application ...hdesterc/websiteW/Data/presentations/pres... · Fast Iterative Solvers for Markov Chains, with Application to Google's

[email protected]

Multigrid Hierarchy: V-cycle

• multigrid V-cycle: relax (=smooth) on successively coarser grids transfer error using restriction (R=PT) and interpolation (P)

• W=O(n)

Page 15: Fast Iterative Solvers for Markov Chains, with Application ...hdesterc/websiteW/Data/presentations/pres... · Fast Iterative Solvers for Markov Chains, with Application to Google's

[email protected]

6. Aggregation for Markov Chains

• form three coarse,aggregated states

Page 16: Fast Iterative Solvers for Markov Chains, with Application ...hdesterc/websiteW/Data/presentations/pres... · Fast Iterative Solvers for Markov Chains, with Application to Google's

[email protected]

Aggregation in Matrix Form

(Krieger, Horton, ... 1990s)

Page 17: Fast Iterative Solvers for Markov Chains, with Application ...hdesterc/websiteW/Data/presentations/pres... · Fast Iterative Solvers for Markov Chains, with Application to Google's

[email protected]

Error Equation

• Ac is a singular M-matrix

Page 18: Fast Iterative Solvers for Markov Chains, with Application ...hdesterc/websiteW/Data/presentations/pres... · Fast Iterative Solvers for Markov Chains, with Application to Google's

[email protected]

Multilevel Aggregation Algorithm

(Krieger, Horton 1994, but no goodway to build Q, convergence not good)

Page 19: Fast Iterative Solvers for Markov Chains, with Application ...hdesterc/websiteW/Data/presentations/pres... · Fast Iterative Solvers for Markov Chains, with Application to Google's

[email protected]

7. Choosing Aggregates Based on Strength (SIAMJ. Scientific Computing, 2008)

• error equation:

• use strength of connection in

• define row-based strength (determine all states thatstrongly influence a row’s state)

• state that has largest value in xi is seed point for newaggregate, and all unassigned states influenced by itjoin its aggregate

• repeat(similar to Algebraic Multigrid: Brandt, McCormick and Ruge, 1983)

Page 20: Fast Iterative Solvers for Markov Chains, with Application ...hdesterc/websiteW/Data/presentations/pres... · Fast Iterative Solvers for Markov Chains, with Application to Google's

[email protected]

8. Performance for PageRank

Page 21: Fast Iterative Solvers for Markov Chains, with Application ...hdesterc/websiteW/Data/presentations/pres... · Fast Iterative Solvers for Markov Chains, with Application to Google's

[email protected]

Performance for BackButton

Page 22: Fast Iterative Solvers for Markov Chains, with Application ...hdesterc/websiteW/Data/presentations/pres... · Fast Iterative Solvers for Markov Chains, with Application to Google's

[email protected]

9. Improved Algorithm: ‘SmoothedAggregation’...

after relaxation:

coarse gridcorrection with Q:

coarse gridcorrection with Qs:

(Vanek, Mandel, and Brezina, Computing, 1996)

Page 23: Fast Iterative Solvers for Markov Chains, with Application ...hdesterc/websiteW/Data/presentations/pres... · Fast Iterative Solvers for Markov Chains, with Application to Google's

[email protected]

Non-smoothed Aggregation

• non-smoothed method:

Ac is an irreducible singular M-matrix

Page 24: Fast Iterative Solvers for Markov Chains, with Application ...hdesterc/websiteW/Data/presentations/pres... · Fast Iterative Solvers for Markov Chains, with Application to Google's

[email protected]

Smoothed Aggregation

• smooth the columns of P with weighted Jacobi:

• smooth the rows of R with weighted Jacobi:

Page 25: Fast Iterative Solvers for Markov Chains, with Application ...hdesterc/websiteW/Data/presentations/pres... · Fast Iterative Solvers for Markov Chains, with Application to Google's

[email protected]

Smoothed Aggregation

• smoothed coarse level operator:

• problem: Acs is not a singular M-matrix (signs wrong)

• solution: lumping approach on S in

Page 26: Fast Iterative Solvers for Markov Chains, with Application ...hdesterc/websiteW/Data/presentations/pres... · Fast Iterative Solvers for Markov Chains, with Application to Google's

[email protected]

Lumped Smoothed Aggregation

• is an irreducible singular M-matrix!(off-diagonal elements remain positive)

• theorem lumped operator is a singular M-matrix onall coarse levels, and thus allows for a unique strictlypositive solution xc on all levels

• theorem exact solution x is a fixed point of themultigrid cycle

(SIAM J. Scientific Computing, submitted)

Page 27: Fast Iterative Solvers for Markov Chains, with Application ...hdesterc/websiteW/Data/presentations/pres... · Fast Iterative Solvers for Markov Chains, with Application to Google's

[email protected]

10. Numerical Results: Uniform Chain

Page 28: Fast Iterative Solvers for Markov Chains, with Application ...hdesterc/websiteW/Data/presentations/pres... · Fast Iterative Solvers for Markov Chains, with Application to Google's

[email protected]

Numerical Results: Tandem Queueing Network

Page 29: Fast Iterative Solvers for Markov Chains, with Application ...hdesterc/websiteW/Data/presentations/pres... · Fast Iterative Solvers for Markov Chains, with Application to Google's

[email protected]

11. Influence of α: PageRank

Page 30: Fast Iterative Solvers for Markov Chains, with Application ...hdesterc/websiteW/Data/presentations/pres... · Fast Iterative Solvers for Markov Chains, with Application to Google's

[email protected]

Influence of α: BackButton

• BackButton

Page 31: Fast Iterative Solvers for Markov Chains, with Application ...hdesterc/websiteW/Data/presentations/pres... · Fast Iterative Solvers for Markov Chains, with Application to Google's

[email protected]

12. Conclusions

• multilevel method applied to Google’s PageRank withα=0.15 is not faster than power method (SIAM J.Scientific Computing, 2008)

• smoothed multilevel method applied to slowly mixingMarkov chains is much faster than power method(in fact, close to optimal O(n) complexity!) (SIAM J.Scientific Computing, submitted)

Page 32: Fast Iterative Solvers for Markov Chains, with Application ...hdesterc/websiteW/Data/presentations/pres... · Fast Iterative Solvers for Markov Chains, with Application to Google's

[email protected]

8. Performance for Web Ranking

• total efficiency factor of MAA relative to WJAC:

• : MAA 2 times more efficient than WJAC

• : MAA 2 times less efficient than WJAC

Page 33: Fast Iterative Solvers for Markov Chains, with Application ...hdesterc/websiteW/Data/presentations/pres... · Fast Iterative Solvers for Markov Chains, with Application to Google's

[email protected]

7. Well-posedness: Singular M-matrices

• singular M-matrix:

• our A=I-B is a singular M-matrix on all levels

Page 34: Fast Iterative Solvers for Markov Chains, with Application ...hdesterc/websiteW/Data/presentations/pres... · Fast Iterative Solvers for Markov Chains, with Application to Google's

[email protected]

Well-posedness: Unsmoothed Method

Page 35: Fast Iterative Solvers for Markov Chains, with Application ...hdesterc/websiteW/Data/presentations/pres... · Fast Iterative Solvers for Markov Chains, with Application to Google's

[email protected]

Smoothed Aggregation

• smoothed coarse level operator:

• problem: Acs is not a singular M-matrix (signs wrong)

• solution: lumping approach on S in

Page 36: Fast Iterative Solvers for Markov Chains, with Application ...hdesterc/websiteW/Data/presentations/pres... · Fast Iterative Solvers for Markov Chains, with Application to Google's

[email protected]

Smoothed Aggregation

• we want as little lumping as possible• only lump ‘offending’ elements (i,j):

(we consider both off-diagonal signs and reducibility here!)• for ‘offending’ elements (i,j), add S{i,j} to S:

conserves both row andcolumn sums

Page 37: Fast Iterative Solvers for Markov Chains, with Application ...hdesterc/websiteW/Data/presentations/pres... · Fast Iterative Solvers for Markov Chains, with Application to Google's

[email protected]

9. Lumped Smoothed Method is Well-posed