paths and random walks on graphs
play

Paths and Random Walks on Graphs Based on materials by - PowerPoint PPT Presentation

Paths and Random Walks on Graphs Based on materials by Lala Adamic and Purnamrita Sarkar 1 Mo#va#on: Link predic#on in social networks 2 Mo#va#on:


  1. Paths ¡and ¡ ¡ Random ¡Walks ¡on ¡Graphs ¡ Based ¡on ¡materials ¡by ¡Lala ¡Adamic ¡and ¡ Purnamrita ¡Sarkar ¡ 1

  2. Mo#va#on: ¡Link ¡predic#on ¡in ¡social ¡networks ¡ 2

  3. Mo#va#on: ¡Basis ¡for ¡recommenda#on ¡ 3

  4. Mo#va#on: ¡Personalized ¡search ¡ 4

  5. Why ¡graphs? ¡ • The ¡underlying ¡data ¡is ¡naturally ¡a ¡graph ¡ – Papers ¡linked ¡by ¡cita>on ¡ – Authors ¡linked ¡by ¡co-­‑authorship ¡ – Bipar>te ¡graph ¡of ¡customers ¡and ¡products ¡ – Web-­‑graph ¡ ¡ – Friendship ¡networks: ¡who ¡knows ¡whom ¡ 5

  6. What ¡are ¡we ¡looking ¡for ¡ • Rank ¡nodes ¡for ¡a ¡par>cular ¡query ¡ – Top ¡k ¡matches ¡for ¡ “ Random ¡Walks ” ¡from ¡Citeseer ¡ – Who ¡are ¡the ¡most ¡likely ¡co-­‑authors ¡of ¡ “ Manuel ¡Blum ” . ¡ – Top ¡k ¡book ¡recommenda>ons ¡ ¡for ¡Jen ¡from ¡Amazon ¡ – Top ¡k ¡websites ¡matching ¡ “ Sound ¡of ¡Music ” ¡ – Top ¡k ¡friend ¡recommenda>ons ¡for ¡Bob ¡when ¡he ¡joins ¡ “ Facebook ” ¡ 6

  7. History: Graph theory n Euler ’ s Seven Bridges of Königsberg – one of the first problems in graph theory n Is there a route that crosses each bridge only once and returns to the starting point? Source: http://en.wikipedia.org/wiki/Seven_Bridges_of_Königsberg Image 1 – GNU v1.2: Bogdan, Wikipedia; http://commons.wikimedia.org/wiki/Commons:GNU_Free_Documentation_License Image 2 – GNU v1.2: Booyabazooka, Wikipedia; http://commons.wikimedia.org/wiki/Commons:GNU_Free_Documentation_License Image 3 – GNU v1.2: Riojajar, Wikipedia; http://commons.wikimedia.org/wiki/Commons:GNU_Free_Documentation_License

  8. Eulerian paths n If starting point and end point are the same: n only possible if no nodes have an odd degree n each path must visit and leave each shore n If don ’ t need to return to starting point n can have 0 or 2 nodes with an odd degree • Eulerian path: traverse each • Hamiltonian path: visit • edge exactly once • each vertex exactly once

  9. • 2 Node degree from matrix values • 3 • 1 • 4 0 0 0 0 0 n • 5 A ∑ n Outdegree = 0 0 1 1 0 ij • A = j 1 = 0 1 0 1 0 0 0 0 0 1 • example: outdegree for node 3 is 2, which we obtain by summing the number of non- 1 1 0 0 0 zero entries in the 3 rd row n A ∑ 3 j j 1 = 0 0 0 0 0 n A n Indegree = ∑ 0 0 1 1 0 ij • A = i 1 = 0 1 0 1 0 • example: the indegree for node 3 is 1, 0 0 0 0 1 which we obtain by summing the number of 1 1 0 0 0 non-zero entries in the 3 rd column n A ∑ i 3 i 1 =

  10. Defini#ons ¡ ¡ • n ¡x ¡n ¡Adjacency ¡matrix ¡A. ¡ – A(i,j) ¡= ¡weight ¡on ¡edge ¡from ¡ i ¡to ¡ j ¡ – If ¡the ¡graph ¡is ¡undirected ¡A(i,j)=A(j,i), ¡i.e. ¡A ¡is ¡symmetric ¡ • n ¡x ¡n ¡Transi>on ¡matrix ¡P. ¡ – P ¡is ¡row ¡stochas>c ¡ – P(i,j) ¡= ¡probability ¡of ¡stepping ¡on ¡node ¡j ¡from ¡node ¡i ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡= ¡A(i,j)/∑ i A(i,j) ¡ ¡ • n ¡x ¡n ¡Laplacian ¡Matrix ¡L. ¡ – L(i,j)=∑ i A(i,j)-­‑A(i,j) ¡ – Symmetric ¡posi>ve ¡semi-­‑definite ¡for ¡undirected ¡graphs ¡ – Singular ¡ 10

  11. Definitions Adjacency Matrix A B 1 1 1 A= 1 1 C 1 1 1 1 1 1 1 1 1 E D Transition Matrix 1/3 A B 1/2 1/4 1/3 1/2 1/3 1/3 1/3 1/4 1/3 P= 1/2 1/2 C 1/4 1/4 1/4 1/4 1/4 1/3 1/4 1/2 1/3 1/3 1/3 1/3 1/2 1/2 E 1/3 1/2 D 11

  12. Definitions A B Graph Laplacian C L = D – A D D = diag( d ) E D A B C D E A B C D E L A D L 3 -1 -1 -1 3 1 1 1 A A 1 1 1 = – -1 2 -1 2 1 1 B B 1 1 A = 1 1 1 1 -1 -1 4 -1 -1 4 1 1 1 1 C C 1 1 1 D -1 -1 3 -1 3 1 1 1 D 1 1 E E -1 -1 2 2 1 1 d = 3 2 4 3 2 12

  13. Spectral Graph Analysis A B Graph Laplacian C L = D – A D D = diag( d ) E D A B C D E A B C D E L A D L 3 -1 -1 -1 3 1 1 1 A A 1 1 1 = – -1 2 -1 2 1 1 B B 1 1 A = 1 1 1 1 -1 -1 4 -1 -1 4 1 1 1 1 C C 1 1 1 D -1 -1 3 -1 3 1 1 1 D 1 1 E E -1 -1 2 2 1 1 d = 3 2 4 3 2 Take the eigendecomposition of L Λ λ 1 λ 2 λ 5 Q T L L Q = λ 3 λ 4 13

  14. Eigenvectors ¡ • Intui>ve ¡defini>on: ¡ ¡An ¡eigenvector ¡is ¡a ¡ direc>on ¡for ¡a ¡matrix ¡ • An ¡eigenvector ¡of ¡an ¡ n ¡x ¡n ¡matrix ¡A ¡is ¡a ¡vector ¡ Av v such ¡that ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡, ¡where ¡ v ¡is ¡the ¡eigenvector ¡ = λ and ¡λ ¡is ¡the ¡corresponding ¡eigenvalue ¡ – Mul>plying ¡vector ¡v ¡by ¡the ¡scalar ¡λ ¡effec>vely ¡ stretches ¡or ¡shrinks ¡the ¡vector ¡ • An ¡ n ¡x ¡n ¡matrix ¡should ¡have ¡ n ¡linearly ¡ independent ¡eigenvectors ¡

  15. Eigenvectors ¡Illustrated ¡ • Consider ¡an ¡ellip>cal ¡data ¡cloud. ¡ ¡The ¡ eigenvectors ¡are ¡then ¡the ¡major ¡and ¡minor ¡ axes ¡of ¡the ¡ellipse ¡

  16. Spectral Graph Analysis Q Λ Q T q 1 λ 1 T q 2 λ 2 T = L L q 1 q 2 q 3 q 4 q 5 λ 3 q 3 T λ 4 q 4 T λ 5 q 5 T Eigenvector q 1 is constant Eigenvalue λ 1 = 0 L q 1 q 2 q 3 q 4 q 5 3 4 5 1 2 Q 3 -1 -1 -1 0.45 -0.27 -0.5 -0.65 0.22 Λ 0.00 0 0 0 0 A -1 2 -1 0.45 -0.65 0.5 0.27 0.22 0 1.59 0 0 0 B -1 -1 4 -1 -1 0.45 -0.00 0.00 0.00 -0.89 0 0 3.00 0 0 C -1 -1 3 -1 0.45 0.27 -0.5 0.65 0.22 0 0 0 4.41 0 D -1 -1 2 0.45 0.65 0.5 -0.27 0.22 0 0 0 0 5.00 E 16

  17. Spectral Graph Analysis Q Λ Q T q 1 λ 1 T q 2 λ 2 T = L L q 1 q 2 q 3 q 4 q 5 λ 3 q 3 T λ 4 q 4 T λ 5 q 5 T q 2 q 2 q 1 q 1 q 5 q 10 q 2 q 1 q 20 q 50 17 Meshes provided by Gabriel Peyré

  18. Random ¡Walks ¡ Transition matrix P Adjacency ¡matrix ¡A ¡ 1 1 1/2 1 1 1 1/2 1 18

  19. What ¡is ¡a ¡random ¡walk ¡ t=0 1 1/2 1 1/2 19

  20. What ¡is ¡a ¡random ¡walk ¡ t=1 t=0 1 1 1/2 1/2 1 1 1/2 1/2 20

  21. What ¡is ¡a ¡random ¡walk ¡ t=1 t=0 1 1 1/2 1/2 1 1 1/2 1/2 t=2 1 1/2 1 1/2 21

  22. What ¡is ¡a ¡random ¡walk ¡ t=1 t=0 1 1 1/2 1/2 1 1 1/2 1/2 t=2 t=3 1 1/2 1 1 1/2 1 1/2 1/2 22

  23. Probability ¡Distribu>ons ¡ φ ( t ) • ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡= ¡probability ¡that ¡the ¡surfer ¡is ¡at ¡node ¡ i ¡at ¡>me ¡ t ¡ i φ ( t +1) φ ( t ) X • ¡ ¡ = × Pr( j → i ) i i j φ ( t +1) = φ ( t ) • ¡ ¡ × P i i = φ ( t − 1) × P × P i = φ ( t − 2) × P × P × P i · · · = φ (0) × P t i • What ¡happens ¡when ¡the ¡surfer ¡walks ¡for ¡a ¡long ¡>me? ¡ 23

  24. Sta>onary ¡Distribu>on ¡ • When ¡the ¡surfer ¡keeps ¡walking ¡for ¡a ¡long ¡>me ¡ • When ¡the ¡distribu>on ¡does ¡not ¡change ¡anymore ¡ φ ( t +1) = φ ( t ) – i.e. ¡ ¡ • For ¡ “ well-­‑behaved ” ¡graphs ¡this ¡does ¡not ¡depend ¡ on ¡the ¡start ¡distribu>on!! ¡ 24

  25. What ¡is ¡a ¡sta>onary ¡distribu>on? ¡ ¡ Intui>vely ¡and ¡Mathema>cally ¡ 25

  26. What ¡is ¡a ¡sta>onary ¡distribu>on? ¡ ¡ Intui>vely ¡and ¡Mathema>cally ¡ • The ¡sta>onary ¡distribu>on ¡at ¡a ¡node ¡is ¡related ¡to ¡the ¡amount ¡of ¡ >me ¡a ¡random ¡walker ¡spends ¡visi>ng ¡that ¡node. ¡ 26

  27. What ¡is ¡a ¡sta>onary ¡distribu>on? ¡ ¡ Intui>vely ¡and ¡Mathema>cally ¡ • The ¡sta>onary ¡distribu>on ¡at ¡a ¡node ¡is ¡related ¡to ¡the ¡amount ¡of ¡ >me ¡a ¡random ¡walker ¡spends ¡visi>ng ¡that ¡node. ¡ • Remember ¡that ¡we ¡can ¡write ¡the ¡probability ¡distribu>on ¡as ¡ φ ( t +1) = φ ( t ) × P 27

  28. What ¡is ¡a ¡sta>onary ¡distribu>on? ¡ ¡ Intui>vely ¡and ¡Mathema>cally ¡ • The ¡sta>onary ¡distribu>on ¡at ¡a ¡node ¡is ¡related ¡to ¡the ¡amount ¡of ¡ >me ¡a ¡random ¡walker ¡spends ¡visi>ng ¡that ¡node. ¡ • Remember ¡that ¡we ¡can ¡write ¡the ¡probability ¡distribu>on ¡as ¡ φ ( t +1) = φ ( t ) × P φ ( ∞ ) • For ¡the ¡sta>onary ¡distribu>on ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ we ¡have ¡ φ ( ∞ ) = φ ( ∞ ) × P ¡ 28

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend