Google’s Billion Dollar Eigenvector

40
Google’s Billion Google’s Billion Dollar Eigenvector Dollar Eigenvector Gerald Kruse, PhD. Gerald Kruse, PhD. Associate Professor of Mathematics and Computer Associate Professor of Mathematics and Computer Science Science Juniata College Juniata College Huntingdon, PA Huntingdon, PA [email protected] http://faculty.juniata.edu/kruse http://faculty.juniata.edu/kruse

description

Google’s Billion Dollar Eigenvector. Gerald Kruse, PhD. Associate Professor of Mathematics and Computer Science Juniata College Huntingdon, PA [email protected] http://faculty.juniata.edu/kruse. Math, math, everywhere…. Who is getting close to the $1 M?. Here’s an interesting billboard…. - PowerPoint PPT Presentation

Transcript of Google’s Billion Dollar Eigenvector

Page 1: Google’s Billion Dollar Eigenvector

Google’s Billion Dollar Google’s Billion Dollar EigenvectorEigenvector

Gerald Kruse, PhD.Gerald Kruse, PhD.Associate Professor of Mathematics and Computer ScienceAssociate Professor of Mathematics and Computer Science

Juniata CollegeJuniata CollegeHuntingdon, PAHuntingdon, PA

[email protected]://faculty.juniata.edu/krusehttp://faculty.juniata.edu/kruse

Page 2: Google’s Billion Dollar Eigenvector

Math, math, everywhere…Math, math, everywhere…

Page 3: Google’s Billion Dollar Eigenvector

Who is getting close to the $1 M?Who is getting close to the $1 M?

Page 4: Google’s Billion Dollar Eigenvector

Here’s an interesting billboard…Here’s an interesting billboard…

Page 5: Google’s Billion Dollar Eigenvector

What happened for those who What happened for those who found the answer?found the answer?

The answer is 7427466391The answer is 7427466391

Those who typed in the URL, Those who typed in the URL, http://7427466391.com , ended up getting another puzzle. Solving that lead , ended up getting another puzzle. Solving that lead them to a page with a job application for…them to a page with a job application for…

Google!Google!

Page 6: Google’s Billion Dollar Eigenvector

(1) Just what does it take to solve that (1) Just what does it take to solve that problem?problem?

Calculations (most probably on a computer), Calculations (most probably on a computer), knowledge of number theory, a general knowledge of number theory, a general aptitude and interest in problem solving.aptitude and interest in problem solving.

First QuestionFirst Question

Page 7: Google’s Billion Dollar Eigenvector

(2) Why does Google want to hire people (2) Why does Google want to hire people who know how to find that, what does it have who know how to find that, what does it have to do with a search engine? to do with a search engine?

Hmmm… Google gives great search results.Hmmm… Google gives great search results.

Maybe their ranking algorithm is Maybe their ranking algorithm is mathematically based?mathematically based?

Second QuestionSecond Question

Page 8: Google’s Billion Dollar Eigenvector

““Google-ing” GoogleGoogle-ing” Google

Page 9: Google’s Billion Dollar Eigenvector

Results in an early paper from Page, Brin et. al. Results in an early paper from Page, Brin et. al. while in graduate schoolwhile in graduate school

Page 10: Google’s Billion Dollar Eigenvector

Search EnginesSearch EnginesWe’ve all used them, but what is We’ve all used them, but what is

“under the hood?”“under the hood?”

Crawl the web and locate all public pagesCrawl the web and locate all public pages

Index the “crawled” data so it can be searchedIndex the “crawled” data so it can be searched

Rank the pages for more effective searchingRank the pages for more effective searching ( the ( the focus of this talk )focus of this talk )

Each word which is searched on is linked with a list of Each word which is searched on is linked with a list of pages (just URL’s) which contain it. The pages with the pages (just URL’s) which contain it. The pages with the highest rank are returned first.highest rank are returned first.

Page 11: Google’s Billion Dollar Eigenvector

Note:Note:

Google ONLY uses the link Google ONLY uses the link structure of the World Wide structure of the World Wide Web to determine a page’s Web to determine a page’s rank, NOT its content.rank, NOT its content.

Page 12: Google’s Billion Dollar Eigenvector

PageRankPageRank is NOT a simple citation is NOT a simple citation indexindex

NOTE:NOTE: (1)(1)Rankings based on citation index would be very easy to manipulateRankings based on citation index would be very easy to manipulate(2)(2)While While PageRank PageRank is an important part of Google’s search results, it is is an important part of Google’s search results, it is not the sole means used to rank pages.not the sole means used to rank pages.

A B

Which is the more popular page below, A or B?Which is the more popular page below, A or B?

