mp1: all done except 1.1
This commit is contained in:
parent
7355b27cd3
commit
b5cc7065de
4 changed files with 450 additions and 39 deletions
|
@ -35,7 +35,7 @@ new_x = x;
|
||||||
old_norm = -1;
|
old_norm = -1;
|
||||||
no = +Inf;
|
no = +Inf;
|
||||||
|
|
||||||
while old_norm == -1 || old_norm > no
|
while (old_norm == -1 || old_norm > no) && no > 1e-8
|
||||||
x = new_x;
|
x = new_x;
|
||||||
old_norm = no;
|
old_norm = no;
|
||||||
new_x = G * x + e * (z * x);
|
new_x = G * x + e * (z * x);
|
||||||
|
@ -44,6 +44,8 @@ while old_norm == -1 || old_norm > no
|
||||||
no = norm(new_x - x, 2);
|
no = norm(new_x - x, 2);
|
||||||
end
|
end
|
||||||
|
|
||||||
|
display(it);
|
||||||
|
|
||||||
% -------------------------------------------------------------------------
|
% -------------------------------------------------------------------------
|
||||||
|
|
||||||
% Normalize so that sum(x) == 1.
|
% Normalize so that sum(x) == 1.
|
||||||
|
|
|
@ -32,28 +32,25 @@ x = e/n;
|
||||||
|
|
||||||
% Check if B will be a singular matrix. If so, change it
|
% Check if B will be a singular matrix. If so, change it
|
||||||
alpha = 1;
|
alpha = 1;
|
||||||
while rcond(A - alpha * I) <= eps
|
while rcond(A - alpha * I) < eps
|
||||||
alpha = alpha + 0.01;
|
alpha = alpha + 0.01;
|
||||||
end
|
end
|
||||||
display(alpha);
|
|
||||||
|
|
||||||
B = (A - alpha * I);
|
|
||||||
|
|
||||||
old_x = zeros(n, 1);
|
old_x = zeros(n, 1);
|
||||||
old_norm = -1;
|
old_norm = -1;
|
||||||
no = +Inf;
|
no = +Inf;
|
||||||
|
|
||||||
it = 0;
|
it = 0;
|
||||||
while old_norm == -1 || old_norm > no
|
while (old_norm == -1 || old_norm > no) && no > 1e-8
|
||||||
old_norm = no;
|
old_norm = no;
|
||||||
old_x = x;
|
old_x = x;
|
||||||
x = B \ x;
|
x = B \ x;
|
||||||
x = x/norm(x, 2);
|
x = x/sum(x);
|
||||||
it = it + 1;
|
it = it + 1;
|
||||||
no = norm(x - old_x, 2);
|
no = norm(x - old_x, 1);
|
||||||
end
|
end
|
||||||
|
|
||||||
x = old_x;
|
x = abs(old_x);
|
||||||
display(it);
|
display(it);
|
||||||
|
|
||||||
% -------------------------------------------------------------------------
|
% -------------------------------------------------------------------------
|
||||||
|
|
BIN
mp1/template.pdf
BIN
mp1/template.pdf
Binary file not shown.
462
mp1/template.tex
462
mp1/template.tex
|
@ -1,3 +1,4 @@
|
||||||
|
% vim: set ts=4 sw=4 et tw=80:
|
||||||
\documentclass[unicode,11pt,a4paper,oneside,numbers=endperiod,openany]{scrartcl}
|
\documentclass[unicode,11pt,a4paper,oneside,numbers=endperiod,openany]{scrartcl}
|
||||||
\usepackage{graphicx}
|
\usepackage{graphicx}
|
||||||
\usepackage{subcaption}
|
\usepackage{subcaption}
|
||||||
|
@ -10,7 +11,7 @@
|
||||||
\setduedate{Thursday, 8 October 2020, 12:00 AM}
|
\setduedate{Thursday, 8 October 2020, 12:00 AM}
|
||||||
|
|
||||||
\serieheader{Numerical Computing}{2020}{Student: Claudio Maggioni}{Discussed with: --}{Solution for Project 1}{}
|
\serieheader{Numerical Computing}{2020}{Student: Claudio Maggioni}{Discussed with: --}{Solution for Project 1}{}
|
||||||
\newline
|
ewline
|
||||||
|
|
||||||
\assignmentpolicy
|
\assignmentpolicy
|
||||||
The purpose of this assignment\footnote{This document is originally based on a SIAM book chapter from \textsl{Numerical Computing with Matlab} from Clever B. Moler.} is to learn the importance of numerical linear algebra algorithms to solve fundamental linear algebra problems that occur in search engines.
|
The purpose of this assignment\footnote{This document is originally based on a SIAM book chapter from \textsl{Numerical Computing with Matlab} from Clever B. Moler.} is to learn the importance of numerical linear algebra algorithms to solve fundamental linear algebra problems that occur in search engines.
|
||||||
|
@ -82,17 +83,17 @@ Finally, we can always observe a line starting from the top-left of G and ending
|
||||||
\begin{subfigure}{\textwidth}
|
\begin{subfigure}{\textwidth}
|
||||||
\begin{verbatim}
|
\begin{verbatim}
|
||||||
|
|
||||||
360 0.0869 31 1 https://creativecommons.org/licenses/by-sa/3.0
|
360 0.0869 1 https://creativecommons.org/licenses/by-sa/3.0
|
||||||
204 0.0406 8 1 https://forum.gitlab.com
|
204 0.0406 8 1 https://forum.gitlab.com
|
||||||
82 0.0189 117 18 https://www.mediawiki.org
|
82 0.01897 https://www.mediawiki.org
|
||||||
81 0.0188 117 4 https://wikimediafoundation.org
|
81 0.01887 4 https://wikimediafoundation.org
|
||||||
87 0.0150 6 1 https://docs.gitea.io
|
87 0.0150 6 1 https://docs.gitea.io
|
||||||
78 0.0145 114 9 https://www.mediawiki.org/wiki/Special:MyLanguage/
|
78 0.01454 9 https://www.mediawiki.org/wiki/Special:MyLanguage/
|
||||||
How_to_contribute
|
How_to_contribute
|
||||||
77 0.0132 77 13 https://foundation.wikimedia.org/wiki/Privacy_policy
|
77 0.0132 https://foundation.wikimedia.org/wiki/Privacy_policy
|
||||||
217 0.0127 40 8 https://bugs.archlinux.org
|
217 0.0127 8 https://bugs.archlinux.org
|
||||||
80 0.0115 107 6 https://foundation.wikimedia.org/wiki/Cookie_statement
|
80 0.01157 6 https://foundation.wikimedia.org/wiki/Cookie_statement
|
||||||
215 0.0114 38 5 https://bbs.archlinux.org
|
215 0.0114 5 https://bbs.archlinux.org
|
||||||
\end{verbatim}
|
\end{verbatim}
|
||||||
\caption{Top 10 webpages with highest PageRank}
|
\caption{Top 10 webpages with highest PageRank}
|
||||||
\end{subfigure}
|
\end{subfigure}
|
||||||
|
@ -115,18 +116,18 @@ Finally, we can always observe a line starting from the top-left of G and ending
|
||||||
\begin{subfigure}{\textwidth}
|
\begin{subfigure}{\textwidth}
|
||||||
\begin{verbatim}
|
\begin{verbatim}
|
||||||
|
|
||||||
411 0.0249 42 1 https://twitter.com/mozilla
|
411 0.0249 1 https://twitter.com/mozilla
|
||||||
63 0.0248 145 1 https://twitter.com/firefox
|
63 0.02485 1 https://twitter.com/firefox
|
||||||
68 0.0203 142 1 https://www.instagram.com/firefox
|
68 0.02032 1 https://www.instagram.com/firefox
|
||||||
412 0.0164 37 1 https://www.instagram.com/mozilla
|
412 0.0164 1 https://www.instagram.com/mozilla
|
||||||
62 0.0080 21 1 https://github.com/mozilla/kitsune
|
62 0.0080 1 https://github.com/mozilla/kitsune
|
||||||
81 0.0070 110 2 https://www.apple.com
|
81 0.00700 2 https://www.apple.com
|
||||||
384 0.0064 5 1 https://www.xfinity.com/privacy/policy/dns
|
384 0.0064 5 1 https://www.xfinity.com/privacy/policy/dns
|
||||||
4 0.0064 32 0 https:
|
4 0.0064 0 https:
|
||||||
377 0.0059 19 1 https://abouthome-snippets-service.readthedocs.io/en/
|
377 0.0059 1 https://abouthome-snippets-service.readthedocs.io/en/
|
||||||
latest/data_collection.html
|
latest/data_collection.html
|
||||||
393 0.0059 19 1 https://www.adjust.com/terms/privacy-policy
|
393 0.0059 1 https://www.adjust.com/terms/privacy-policy
|
||||||
410 0.0057 16 1 https://wiki.mozilla.org/Firefox/Data_Collection
|
410 0.0057 1 https://wiki.mozilla.org/Firefox/Data_Collection
|
||||||
\end{verbatim}
|
\end{verbatim}
|
||||||
\caption{Top 10 webpages with highest PageRank}
|
\caption{Top 10 webpages with highest PageRank}
|
||||||
\end{subfigure}
|
\end{subfigure}
|
||||||
|
@ -149,16 +150,16 @@ Finally, we can always observe a line starting from the top-left of G and ending
|
||||||
\begin{subfigure}{\textwidth}
|
\begin{subfigure}{\textwidth}
|
||||||
\begin{verbatim}
|
\begin{verbatim}
|
||||||
|
|
||||||
55 0.0741 354 1 https://www.instagram.com/usiuniversity
|
55 0.07414 1 https://www.instagram.com/usiuniversity
|
||||||
53 0.0324 366 3 https://www.facebook.com/usiuniversity
|
53 0.03246 3 https://www.facebook.com/usiuniversity
|
||||||
299 0.0248 6 1 https://twitter.com/usi_en
|
299 0.0248 6 1 https://twitter.com/usi_en
|
||||||
329 0.0243 8 1 https://www.facebook.com/USIeLab
|
329 0.0243 8 1 https://www.facebook.com/USIeLab
|
||||||
308 0.0156 7 3 https://www.facebook.com/USIFinancialCommunication
|
308 0.0156 7 3 https://www.facebook.com/USIFinancialCommunication
|
||||||
60 0.0155 316 2 https://www.swissuniversities.ch
|
60 0.01556 2 https://www.swissuniversities.ch
|
||||||
424 0.0144 96 1 https://it.bul.sbu.usi.ch
|
424 0.0144 1 https://it.bul.sbu.usi.ch
|
||||||
330 0.0123 6 4 https://www.facebook.com/USI.ITDxC
|
330 0.0123 6 4 https://www.facebook.com/USI.ITDxC
|
||||||
320 0.0122 7 1 https://www.facebook.com/usiimeg
|
320 0.0122 7 1 https://www.facebook.com/usiimeg
|
||||||
56 0.0107 320 0 https://www.youtube.com/usiuniversity
|
56 0.01070 0 https://www.youtube.com/usiuniversity
|
||||||
\end{verbatim}
|
\end{verbatim}
|
||||||
\caption{Top 10 webpages with highest PageRank}
|
\caption{Top 10 webpages with highest PageRank}
|
||||||
\end{subfigure}
|
\end{subfigure}
|
||||||
|
@ -214,7 +215,7 @@ First we compute the matrix A, finding:
|
||||||
|
|
||||||
We then find the eigenvectors and eigenvalues of A through MATLAB, finding that the solution of $A x = 1 x$ is:
|
We then find the eigenvectors and eigenvalues of A through MATLAB, finding that the solution of $A x = 1 x$ is:
|
||||||
|
|
||||||
\[x\approx\begin{bmatrix}
|
\[x'\approx\begin{bmatrix}
|
||||||
0.4771\\
|
0.4771\\
|
||||||
0.2630\\
|
0.2630\\
|
||||||
0.3747\\
|
0.3747\\
|
||||||
|
@ -223,6 +224,18 @@ We then find the eigenvectors and eigenvalues of A through MATLAB, finding that
|
||||||
0.4013\\
|
0.4013\\
|
||||||
\end{bmatrix}\]
|
\end{bmatrix}\]
|
||||||
|
|
||||||
|
To obtain more easily interpretable PageRank values, we can require that the sum
|
||||||
|
of all PageRanks should be one. Once we normalize in this way, the result is:
|
||||||
|
|
||||||
|
\[x=\frac{x'}{\sum_{i=1}^{6}x_i}\approx\begin{bmatrix}
|
||||||
|
0.1981\\
|
||||||
|
0.1092\\
|
||||||
|
0.1556\\
|
||||||
|
0.2037\\
|
||||||
|
0.1667\\
|
||||||
|
0.1667\\
|
||||||
|
\end{bmatrix}\]
|
||||||
|
|
||||||
Thus the pageranks are the components of vector $x$, w.r.t. the order given in U.
|
Thus the pageranks are the components of vector $x$, w.r.t. the order given in U.
|
||||||
|
|
||||||
\subsubsection{Describe what happens with this example to both the definition of PageRank and the computation done by pagerank in the limit $p \to 1$.}
|
\subsubsection{Describe what happens with this example to both the definition of PageRank and the computation done by pagerank in the limit $p \to 1$.}
|
||||||
|
@ -233,5 +246,404 @@ In the computation, increasing $p$ decreases $\delta$ (which represents the prob
|
||||||
|
|
||||||
\subsection{PageRanks by solving a sparse linear system [50 points]}
|
\subsection{PageRanks by solving a sparse linear system [50 points]}
|
||||||
|
|
||||||
|
\subsubsection{Create \texttt{pagerank1(G)} by modifying \texttt{pagerank.m} to
|
||||||
|
use the power method instead of solving thesparse linear system. What is an
|
||||||
|
appropriate test for terminating the power iteration?}
|
||||||
|
|
||||||
|
The MATLAB solution to this question can be found on
|
||||||
|
\texttt{files\_data/pagerank1.m}.
|
||||||
|
|
||||||
|
An appropriate termination condition is to stop iterating when the sequence of
|
||||||
|
solution vectors stops converging. This can be achieved by checking when, for an
|
||||||
|
iteration n
|
||||||
|
|
||||||
|
\[||x_n - x_{n-1}|| < ||x_{n-1} - x_{n-2}||\]
|
||||||
|
|
||||||
|
stops holding.
|
||||||
|
|
||||||
|
Since this condition might be too aggressive for a resonably approximated
|
||||||
|
solution, a cutoff value for the norm (say $10^{-8}$) can also be introduced.
|
||||||
|
|
||||||
|
\subsubsection{Create \texttt{pagerank2(G)} by modifying \texttt{pagerank.m}
|
||||||
|
to use the inverse iteration. Set $\alpha$ equal to 0.8, 0.9 and 1 and comment on
|
||||||
|
the different number of iterations they take until convergence. Also, what
|
||||||
|
should be done in the unlikely event that the backslash operation involves a
|
||||||
|
division by zero?}
|
||||||
|
|
||||||
|
The MATLAB solution to this question can be found on
|
||||||
|
\texttt{files\_data/pagerank1.m}.
|
||||||
|
|
||||||
|
The termination condition for the previous exercise is used also in this
|
||||||
|
implementation.
|
||||||
|
|
||||||
|
Iterations are minimal with $\alpha = 1$. For example, for the graph in Figure
|
||||||
|
5 in the assignment, we have 5 iterations for $\alpha = 1$, 8 iterations for
|
||||||
|
$\alpha=0.9$, and 11 iterations for $\alpha=0.8$.
|
||||||
|
|
||||||
|
To avoid divisions by 0 or near-0 numbers we check the reciprocal condition
|
||||||
|
number of the matrix $A - \alpha * I$. If this number is below \texttt{eps},
|
||||||
|
$\alpha$ must be changed. My implementation simply increases $\alpha$ in increments
|
||||||
|
of $10^{-2}$ until a condition number higher than \texttt{eps} is found.
|
||||||
|
|
||||||
|
\subsubsection{Use your functions \texttt{pagerank1.m} and \texttt{pagerank2.m}
|
||||||
|
(set $\alpha = 1$) to compute the PageRanks of the six-node example presented in
|
||||||
|
Figure 1. Make sure you get the correct result from each of your three
|
||||||
|
functions.}
|
||||||
|
|
||||||
|
Here are the results for \texttt{pagerank1.m}:
|
||||||
|
|
||||||
|
\begin{verbatim}
|
||||||
|
Using power method implementation
|
||||||
|
page-rank in out url
|
||||||
|
1 0.3210 2 2 alpha
|
||||||
|
6 0.2007 2 1 sigma
|
||||||
|
2 0.1705 1 2 beta
|
||||||
|
4 0.1368 2 1 delta
|
||||||
|
3 0.1066 1 3 gamma
|
||||||
|
5 0.0643 1 0 rho
|
||||||
|
\end{verbatim}
|
||||||
|
|
||||||
|
And here are the results for \texttt{pagerank2.m}:
|
||||||
|
|
||||||
|
\begin{verbatim}
|
||||||
|
Using inverse iteration implementation
|
||||||
|
page-rank in out url
|
||||||
|
1 0.3210 2 2 alpha
|
||||||
|
6 0.2007 2 1 sigma
|
||||||
|
2 0.1705 1 2 beta
|
||||||
|
4 0.1368 2 1 delta
|
||||||
|
3 0.1066 1 3 gamma
|
||||||
|
5 0.0643 1 0 rho
|
||||||
|
\end{verbatim}
|
||||||
|
|
||||||
|
\subsubsection{Use your functions \texttt{pagerank1.m} and \texttt{pagerank2.m}
|
||||||
|
(set $\alpha = 1$) to compute the PageRanks of the six-node example presented in
|
||||||
|
Figure 5. Discuss the differences between the results obtained now and the ones
|
||||||
|
obtained in question 4.}
|
||||||
|
|
||||||
|
Here are the results for \texttt{pagerank1.m}:
|
||||||
|
|
||||||
|
\begin{verbatim}
|
||||||
|
Using power method implementation
|
||||||
|
page-rank in out url
|
||||||
|
4 0.2037 2 1 delta
|
||||||
|
1 0.1981 1 2 alpha
|
||||||
|
5 0.1667 1 1 rho
|
||||||
|
6 0.1667 1 1 sigma
|
||||||
|
3 0.1556 2 1 gamma
|
||||||
|
2 0.1092 1 2 beta
|
||||||
|
\end{verbatim}
|
||||||
|
|
||||||
|
And here are the results for \texttt{pagerank2.m}:
|
||||||
|
|
||||||
|
\begin{verbatim}
|
||||||
|
Using inverse iteration implementation
|
||||||
|
page-rank in out url
|
||||||
|
4 0.2037 2 1 delta
|
||||||
|
1 0.1981 1 2 alpha
|
||||||
|
5 0.1667 1 1 rho
|
||||||
|
6 0.1667 1 1 sigma
|
||||||
|
3 0.1556 2 1 gamma
|
||||||
|
2 0.1092 1 2 beta
|
||||||
|
\end{verbatim}
|
||||||
|
|
||||||
|
Both results are almost identical, with differences in the order of $10^{-8}$
|
||||||
|
due to the approximation introduced by the termination conditions. This results
|
||||||
|
are also approximately equal to the ones obtained manually once the normalization process
|
||||||
|
by the sum of components is applied.
|
||||||
|
|
||||||
|
\subsubsection{Use your functions \texttt{pagerank1.m} and \texttt{pagerank2.m}
|
||||||
|
(set $\alpha = 1$) to compute the PageRanks of the three selected graphs from
|
||||||
|
exercise 2. Report on the convergence of e.g. the power iteration for these
|
||||||
|
subgraphs and summarize the advantage of the power method implemented in
|
||||||
|
\texttt{pagerank2.m} against the original implementation in
|
||||||
|
\texttt{pagerank.m}.}
|
||||||
|
|
||||||
|
In the following outputs, \texttt{it = <number>} represents the number of
|
||||||
|
iterations required to compute the PageRanks within the termination criteria
|
||||||
|
described before.
|
||||||
|
|
||||||
|
Here are the results for \texttt{pagerank1.m} for starting website
|
||||||
|
\texttt{http://atelier.inf.usi.ch/\~{}maggicl}:
|
||||||
|
\begin{verbatim}
|
||||||
|
Using power method implementation
|
||||||
|
|
||||||
|
it = 73
|
||||||
|
|
||||||
|
page-rank in out url
|
||||||
|
360 0.0869 31 1 https://creativecommons.org/licenses/by-sa/3.0
|
||||||
|
204 0.0406 8 1 https://forum.gitlab.com
|
||||||
|
82 0.0189 117 18 https://www.mediawiki.org
|
||||||
|
81 0.0188 117 4 https://wikimediafoundation.org
|
||||||
|
87 0.0150 6 1 https://docs.gitea.io
|
||||||
|
78 0.0145 114 9 https://www.mediawiki.org/wiki/Special:MyLanguage
|
||||||
|
/How_to_contribute
|
||||||
|
77 0.0132 77 13 https://foundation.wikimedia.org/wiki/Privacy_policy
|
||||||
|
217 0.0127 40 8 https://bugs.archlinux.org
|
||||||
|
80 0.0115 107 6 https://foundation.wikimedia.org/wiki/Cookie_statement
|
||||||
|
215 0.0114 38 5 https://bbs.archlinux.org
|
||||||
|
216 0.0114 38 8 https://wiki.archlinux.org
|
||||||
|
218 0.0114 38 6 https://security.archlinux.org
|
||||||
|
428 0.0107 9 1 https://www.dnb.de/kataloghilfe
|
||||||
|
219 0.0102 38 7 https://aur.archlinux.org
|
||||||
|
359 0.0098 9 1 https://creativecommons.org/publicdomain/zero/1.0
|
||||||
|
366 0.0092 27 21 https://archive.org
|
||||||
|
446 0.0089 24 5 https://foundation.wikimedia.org/wiki/Terms_of_Use
|
||||||
|
83 0.0079 78 0 https:\/\/schema.org
|
||||||
|
85 0.0074 77 0 https:\/\/www.wikimedia.org\/static\/images
|
||||||
|
\/wmf-hor-googpub.png
|
||||||
|
181 0.0066 8 2 https://gitlab.com
|
||||||
|
95 0.0062 2 1 https://www.enable-javascript.com
|
||||||
|
113 0.0061 13 1 https://www.britannica.com/topic/polenta
|
||||||
|
429 0.0058 8 1 https://www.dnb.de/EN/Home/home_node.html
|
||||||
|
432 0.0058 8 1 https://www.dnb.de/expertensuche
|
||||||
|
417 0.0058 8 1 https://www.dnb.de/DE/Home/home_node.html
|
||||||
|
379 0.0057 24 2 https://blog.archive.org
|
||||||
|
213 0.0057 32 7 https://www.archlinux.org
|
||||||
|
99 0.0056 3 1 https://www.usi.ch/it
|
||||||
|
19 0.0051 4 1 https://creativecommons.org/licenses/by-nc-sa/4.0
|
||||||
|
214 0.0050 31 5 https://www.archlinux.org/packages
|
||||||
|
220 0.0050 31 6 https://www.archlinux.org/download
|
||||||
|
\end{verbatim}
|
||||||
|
|
||||||
|
Here are the results for \texttt{pagerank2.m} for starting website
|
||||||
|
\texttt{http://atelier.inf.usi.ch/\~{}maggicl}:
|
||||||
|
|
||||||
|
\begin{verbatim}
|
||||||
|
Using inverse iteration implementation
|
||||||
|
|
||||||
|
it = 7
|
||||||
|
|
||||||
|
page-rank in out url
|
||||||
|
360 0.0869 31 1 https://creativecommons.org/licenses/by-sa/3.0
|
||||||
|
204 0.0406 8 1 https://forum.gitlab.com
|
||||||
|
82 0.0189 117 18 https://www.mediawiki.org
|
||||||
|
81 0.0188 117 4 https://wikimediafoundation.org
|
||||||
|
87 0.0150 6 1 https://docs.gitea.io
|
||||||
|
78 0.0145 114 9 https://www.mediawiki.org/wiki/Special:MyLanguage
|
||||||
|
/How_to_contribute
|
||||||
|
77 0.0132 77 13 https://foundation.wikimedia.org/wiki/Privacy_policy
|
||||||
|
217 0.0127 40 8 https://bugs.archlinux.org
|
||||||
|
80 0.0115 107 6 https://foundation.wikimedia.org/wiki/Cookie_statement
|
||||||
|
215 0.0114 38 5 https://bbs.archlinux.org
|
||||||
|
216 0.0114 38 8 https://wiki.archlinux.org
|
||||||
|
218 0.0114 38 6 https://security.archlinux.org
|
||||||
|
428 0.0107 9 1 https://www.dnb.de/kataloghilfe
|
||||||
|
219 0.0102 38 7 https://aur.archlinux.org
|
||||||
|
359 0.0098 9 1 https://creativecommons.org/publicdomain/zero/1.0
|
||||||
|
366 0.0092 27 21 https://archive.org
|
||||||
|
446 0.0089 24 5 https://foundation.wikimedia.org/wiki/Terms_of_Use
|
||||||
|
83 0.0079 78 0 https:\/\/schema.org
|
||||||
|
85 0.0074 77 0 https:\/\/www.wikimedia.org\/static\/images
|
||||||
|
\/wmf-hor-googpub.png
|
||||||
|
181 0.0066 8 2 https://gitlab.com
|
||||||
|
95 0.0062 2 1 https://www.enable-javascript.com
|
||||||
|
113 0.0061 13 1 https://www.britannica.com/topic/polenta
|
||||||
|
429 0.0058 8 1 https://www.dnb.de/EN/Home/home_node.html
|
||||||
|
432 0.0058 8 1 https://www.dnb.de/expertensuche
|
||||||
|
417 0.0058 8 1 https://www.dnb.de/DE/Home/home_node.html
|
||||||
|
379 0.0057 24 2 https://blog.archive.org
|
||||||
|
213 0.0057 32 7 https://www.archlinux.org
|
||||||
|
99 0.0056 3 1 https://www.usi.ch/it
|
||||||
|
19 0.0051 4 1 https://creativecommons.org/licenses/by-nc-sa/4.0
|
||||||
|
220 0.0050 31 6 https://www.archlinux.org/download
|
||||||
|
214 0.0050 31 5 https://www.archlinux.org/packages
|
||||||
|
\end{verbatim}
|
||||||
|
|
||||||
|
Here are the results for \texttt{pagerank1.m} for starting website
|
||||||
|
\texttt{https://www.iisbadoni.edu.it/}:
|
||||||
|
|
||||||
|
\begin{verbatim}
|
||||||
|
Using power method implementation
|
||||||
|
|
||||||
|
it = 75
|
||||||
|
|
||||||
|
page-rank in out url
|
||||||
|
411 0.0249 42 1 https://twitter.com/mozilla
|
||||||
|
63 0.0248 145 1 https://twitter.com/firefox
|
||||||
|
68 0.0203 142 1 https://www.instagram.com/firefox
|
||||||
|
412 0.0164 37 1 https://www.instagram.com/mozilla
|
||||||
|
62 0.0080 21 1 https://github.com/mozilla/kitsune
|
||||||
|
81 0.0070 110 2 https://www.apple.com
|
||||||
|
384 0.0064 5 1 https://www.xfinity.com/privacy/policy/dns
|
||||||
|
4 0.0064 32 0 https:
|
||||||
|
377 0.0059 19 1 https://abouthome-snippets-service.readthedocs.io
|
||||||
|
/en/latest/data_collection.html
|
||||||
|
393 0.0059 19 1 https://www.adjust.com/terms/privacy-policy
|
||||||
|
410 0.0057 16 1 https://wiki.mozilla.org/Firefox/Data_Collection
|
||||||
|
400 0.0057 15 1 https://yandex.ru/legal/confidential
|
||||||
|
396 0.0057 15 1 https://github.com/mozilla-mobile/firefox-ios
|
||||||
|
/blob/master/Docs/MMA.md
|
||||||
|
5 0.0056 31 0 https://ssl
|
||||||
|
3 0.0054 36 0 https://www.iisbadoni.edu.it/sites/default/files
|
||||||
|
/favicon.ico
|
||||||
|
6 0.0054 36 0 https://www.iisbadoni.edu.it/sites/default/files
|
||||||
|
/logo.png
|
||||||
|
208 0.0054 159 0 https://schema.org
|
||||||
|
74 0.0052 178 5 https://foundation.mozilla.org
|
||||||
|
72 0.0052 33 32 https://www.mozilla.org/privacy/websites/#cookies
|
||||||
|
23 0.0051 2 1 https://www.iisbadoni.edu.it/mad
|
||||||
|
300 0.0051 157 0 https://accounts.firefox.com
|
||||||
|
\end{verbatim}
|
||||||
|
|
||||||
|
Here are the results for \texttt{pagerank2.m} for starting website
|
||||||
|
\texttt{https://www.iisbadoni.edu.it}:
|
||||||
|
|
||||||
|
\begin{verbatim}
|
||||||
|
Using inverse iteration implementation
|
||||||
|
|
||||||
|
it = 7
|
||||||
|
|
||||||
|
page-rank in out url
|
||||||
|
411 0.0249 42 1 https://twitter.com/mozilla
|
||||||
|
63 0.0248 145 1 https://twitter.com/firefox
|
||||||
|
68 0.0203 142 1 https://www.instagram.com/firefox
|
||||||
|
412 0.0164 37 1 https://www.instagram.com/mozilla
|
||||||
|
62 0.0080 21 1 https://github.com/mozilla/kitsune
|
||||||
|
81 0.0070 110 2 https://www.apple.com
|
||||||
|
384 0.0064 5 1 https://www.xfinity.com/privacy/policy/dns
|
||||||
|
4 0.0064 32 0 https:
|
||||||
|
393 0.0059 19 1 https://www.adjust.com/terms/privacy-policy
|
||||||
|
377 0.0059 19 1 https://abouthome-snippets-service.readthedocs.io
|
||||||
|
/en/latest/data_collection.html
|
||||||
|
410 0.0057 16 1 https://wiki.mozilla.org/Firefox/Data_Collection
|
||||||
|
400 0.0057 15 1 https://yandex.ru/legal/confidential
|
||||||
|
396 0.0057 15 1 https://github.com/mozilla-mobile/firefox-ios
|
||||||
|
/blob/master/Docs/MMA.md
|
||||||
|
5 0.0056 31 0 https://ssl
|
||||||
|
3 0.0054 36 0 https://www.iisbadoni.edu.it/sites/default/files
|
||||||
|
/favicon.ico
|
||||||
|
6 0.0054 36 0 https://www.iisbadoni.edu.it/sites/default/files
|
||||||
|
/logo.png
|
||||||
|
208 0.0054 159 0 https://schema.org
|
||||||
|
74 0.0052 178 5 https://foundation.mozilla.org
|
||||||
|
72 0.0052 33 32 https://www.mozilla.org/privacy/websites/#cookies
|
||||||
|
23 0.0051 2 1 https://www.iisbadoni.edu.it/mad
|
||||||
|
300 0.0051 157 0 https://accounts.firefox.com
|
||||||
|
\end{verbatim}
|
||||||
|
|
||||||
|
Here are the results for \texttt{pagerank1.m} for starting website
|
||||||
|
\texttt{https://www.usi.ch}:
|
||||||
|
|
||||||
|
\begin{verbatim}
|
||||||
|
Using power method implementation
|
||||||
|
|
||||||
|
it = 66
|
||||||
|
|
||||||
|
page-rank in out url
|
||||||
|
55 0.0741 354 1 https://www.instagram.com/usiuniversity
|
||||||
|
53 0.0324 366 3 https://www.facebook.com/usiuniversity
|
||||||
|
299 0.0248 6 1 https://twitter.com/usi_en
|
||||||
|
329 0.0243 8 1 https://www.facebook.com/USIeLab
|
||||||
|
308 0.0156 7 3 https://www.facebook.com/USIFinancialCommunication
|
||||||
|
60 0.0155 316 2 https://www.swissuniversities.ch
|
||||||
|
424 0.0144 96 1 https://it.bul.sbu.usi.ch
|
||||||
|
330 0.0123 6 4 https://www.facebook.com/USI.ITDxC
|
||||||
|
320 0.0122 7 1 https://www.facebook.com/usiimeg
|
||||||
|
56 0.0107 320 0 https://www.youtube.com/usiuniversity
|
||||||
|
5 0.0096 317 71 https://usi.ch
|
||||||
|
62 0.0090 319 18 https://search.usi.ch
|
||||||
|
337 0.0087 7 1 https://twitter.com/usisoftware
|
||||||
|
63 0.0080 303 19 https://desk.usi.ch
|
||||||
|
130 0.0077 25 0 https://www.swissuniversities.ch/it
|
||||||
|
54 0.0072 208 0 https://twitter.com/USI_university
|
||||||
|
323 0.0066 9 5 https://www.facebook.com/usiorientamento
|
||||||
|
150 0.0062 12 1 https://www.innosuisse.ch/inno/it/home.html
|
||||||
|
248 0.0061 10 1 https://www.facebook.com/usimdfc
|
||||||
|
106 0.0060 132 8 https://newsletter.usi.ch/archive/en
|
||||||
|
135 0.0057 201 0 https://schema.org
|
||||||
|
326 0.0057 6 1 https://www.facebook.com/usialloggimendrisio
|
||||||
|
322 0.0055 6 1 https://www.facebook.com/USImem
|
||||||
|
366 0.0054 6 1 https://www.instagram.com/usi_ics_lugano
|
||||||
|
212 0.0054 12 3 https://www.facebook.com/usimt
|
||||||
|
7 0.0051 211 32 https://search.usi.ch/it
|
||||||
|
6 0.0051 204 0 https://www.usi.ch/sites/all/themes/usiclean
|
||||||
|
/img/bollino-usi.svg
|
||||||
|
14 0.0051 204 62 https://www.usi.ch/originalnode/342
|
||||||
|
15 0.0051 204 57 https://www.usi.ch/originalnode/358
|
||||||
|
16 0.0051 204 62 https://www.usi.ch/originalnode/343
|
||||||
|
17 0.0051 204 57 https://www.usi.ch/originalnode/344
|
||||||
|
18 0.0051 204 58 https://www.usi.ch/en/originalnode/12174
|
||||||
|
20 0.0051 204 60 https://www.usi.ch/originalnode/349
|
||||||
|
21 0.0051 204 62 https://www.usi.ch/originalnode/8996
|
||||||
|
22 0.0051 204 60 https://www.usi.ch/originalnode/348
|
||||||
|
23 0.0051 204 59 https://www.usi.ch/originalnode/351
|
||||||
|
24 0.0051 204 58 https://www.usi.ch/originalnode/350
|
||||||
|
25 0.0051 204 61 https://www.usi.ch/originalnode/353
|
||||||
|
26 0.0051 204 58 https://www.usi.ch/en/originalnode/354
|
||||||
|
27 0.0051 204 59 https://www.usi.ch/originalnode/8014
|
||||||
|
61 0.0051 204 0 https://www.usi.ch/sites/all/themes/usiclean
|
||||||
|
/img/swissuniversities.svg
|
||||||
|
57 0.0050 188 9 https://newsletter.usi.ch/archive
|
||||||
|
\end{verbatim}
|
||||||
|
|
||||||
|
Here are the results for \texttt{pagerank2.m} for starting website
|
||||||
|
\texttt{https://www.usi.ch}:
|
||||||
|
|
||||||
|
\begin{verbatim}
|
||||||
|
Using inverse iteration implementation
|
||||||
|
|
||||||
|
it = 7
|
||||||
|
|
||||||
|
page-rank in out url
|
||||||
|
55 0.0741 354 1 https://www.instagram.com/usiuniversity
|
||||||
|
53 0.0324 366 3 https://www.facebook.com/usiuniversity
|
||||||
|
299 0.0248 6 1 https://twitter.com/usi_en
|
||||||
|
329 0.0243 8 1 https://www.facebook.com/USIeLab
|
||||||
|
308 0.0156 7 3 https://www.facebook.com/USIFinancialCommunication
|
||||||
|
60 0.0155 316 2 https://www.swissuniversities.ch
|
||||||
|
424 0.0144 96 1 https://it.bul.sbu.usi.ch
|
||||||
|
330 0.0123 6 4 https://www.facebook.com/USI.ITDxC
|
||||||
|
320 0.0122 7 1 https://www.facebook.com/usiimeg
|
||||||
|
56 0.0107 320 0 https://www.youtube.com/usiuniversity
|
||||||
|
5 0.0096 317 71 https://usi.ch
|
||||||
|
62 0.0090 319 18 https://search.usi.ch
|
||||||
|
337 0.0087 7 1 https://twitter.com/usisoftware
|
||||||
|
63 0.0080 303 19 https://desk.usi.ch
|
||||||
|
130 0.0077 25 0 https://www.swissuniversities.ch/it
|
||||||
|
54 0.0072 208 0 https://twitter.com/USI_university
|
||||||
|
323 0.0066 9 5 https://www.facebook.com/usiorientamento
|
||||||
|
150 0.0062 12 1 https://www.innosuisse.ch/inno/it/home.html
|
||||||
|
248 0.0061 10 1 https://www.facebook.com/usimdfc
|
||||||
|
106 0.0060 132 8 https://newsletter.usi.ch/archive/en
|
||||||
|
135 0.0057 201 0 https://schema.org
|
||||||
|
326 0.0057 6 1 https://www.facebook.com/usialloggimendrisio
|
||||||
|
322 0.0055 6 1 https://www.facebook.com/USImem
|
||||||
|
366 0.0054 6 1 https://www.instagram.com/usi_ics_lugano
|
||||||
|
212 0.0054 12 3 https://www.facebook.com/usimt
|
||||||
|
7 0.0051 211 32 https://search.usi.ch/it
|
||||||
|
14 0.0051 204 62 https://www.usi.ch/originalnode/342
|
||||||
|
27 0.0051 204 59 https://www.usi.ch/originalnode/8014
|
||||||
|
21 0.0051 204 62 https://www.usi.ch/originalnode/8996
|
||||||
|
22 0.0051 204 60 https://www.usi.ch/originalnode/348
|
||||||
|
25 0.0051 204 61 https://www.usi.ch/originalnode/353
|
||||||
|
61 0.0051 204 0 https://www.usi.ch/sites/all/themes/usiclean
|
||||||
|
/img/swissuniversities.svg
|
||||||
|
16 0.0051 204 62 https://www.usi.ch/originalnode/343
|
||||||
|
23 0.0051 204 59 https://www.usi.ch/originalnode/351
|
||||||
|
15 0.0051 204 57 https://www.usi.ch/originalnode/358
|
||||||
|
17 0.0051 204 57 https://www.usi.ch/originalnode/344
|
||||||
|
24 0.0051 204 58 https://www.usi.ch/originalnode/350
|
||||||
|
6 0.0051 204 0 https://www.usi.ch/sites/all/themes/usiclean
|
||||||
|
/img/bollino-usi.svg
|
||||||
|
20 0.0051 204 60 https://www.usi.ch/originalnode/349
|
||||||
|
26 0.0051 204 58 https://www.usi.ch/en/originalnode/354
|
||||||
|
18 0.0051 204 58 https://www.usi.ch/en/originalnode/12174
|
||||||
|
57 0.0050 188 9 https://newsletter.usi.ch/archive
|
||||||
|
\end{verbatim}
|
||||||
|
|
||||||
|
The potential of the algorithm in \texttt{pagerank2.m} compared to the one in
|
||||||
|
\texttt{pagerank.m} is that by using inverse iteration, thus theoretically
|
||||||
|
avoiding a full matrix system solution process, the sparsity of matrix G can be
|
||||||
|
maintained during the computation thus saving memory costs.
|
||||||
|
|
||||||
|
However, since my \texttt{pagerank2.m} implementation is a simplified
|
||||||
|
implementation of the algorithm and indeed uses system solution
|
||||||
|
(MATLAB's \texttt{mldivide}), this
|
||||||
|
theoretical advantages are voided: my implementation is 3 times as long as the
|
||||||
|
original one and uses approximately the same amount of memory. Advantages over
|
||||||
|
\texttt{pagerank1.m} (due to the intentionally increased rate of convergence)
|
||||||
|
are clear: in
|
||||||
|
all the examples above, the inverse iteration implementation is at least 8 times
|
||||||
|
faster than the ``vanilla'' power method.
|
||||||
\end{document}
|
\end{document}
|
||||||
|
|
Reference in a new issue