\documentclass[unicode,11pt,a4paper,oneside,numbers=endperiod,openany]{scrartcl}
\usepackage{graphicx}
\usepackage{subcaption}
\usepackage{amsmath}
\input{assignment.sty}


\hyphenation{PageRank}
\hyphenation{PageRanks}


\begin{document}


\setassignment
\setduedate{Wednesday, 14 October 2020, 11:55 PM}

\serieheader{Numerical Computing}{2020}{Student: Claudio Maggioni}{Discussed with: FULL NAME}{Solution for Project 2}{}
\newline

\assignmentpolicy


The purpose of this assignment\footnote{This document is originally
based on a blog from Cleve Moler, who wrote a fantastic blog post about the Lake Arrowhead graph, and John
Gilbert, who initially created the coauthor graph from the 1993 Householder Meeting. You can find more information
at \url{http://blogs.mathworks.com/cleve/2013/06/10/lake-arrowhead-coauthor-graph/}.  Most of this assignment is derived
from this archived work.} is to learn the importance of sparse linear algebra algorithms to solve fundamental
questions in social network analyses.
We will use the coauthor graph from the Householder Meeting and the social network of friendships from Zachary's karate club~\cite{karate}.
These two graphs are one of the first examples where matrix methods were used in computational social network analyses.


\section{The Reverse Cuthill McKee Ordering [10 points]}

The Reverse Cuthill McKee Ordering of matrix \texttt{A\_SymPosDef} is computed with MATLAB's \texttt{sysrcm(\ldots)} and
the matrix is rearranged accordingly. Here are the spy plot of these matrices:

\begin{figure}[h]
\centering
\begin{subfigure}{0.49\textwidth}
\centering
\includegraphics[width = \textwidth]{1_spy_a}
	\caption{Spy plot of \texttt{A\_SymPosDef}}
\end{subfigure}
\begin{subfigure}{0.49\textwidth}
\centering
\includegraphics[width = \textwidth]{1_spy_rcm}
	\caption{Spy plot of \texttt{sysrcm(\ldots)} rearranged version of \texttt{A\_SymPosDef}}
\end{subfigure}
	\caption{Spy plots of the two matrices}
\label{fig:1}
\end{figure}

And the spy plots of the corresponding Cholesky factor are listed in figure~\ref{fig:1chol}.

\begin{figure}[h]
\centering
\begin{subfigure}{0.49\textwidth}
\centering
\includegraphics[width = \textwidth]{1_spy_chol_a}
	\caption{Spy plot of \texttt{chol(A\_SymPosDef)}}
\end{subfigure}
\begin{subfigure}{0.49\textwidth}
\centering
\includegraphics[width = \textwidth]{1_spy_chol_rcm}
	\caption{Spy plot of \texttt{chol(A\_SymPosDef(sysrcm(A\_SymPosDef), sysrcm(A\_SymPosDef)))}}
\end{subfigure}
	\caption{Spy plots of the two Cholesky factors}
\label{fig:1chol}
\end{figure}

The number of nonzero elements in the Cholesky factor of the RCM optimized matrix are significantly lower (circa 0.1x) of the ones in the vanilla process. The respective nonzero counts can be found in figure~\ref{fig:1chol}.

\section{Sparse Matrix Factorization [10 points]}

\subsection{Show that $A \in R^{n x n}$ has exactly $5n - 6$ nonzero elements.}

The given description of $A$ says that all the element at the edges of the
matrix (rows and columns 1 and $n$) plus all the elements on the main diagonal
are the only nonzero elements of $A$. Therefore, this cells can be counted as
the 4 vertex cells in the matrix square plus 5 $n-2$-long segments,
corresponding to all edges and the main diagonal. Therefore:

\[4 + 5 \dot (n - 2) = 5n - 6\]

\subsection{Construct this matrix and visualize its non-zero structure.}

The matrix $A \in R^{n x n}$ looks like this (zero entries are represented as
blanks):

\[
A :=  \begin{bmatrix}
	1 & 1 & 1 & \hdots & 1 \\
	1 & 1 &           && 1 \\
	1 &   & 1         && 1 \\
	\vdots & & & \ddots & \vdots \\
	1 & 1 & 1 & \hdots & 1 \\
    \end{bmatrix}
\]

\subsection{Explain why for n = $100000$ using Matlab’s \texttt{chol(\ldots)}
to solve $Ax = b$
for a given righthand-side vector would be problematic.}

\textbf{A IS NOT POSITIVE DEFINITE: CHECK WITH EDOARDO}

\section{Degree Centrality [10 points]}

Assuming that the degree of the Householder graph is the number of co-authors of
each author and that an author is not co-author of himself, the degree
centralities of all authors sorted in descending order are below.

This output has been obtained by running \texttt{ex2.m}.

\begin{verbatim}
Author Centrality: Coauthors...

Golub 31: Wilkinson TChan Varah Overton Ernst VanLoan Saunders Bojanczyk
          Dubrulle George Nachtigal Kahan Varga Kagstrom Widlund
          OLeary Bjorck Eisenstat Zha VanDooren Tang Reichel Luk Fischer
          Gutknecht Heath Plemmons Berry Sameh Meyer Gill
Demmel 15: Edelman VanLoan Bai Schreiber Kahan Kagstrom Barlow
           NHigham Arioli Duff Hammarling Bunch Heath Greenbaum Gragg
Plemmons 13: Golub Nagy Harrod Pan Funderlic Bojanczyk George Barlow Heath
             Berry Sameh Meyer Nichols
Heath 12: Golub TChan Funderlic George Gilbert Eisenstat Ng Liu Laub Plemmons
          Paige Demmel
Schreiber 12: TChan VanLoan Moler Gilbert Pothen NTrefethen Bjorstad NHigham
              Eisenstat Tang Elden Demmel
Hammarling 10: Wilkinson Kaufman Bai Bjorck VanHuffel VanDooren Duff Greenbaum
               Gill Demmel
VanDooren 10: Golub Boley Bojanczyk Kagstrom VanHuffel Luk Hammarling Laub
              Nichols Paige
TChan 10: Golub Saied Ong Kuo Tong Schreiber Arioli Duff Heath Hansen
Gragg 9: Borges Kaufman Harrod Reichel Stewart BunseGerstner Ammar Warner Demmel
Moler 8: Wilkinson VanLoan Gilbert Schreiber Henrici Stewart Bunch Laub
VanLoan 8: Golub Moler Schreiber Kagstrom Luk Bunch Paige Demmel
Paige 7: Anjos VanLoan Saunders Bjorck VanDooren Laub Heath
Gutknecht 7: Golub Ashby Boley NTrefethen Nachtigal Varga Hochbruck
Luk 7: Golub Overton Boley VanLoan Bojanczyk Park VanDooren
Eisenstat 7: Golub Gu George Schreiber Liu Heath Ipsen
George 7: Golub Eisenstat Ng Liu Tang Heath Plemmons
Meyer 6: Golub Benzi Funderlic Stewart Ipsen Plemmons
Bunch 6: LeBorne Fierro VanLoan Moler Stewart Demmel
Stewart 6: Moler Bunch Gragg Meyer Gill Mathias
Reichel 6: Golub NTrefethen Nachtigal Fischer Gragg Ammar
Bjorck 6: Golub Park Duff Hammarling Elden Paige
NTrefethen 6: Schreiber Nachtigal Reichel Gutknecht Greenbaum ATrefethen
Nichols 5: Byers Barlow VanDooren Plemmons BunseGerstner
Greenbaum 5: Cullum Strakos NTrefethen Hammarling Demmel
Ipsen 5: Chandrasekaran Barlow Eisenstat Meyer Jessup
Laub 5: Kenney Moler VanDooren Heath Paige
Duff 5: TChan Bjorck Arioli Hammarling Demmel
Liu 5: George Gilbert Eisenstat Ng Heath
Park 5: Boley Bjorck VanHuffel Luk Elden
Zha 5: Golub Bai Barlow VanHuffel Hansen
Widlund 5: Golub Bjorstad OLeary Smith Szyld
Barlow 5: Zha Ipsen Plemmons Nichols Demmel
Kagstrom 5: Golub VanLoan VanDooren Ruhe Demmel
Varga 5: Golub Marek Young Gutknecht Starke
Gilbert 5: Moler Schreiber Ng Liu Heath
Gill 4: Golub Saunders Hammarling Stewart
Sameh 4: Golub Harrod Plemmons Berry
Berry 4: Golub Harrod Plemmons Sameh
BunseGerstner 4: He Byers Gragg Nichols
Hansen 4: TChan Fierro OLeary Zha
Ng 4: George Gilbert Liu Heath
Arioli 4: TChan MuntheKaas Duff Demmel
VanHuffel 4: Zha Park VanDooren Hammarling
Nachtigal 4: Golub NTrefethen Reichel Gutknecht
Bojanczyk 4: Golub VanDooren Luk Plemmons
Harrod 4: Plemmons Gragg Berry Sameh
Boley 4: Park VanDooren Luk Gutknecht
Wilkinson 4: Golub Dubrulle Moler Hammarling
Ammar 3: He Reichel Gragg
Elden 3: Schreiber Bjorck Park
Fischer 3: Golub Modersitzki Reichel
Tang 3: Golub George Schreiber
NHigham 3: Schreiber Pothen Demmel
OLeary 3: Golub Widlund Hansen
Bjorstad 3: Schreiber Widlund Boman
Kahan 3: Golub Davis Demmel
Bai 3: Zha Hammarling Demmel
Saunders 3: Golub Paige Gill
Funderlic 3: Heath Plemmons Meyer
Kaufman 3: Hammarling Gragg Warner
Starke 2: Varga Hochbruck
Hochbruck 2: Gutknecht Starke
Jessup 2: Crevelli Ipsen
Warner 2: Kaufman Gragg
Ruhe 2: Wold Kagstrom
Szyld 2: Marek Widlund
Young 2: Kincaid Varga
Pothen 2: Schreiber NHigham
Tong 2: TChan Kuo
Kuo 2: TChan Tong
Marek 2: Varga Szyld
Dubrulle 2: Golub Wilkinson
Fierro 2: Bunch Hansen
Byers 2: BunseGerstner Nichols
Overton 2: Golub Luk
He 2: BunseGerstner Ammar
Mathias 1: Stewart
Davis 1: Kahan
ATrefethen 1: NTrefethen
Henrici 1: Moler
Smith 1: Widlund
MuntheKaas 1: Arioli
Boman 1: Bjorstad
Chandrasekaran 1: Ipsen
Wold 1: Ruhe
Ong 1: TChan
Saied 1: TChan
Strakos 1: Greenbaum
Cullum 1: Greenbaum
Edelman 1: Demmel
Pan 1: Plemmons
Nagy 1: Plemmons
Gu 1: Eisenstat
Benzi 1: Meyer
Anjos 1: Paige
Crevelli 1: Jessup
Kincaid 1: Young
Borges 1: Gragg
Ernst 1: Golub
Modersitzki 1: Fischer
LeBorne 1: Bunch
Ashby 1: Gutknecht
Kenney 1: Laub
Varah 1: Golub
\end{verbatim}

\section{The Connectivity of the Coauthors [10 points]}

\section{PageRank of the Coauthor Graph [10 points]}

\section{Zachary's karate club: social network of friendships between 34 members [50 points]}

\begin{thebibliography}{99}
\bibitem{karate} The social network of a karate club at a US university, M.~E.~J. Newman and M. Girvan, Phys. Rev. E 69,026113 (2004)
pp. 219-229.
\end{thebibliography}


\end{document}
