diff --git a/mp2/Project.2.Maggioni.Claudio/ex2.m b/mp2/Project.2.Maggioni.Claudio/ex3.m similarity index 100% rename from mp2/Project.2.Maggioni.Claudio/ex2.m rename to mp2/Project.2.Maggioni.Claudio/ex3.m diff --git a/mp2/Project.2.Maggioni.Claudio/ex4.m b/mp2/Project.2.Maggioni.Claudio/ex4.m new file mode 100644 index 0000000..1494eec --- /dev/null +++ b/mp2/Project.2.Maggioni.Claudio/ex4.m @@ -0,0 +1,8 @@ +clear; +clc; +load('householder/housegraph.mat') +names = split(strtrim(convertCharsToStrings(name'))); + +common1 = names((A(:,Golub) .* A(:, Moler)) == 1) +common2 = names((A(:,Golub) .* A(:, Saunders)) == 1) +common3 = names((A(:,TChan) .* A(:, Demmel)) == 1) diff --git a/mp2/project.2.Maggioni.Claudio.pdf b/mp2/project.2.Maggioni.Claudio.pdf index fc3f1bb..e96962e 100644 Binary files a/mp2/project.2.Maggioni.Claudio.pdf and b/mp2/project.2.Maggioni.Claudio.pdf differ diff --git a/mp2/project.2.Maggioni.Claudio.tex b/mp2/project.2.Maggioni.Claudio.tex index 5439aa5..82aa006 100644 --- a/mp2/project.2.Maggioni.Claudio.tex +++ b/mp2/project.2.Maggioni.Claudio.tex @@ -91,11 +91,11 @@ blanks): \[ A := \begin{bmatrix} - 1 & 1 & 1 & \hdots & 1 \\ - 1 & 1 & && 1 \\ - 1 & & 1 && 1 \\ + n & 1 & 1 & \hdots & 1 \\ + 1 & n + 1 & && 1 \\ + 1 & & n + 2 && 1 \\ \vdots & & & \ddots & \vdots \\ - 1 & 1 & 1 & \hdots & 1 \\ + 1 & 1 & 1 & \hdots & 2n - 1 \\ \end{bmatrix} \] @@ -103,7 +103,14 @@ A := \begin{bmatrix} to solve $Ax = b$ for a given righthand-side vector would be problematic.} -\textbf{A IS NOT POSITIVE DEFINITE: CHECK WITH EDOARDO} +Solving $Ax = b$ would be a costly operation since the a Cholesky +decomposition of matrix $A$ (performed using MATLAB's \texttt{chol(\ldots)}) +would drastically reduce the number of zero elements in the matrix in the very +first iteration. This is due to the fact that the first row, by definition, is +made of of only nonzero elements (namely 1s) and by subtracting the first row to +every other row (as what would effectively happen in the first iteration of the +Cholesky decomposition of A) the zero elements would become (negative) nonzero +elements, thus making all columns but the first almost empty of 0s. \section{Degree Centrality [10 points]} @@ -233,6 +240,21 @@ Varah 1: Golub \section{The Connectivity of the Coauthors [10 points]} +The author indexes of the common authors between the author at index $i$ and the +author at index $j$ can be computed by listing the indexes of the nonzero +elements in the Schur product (or element-wise product) between $A_{:,i}$ and +$A_{:,j}$ (respectively the i-th and j-th column vector of $A$). Therefore the set $C$ of common coauthor's indexes can be defined +as: + +\[C = \{i \in N_0 \;|\; (A_{:,i} \odot A_{:,j})_i = 1\}\] + +The common Co-authors between Golub and Moler are Wilkinson and Van Loan. + +The common Co-authors between Golub and Saunders are Golub, Saunders and Gill. + +The common Co-authors between TChan and Demmel are Schreiber, Arioli, Duff and +Heath. + \section{PageRank of the Coauthor Graph [10 points]} \section{Zachary's karate club: social network of friendships between 34 members [50 points]}