PageRank.tex 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. \subsection{How can we use this massive amout of information?}
  2. \begin{frame}{How can we use this massive amout of information?}
  3. \begin{itemize}[<+->]
  4. \item 625.3 million websites
  5. \item Wikipedia is one website and has several millions of pages
  6. \item[$\Rightarrow$] we need to rank websites!
  7. \end{itemize}
  8. \end{frame}
  9. \subsection{Idea}
  10. \begin{frame}{Basics of PageRank}
  11. We all know that:
  12. \begin{itemize}[<+->]
  13. \item humans know what is good for them
  14. \item[\xmark] machines don't know what's good for humans
  15. \item humans create websites
  16. \item humans will only \href{http://en.wikipedia.org/wiki/Hyperlink}{link} to websites they like
  17. \item[$\Rightarrow$] hyperlinks are a quality indicator
  18. \end{itemize}
  19. \end{frame}
  20. \begin{frame}{How Could We Use That?}
  21. \begin{itemize}[<+->]
  22. \item simply count number of links to a website
  23. \item[\xmark] 10,000 links from only one page
  24. \item count number of websites that link to a website
  25. \item[\xmark] quality of the linking website matters
  26. \item[\xmark] total number of links on the source page matters
  27. \end{itemize}
  28. \end{frame}
  29. \framedgraphic{A Brilliant Idea}{../images/BrinPage.jpg}
  30. \begin{frame}{Ideas of PageRank}
  31. \begin{itemize}[<+->]
  32. \item decisions of humans are complicated
  33. \item a lot of webpages get visited
  34. \item[$\Rightarrow$] modellize clicks on links as random behaviour
  35. \item links are important
  36. \begin{itemize}
  37. \item links of page A get less important, if A has many links
  38. \item links of page A get more important, if many link to A
  39. \end{itemize}
  40. \item[$\Rightarrow$] if B has a link from A, the rank of B increases by $\frac{Rank(A)}{Links(A)}$
  41. \end{itemize}
  42. \pause[\thebeamerpauses]
  43. \begin{algorithmic}
  44. \If{A links to B}
  45. \State $Rank(B)$ += $\frac{Rank(A)}{Links(A)}$
  46. \EndIf
  47. \end{algorithmic}
  48. \end{frame}
  49. \begin{frame}{What is PageRank?}
  50. The PageRank algorithm calculates the probability of a randomly
  51. clicking user ending up on a given page.
  52. \end{frame}
  53. \input{Animation}
  54. %\begin{frame}{Ants}
  55. % \begin{itemize}[<+->]
  56. % \item Websites = nodes = anthill
  57. % \item Links = edges = paths
  58. % \item You place ants on each node
  59. % \item They walk over the paths
  60. % \item[] (at random, they are ants!)
  61. % \item After some time, some anthills will have more ants than
  62. % others
  63. % \item Those hills are more attractive than others
  64. % \item \# ants is probability that a random user would end on
  65. % a website
  66. % \end{itemize}
  67. %\end{frame}
  68. \begin{frame}{Mathematics}
  69. Let $x$ be a web page. Then
  70. \begin{itemize}
  71. \item $L(x)$ is the set of websites that link to $x$
  72. \item $C(y)$ is the out-degree of page $y$
  73. \item $\alpha$ is probability of random jump
  74. \item $N$ is the total number of websites
  75. \end{itemize}
  76. \[\displaystyle PR(x) := \alpha \left ( \frac{1}{N} \right ) + (1-\alpha) \sum_{y\in L(x)} \frac{PR(y)}{C(y)}\]
  77. \end{frame}
  78. \begin{frame}{Pseudocode}
  79. \begin{algorithmic}
  80. \alertline<1> \Function{PageRank}{Graph $web$, double $q=0.15$, int $iterations$} %q is a damping factor
  81. %\alertline<2> \ForAll{$page \in web$}
  82. %\alertline<3> \State $page.pageRank = \frac{1}{|web|}$ \Comment{intial probability}
  83. %\alertline<2> \EndFor
  84. \alertline<2> \While{$iterations > 0$}
  85. \alertline<3> \ForAll{$page \in web$} \Comment{calculate pageRank of $page$}
  86. \alertline<4> \State $page.pageRank = q$
  87. \alertline<5> \ForAll{$y \in L(page)$}
  88. \alertline<6> \State $page.pageRank$ += $\frac{y.pageRank}{C(y)}$
  89. \alertline<5> \EndFor
  90. \alertline<3> \EndFor
  91. \alertline<2> \State $iterations$ -= $1$
  92. \alertline<2> \EndWhile
  93. \alertline<1> \EndFunction
  94. \end{algorithmic}
  95. \end{frame}