What if the links to A were from unpopular pages, and the What if the links to A were from unpopular pages, and the one link to B was from one link to B was from www.yahoo.com ? ?

Page 13: Google’s Billion Dollar Eigenvector

Intuitively Intuitively PageRankPageRank is analogous is analogous to popularityto popularity

The web as a graph: each page is a The web as a graph: each page is a vertexvertex, each , each hyperlink a directed hyperlink a directed edgeedge..A page is popular if a few very popular pages point (via A page is popular if a few very popular pages point (via hyperlinks) to it.hyperlinks) to it.A page could be popular if many not-necessarily A page could be popular if many not-necessarily popular pages point (via hyperlinks) to it.popular pages point (via hyperlinks) to it.

1BNPage A Page B

Page C

2AN

1CN

Which of these three would have the highest page rank?

Page 14: Google’s Billion Dollar Eigenvector

So what is the mathematical So what is the mathematical definition of definition of PageRankPageRank??

In particular, a page’s rank is equal to the sum In particular, a page’s rank is equal to the sum of the ranks of all the pages pointing to it. of the ranks of all the pages pointing to it.

note the scaling of each page ranknote the scaling of each page rank

vfromlinksofnumberN

utolinkswithpagesofsetB

N

vRankuRank

v

u

Bv vu

)()(

Page 15: Google’s Billion Dollar Eigenvector

Writing out the equation for each Writing out the equation for each web-page in our example gives:web-page in our example gives:

1BNPage A Page B

Page C

2AN

1CN

01

)(

2

)()(

002

)()(

1

)(00)(

BRankARankCRank

ARankBRank

CRankARank

Page 16: Google’s Billion Dollar Eigenvector

Even though this is a circular definition we can Even though this is a circular definition we can calculate the ranks.calculate the ranks.Re-write the system of equations as a Matrix-Re-write the system of equations as a Matrix-Vector product.Vector product.

)(

)(

)(

012

1

002

1

100

)(

)(

)(

CRank

BRank

ARank

CRank

BRank

ARank

The The PageRankPageRank vector is simply an eigenvector of the vector is simply an eigenvector of the coefficient matrix, with coefficient matrix, with xAx

1

Page 17: Google’s Billion Dollar Eigenvector

Wait… what’s an eigenvector?Wait… what’s an eigenvector?

Page 18: Google’s Billion Dollar Eigenvector

A Graphical Interpretation of a A Graphical Interpretation of a 2-Dimensional Eigenvector2-Dimensional Eigenvector

http://cnx.org/content/m10736/latest/

If we have some 2-D vector If we have some 2-D vector xx, and some , and some

2 x 2 matrix 2 x 2 matrix AA, generally their product, , generally their product,

A*x = bA*x = b, will result in a new vector, , will result in a new vector, bb, ,

which is pointing in a different direction andwhich is pointing in a different direction and

having a different length than having a different length than xx..

But, if the vector (But, if the vector (vv in the image at the left) is in the image at the left) is

an an eigenvectoreigenvector of of AA, then , then A*v A*v will give a will give a

vector which is same direction as vector which is same direction as vv,, but justbut just

scaled a different length, by scaled a different length, by λλ..

Note that Note that λ λ is called an eigenvalue of is called an eigenvalue of AA..

Page 19: Google’s Billion Dollar Eigenvector

1BNPage A Page B

Page C

2AN

1CN

PageRank = 0.4

PageRank = 0.4

PageRank = 0.2

Note: we choose the eigenvector with Note: we choose the eigenvector with 11x

Page 20: Google’s Billion Dollar Eigenvector

Implementation DetailsImplementation Details

Billions of web-pages would make a huge matrixBillions of web-pages would make a huge matrix

The matrix (in theory) is column-stochastic, which allows The matrix (in theory) is column-stochastic, which allows for iterative calculationfor iterative calculation

Previous PageRank is used as an initial guessPrevious PageRank is used as an initial guess

Random-Surfer term handles computational difficulties Random-Surfer term handles computational difficulties associated with a “disconnected graph”associated with a “disconnected graph”

Page 21: Google’s Billion Dollar Eigenvector

Attempts to Manipulate Search ResultsAttempts to Manipulate Search Results Via a “Google Bomb”Via a “Google Bomb”

Page 22: Google’s Billion Dollar Eigenvector

French Military VictoriesFrench Military Victories

Page 23: Google’s Billion Dollar Eigenvector
Page 24: Google’s Billion Dollar Eigenvector

Juniata’s own “Google Bomb”Juniata’s own “Google Bomb”

Page 25: Google’s Billion Dollar Eigenvector

At Juniata, CS 315 is my “Analysis and At Juniata, CS 315 is my “Analysis and Algorithms” courseAlgorithms” course

Page 26: Google’s Billion Dollar Eigenvector

Liberals vs. Conservatives!Liberals vs. Conservatives!As of November, 2007, Google no longer returns this!As of November, 2007, Google no longer returns this!

Page 27: Google’s Billion Dollar Eigenvector

““Ego Surfing”Ego Surfing”Be very careful…Be very careful…

Page 28: Google’s Billion Dollar Eigenvector

More than one Gerald Kruse…More than one Gerald Kruse…

Page 29: Google’s Billion Dollar Eigenvector

Miscellaneous pointsMiscellaneous pointsTry a search in Google on “PigeonRank.”Try a search in Google on “PigeonRank.”

What types of sites would Google NOT give good What types of sites would Google NOT give good results on?results on?

PageRankPageRank is not the only means Google uses to is not the only means Google uses to order search results.order search results.

Page 30: Google’s Billion Dollar Eigenvector

BibliographyBibliography

[1] S. Brin, L. Page, et. al., [1] S. Brin, L. Page, et. al., The PageRank Citation Ranking: Bringing The PageRank Citation Ranking: Bringing Order to the WebOrder to the Web, , http://dbpubs.stanford.edu/pub/1999-66 , Stanford , Stanford Digital Libraries Project (January 29, 1998).Digital Libraries Project (January 29, 1998).

[2] K. Bryan and T. Leise, [2] K. Bryan and T. Leise, The $25,000,000,000 Eigenvector: The The $25,000,000,000 Eigenvector: The Linear Algebra behind GoogleLinear Algebra behind Google, SIAM Review, 48 (2006), pp. 569-581., SIAM Review, 48 (2006), pp. 569-581.

[3] G. Strang, [3] G. Strang, Linear Algebra and Its ApplicationsLinear Algebra and Its Applications, Brooks-Cole, , Brooks-Cole, Boston, MA, 2005.Boston, MA, 2005.

[4] D. Poole, [4] D. Poole, Linear Algebra: A Modern IntroductionLinear Algebra: A Modern Introduction, Brooks-Cole, , Brooks-Cole, Boston, MA, 2005.Boston, MA, 2005.

Page 31: Google’s Billion Dollar Eigenvector

Any Questions?Any Questions?

Slides available at Slides available at http://faculty.juniata.edu/krusehttp://faculty.juniata.edu/kruse

Page 32: Google’s Billion Dollar Eigenvector

The following slides give The following slides give some of the more in-depth some of the more in-depth

mathematics behind Googlemathematics behind Google

Page 33: Google’s Billion Dollar Eigenvector

Note that the coefficient matrix is Note that the coefficient matrix is column-stochasticcolumn-stochastic**

1

10,

211

321

2232221

1131211

njjj

n

iij

ij

nnnnn

n

n

aaaa

a

aaaa

aaaa

aaaa

Every column-stochastic matrix has 1 as an eigenvalue.Every column-stochastic matrix has 1 as an eigenvalue.

** As long as there are no “dangling nodes” and the graph is As long as there are no “dangling nodes” and the graph is connected.connected.

Page 34: Google’s Billion Dollar Eigenvector

In Page, Brin, et. al. [1], they suggest dangling nodes most likely In Page, Brin, et. al. [1], they suggest dangling nodes most likely would occur from pages which haven’t been crawled yet, and so would occur from pages which haven’t been crawled yet, and so they “simply remove them from the system until all the they “simply remove them from the system until all the PageRankPageRanks are calculated.”s are calculated.”

It is interesting to note that a column-substochastic does have a It is interesting to note that a column-substochastic does have a positive eigenvalue and corresponding eigenvector with positive eigenvalue and corresponding eigenvector with non-negative entries, which is called the Perron eigenvector, as non-negative entries, which is called the Perron eigenvector, as detailed in Bryan and Leise [2].detailed in Bryan and Leise [2].

Dangling Nodes have no outgoing linksDangling Nodes have no outgoing links

Page B

Page A

Page C

02/12/1

002/1

02/10In this example, Page C is a In this example, Page C is a dangling node. Note that its dangling node. Note that its associated column in the associated column in the coefficient matrix is all 0. coefficient matrix is all 0. Matrices like these are called Matrices like these are called column-substochasticcolumn-substochastic..

1

Page 35: Google’s Billion Dollar Eigenvector

In this example, the eigenspace assiciated with In this example, the eigenspace assiciated with eigenvalue is two-dimensional. Which eigenvalue is two-dimensional. Which eigenvector should be used for ranking? eigenvector should be used for ranking?

A disconnected graph could lead to A disconnected graph could lead to non-unique rankingsnon-unique rankings

Page D

Page C

Page E

Page B

Page A

00000

2/10100

2/11000

00001

00010Notice the block Notice the block diagonal structure diagonal structure of the coefficient of the coefficient matrix. matrix. Note:Note: Re-ordering Re-ordering via permutation via permutation doesn’t change the doesn’t change the ranking, as in [2].ranking, as in [2].

1

Page 36: Google’s Billion Dollar Eigenvector

Add a “random-surfer” term to the Add a “random-surfer” term to the simple simple PageRankPageRank formula. formula.

This models the behavior of a real web-surfer, who might jump to another This models the behavior of a real web-surfer, who might jump to another page by directly typing in a URL or by choosing a bookmark, rather than page by directly typing in a URL or by choosing a bookmark, rather than clicking on a hyperlink. Originally, clicking on a hyperlink. Originally, m=0.15m=0.15 in Google, according to [2]. in Google, according to [2].

can also be written as:can also be written as:

mSAmM )1(

Let Let SS be an be an nn x x nn matrix with all entries matrix with all entries 1/n1/n. . SS is column- is column-stochastic, and we consider the matrix stochastic, and we consider the matrix M M , which is a , which is a weighted average of weighted average of AA and and SS. .

smxAmx )1(xMx

Important NoteImportant Note: : We will use this formulation with We will use this formulation with AA when computing when computing x x ,,

and and ss is a column vector with all entries is a column vector with all entries 1/n1/n, where if , where if sxS 1ix

Page 37: Google’s Billion Dollar Eigenvector

The eigenspace associated with is one-The eigenspace associated with is one-dimensional, and the normalized eigenvector isdimensional, and the normalized eigenvector is

MM for our previous disconnected for our previous disconnected graph, with graph, with m=0.15m=0.15

Page D

Page C

Page E

Page B

Page A

03.003.003.003.003.0

455.003.088.003.003.0

455.088.003.003.003.0

03.003.003.003.088.0

03.003.003.088.003.0

1

So the addition of the random surfer term permits So the addition of the random surfer term permits comparison between pages in different subwebs.comparison between pages in different subwebs.

)03.0,285.0,285.0,2.0,2.0(

Page 38: Google’s Billion Dollar Eigenvector

By many estimates, the web currently contains at least 8 billion By many estimates, the web currently contains at least 8 billion pages. How does Google compute an eigenvector for pages. How does Google compute an eigenvector for something this large?something this large?

One possibility is the power method.One possibility is the power method.

In [2], it is shown that every positive (all entries are > 0) In [2], it is shown that every positive (all entries are > 0) column-stochastic matrix column-stochastic matrix MM has a unique vector has a unique vector qq with positive with positive

components such that components such that MqMq = = qq, with , and it can be, with , and it can be

computed as , for any initial guess withcomputed as , for any initial guess with

positive components and .positive components and .

Iterative CalculationIterative Calculation

11q

0lim xMq k

k

0x

110x

Page 39: Google’s Billion Dollar Eigenvector

Rather than calculating the powers of M directly, we could use Rather than calculating the powers of M directly, we could use the iteration, .the iteration, .

Since M is positive, would be an calculation. Since M is positive, would be an calculation.

As we mentioned previously, Google uses the equivalent As we mentioned previously, Google uses the equivalent expression in the computation:expression in the computation:

These products can be calculated without explicitly creating These products can be calculated without explicitly creating the huge coefficient matrix, since the huge coefficient matrix, since AA contains mostly 0’s. contains mostly 0’s.

The iteration is guaranteed to converge, and it will converge The iteration is guaranteed to converge, and it will converge quicker with a better first guess, so the previous quicker with a better first guess, so the previous PageRankPageRank vector is used as the initial vector. vector is used as the initial vector.

Iterative Calculation continuedIterative Calculation continued

1 kk xMx

1kxM

)( 2nO

smxAmx kk

1)1(

Page 40: Google’s Billion Dollar Eigenvector

This gives a regular matrixThis gives a regular matrix

In matrix notation we haveIn matrix notation we have

Since Since we can rewrite as we can rewrite as

The new coefficient matrix is regular, so we can calculate The new coefficient matrix is regular, so we can calculate the eigenvector iteratively.the eigenvector iteratively.

This iterative process is a series of matrix-vector products, This iterative process is a series of matrix-vector products, beginning with an initial vector (typically the previous beginning with an initial vector (typically the previous PageRankPageRank vector). These products can be calculated vector). These products can be calculated without explicitly creating the huge coefficient matrix. without explicitly creating the huge coefficient matrix.

EARR

11R

REEnoteREAR )1(:,))1((