Explorar el Código

added some styles, added pseudocode

Martin Thoma hace 12 años
padre
commit
2c4da15048

+ 32 - 0
presentations/English/LaTeX/PageRank.tex

@@ -17,3 +17,35 @@
         \item[\xmark] Total number of links on the source page matters
     \end{itemize}
 \end{frame}
+
+\begin{frame}{Mathematics}
+    Let $x$ be a web page. Then
+    \begin{itemize}
+        \item $L(x)$ is the set of Websites that link to $x$
+        \item $C(y)$ is the out-degree of page $y$
+        \item $\alpha$ is probability of random jump
+        \item $N$ is the total number of websites
+    \end{itemize}
+
+    \[\displaystyle PR(x) := \alpha \left ( \frac{1}{N} \right ) + (1-\alpha) \sum_{y\in L(x)} \frac{PR(y)}{C_{y}}\]
+\end{frame}
+
+\begin{frame}{Pseudocode}
+        \begin{algorithmic}
+\alertline<1>             \Function{PageRank}{Graph $web$, double $q=0.15$, int $iterations$} %q is a damping factor
+\alertline<2>                 \ForAll{$page \in G$}
+\alertline<3>                     \State $page.pageRank = \frac{1}{|G|}$ \Comment{intial probability}
+\alertline<2>                 \EndFor
+
+\alertline<4>                 \While{$iterations > 0$}
+\alertline<5>                     \ForAll{$page \in G$} \Comment{calculate pageRank of $page$}
+\alertline<6>                         \State $page.pageRank = q$
+\alertline<7>                         \ForAll{$y \in L(page)$}
+\alertline<8>                             \State $page.pageRank$ += $\frac{y.pageRank}{C(y)}$
+\alertline<7>                         \EndFor
+\alertline<5>                     \EndFor
+\alertline<4>                     \State $iterations$ -= $1$
+\alertline<4>                 \EndWhile
+\alertline<1>             \EndFunction
+        \end{algorithmic}
+\end{frame}

BIN
presentations/English/LaTeX/google-presentation.pdf


+ 11 - 0
presentations/English/templates/myStyle.sty

@@ -20,6 +20,17 @@
 \usepackage{xcolor}
 \usepackage{pifont}% http://ctan.org/pkg/pifont
 \usepackage{soul}
+\usepackage{algorithm,algpseudocode}
+
+%\algdef{SE}[IF]{NoThenIf}{EndIf}[1]{\algorithmicif\ #1\textbf{:}}{\algorithmicend\ \algorithmicif}%
+\algtext*{EndIf}        % Remove "end if" text
+\algtext*{EndWhile}     % Remove "end while" text
+\algtext*{EndFunction}  % Remove "end while" text
+\algnewcommand\Global{\textbf{global }}
+
+\newcommand{\alertline}{%
+ \usebeamercolor[fg]{normal text}%
+ \only{\usebeamercolor[fg]{alerted text}}}
 
 \newcommand {\framedgraphic}[2] {
     \begin{frame}{#1}