%! TEX root = GT.tex
% vim: tw=50
% 23/11/2023 09AM

\newpage
\mychapter{Algebraic Methods}

\begin{flashcard}[diameter-defn]
\begin{definition*}[Diameter]
  \glspropdefn{diam}{diameter}{\gls{graph}}
  \cloze{The \emph{diameter} of $G$ is
  $\max\{\dist(x, y) : x, y \in G\}$.}
\end{definition*}
\end{flashcard}

\begin{example*}
  \phantom{}
  \begin{center}
    \includegraphics[width=0.6\linewidth]{images/b1a362aac8814808.png}
  \end{center}
  has diameter $3$.
\end{example*}
\vspace{-1em}

Thus $G$ has \gls{diam} $1$ $\iff$ $G$ is a
\gls{complete_graph}.

What about \gls{diam} $2$? How large can $n = |G|$
be in terms of $\maxdeg(G)$? `Expanding out' from
a \gls{vertex} $x$, we see
\[ \vset(G) = \{x\} \cup \nbd(x) \cup
\nbd(\nbd(x)) ,\]
whence
\[ n \le 1 + \maxdeg + \maxdeg(\maxdeg - 1) = 1 +
\maxdeg^2 .\]
So if $n = \maxdeg^2 + 1$, then $G$ is
$\maxdeg$-regular (as $x$ is arbitrary).

\begin{flashcard}[moore-graph]
\begin{definition*}[Moore graph]
  \glsnoundefn{moore_graph}{Moore graph}{Moore
  graphs}
  \cloze{A \kreg{k} graph is a \emph{Moore graph} or a
  \emph{Moore graph of diameter $2$} if $G$ has
  \gls{diam} $2$ and $|G| = k^2 + 1$.

  Equivalently, \kreg{k} $G$ is a Moore graph
  $\iff$ any distinct $x, y$ joined by a
  \emph{unique} path of length $\le 2$ ($k \neq
  1$).

  Equivalently: \gls{diam} $2$ and no $C_3$ or
  $C_4$ in $G$ (in other words, \gls{girth} $\ge
  5$).
  }
\end{definition*}
\end{flashcard}

\begin{example*}
  $k = 2$:
  \begin{center}
    \includegraphics[width=0.6\linewidth]{images/688a60c0916a46d7.png}
  \end{center}
  Has $2^2 + 1 = 5$ \glspl{vertex} (this graph is
  $\cycle_5$).
\end{example*}

\begin{example*}
  $k = 3$: Want $3^2 + 1 = 10$ \glspl{vertex}:
  \begin{center}
    \includegraphics[width=0.6\linewidth]{images/091396343a7144fc.png}
  \end{center}
  but the Petersen graph works:
  \begin{center}
    \begin{tsqx}
      ! size(5cm);
      A .= dir 90
      B .= dir 162
      C .= dir 235
      D .= dir 307
      E .= dir 18
      a .= 0.5*A
      b .= 0.5*B
      c .= 0.5*C
      d .= 0.5*D
      e .= 0.5*E
      A--B--C--D--E--A
      a--c--e--b--d--a
      a--A
      b--B
      c--C
      d--D
      e--E
    \end{tsqx}
  \end{center}
\end{example*}

\begin{example*}
  $k = 4$: no such example exists.
\end{example*}

\begin{flashcard}[adjacency-matrix-defn]
\begin{definition*}[Adjacency matrix]
  \glsnoundefn{adj_mat}{adjacency
  matrix}{adjacency matrices}
  \glssymboldefn{adj_mat}{$A$}{$A$}
  \glsnoundefn{eval}{eigenvalue}{eigenvalues}
  \glsnoundefn{evec}{eigenvector}{eigenvectors}
  \cloze{For a graph $G$ on vertex-set $\sq[n] = \{1,
  \ldots, n\}$, the \emph{adjacency matrix} of $G$
  is the $n \times n$ matrix $A$ with
  \[ A_{ij} = \begin{cases}
    1 & ij \in E \\
    0 & ij \notin E
  \end{cases} .\]
  So $A$ is a real symmetric matrix.
  }
\end{definition*}
\end{flashcard}

\begin{example*}
  If $G$ is
  \begin{center}
    \begin{tsqx}
      ! size(5cm);
      A .= (-1,-1)
      B .= (1,-1)
      C .= (-1,1)
      D .= (1,1)
      E .= (0,2)
      A--B--D--C--A
      C--E--D
      label 1 @ 1.1*A
      label 2 @ 1.1*B
      label 3 @ 1.1*C
      label 4 @ 1.1*D
      label 5 @ 1.1*E
    \end{tsqx}
  \end{center}
  Then
  \[ A =
  \begin{pmatrix}
    0 & 1 & 1 & 0 & 0 \\
    1 & 0 & 0 & 1 & 0 \\
    1 & 0 & 0 & 1 & 1 \\
    0 & 1 & 1 & 0 & 1 \\
    0 & 0 & 1 & 1 & 0
  \end{pmatrix} .\]
\end{example*}
\vspace{-1em}

So $\adjmat$ contains all the information of $G$.
For example what is $\adjmat^2$?
\[ (\adjmat^2)_{ij} = \sum_k \adjmat_{ik}
\adjmat_{kj} = \#\text{\glspl{walk} of length $2$
from $i$ to $j$.} \]
Similarly
\[ (\adjmat^3)_{ij} = \#\text{\glspl{walk} of
length $3$ from $i$ to $j$} \]
and in general with $3$ replaced with $n$.

Have a linear map from $\RR^n$ to $\RR^n$ given by
$\adjmat$, namely
\[ (\adjmat x)_i = \sum_j \adjmat_{ij} x_j \]
($x \mapsto \adjmat x$).

\begin{example*}
  Using same example as before:
  \begin{center}
    \begin{tsqx}
      ! size(5cm);
      A .= (-1,-1)
      B .= (1,-1)
      C .= (-1,1)
      D .= (1,1)
      E .= (0,2)
      A--B--D--C--A
      C--E--D
      label 1 @ 1.1*A
      label 2 @ 0.8*A+col:red
      label 2 @ 1.1*B
      label -3 @ 0.8*B+col:red
      label 3 @ 1.1*C
      label -5 @ 0.8*C+col:red
      label 4 @ 1.1*D
      label 4 @ 0.8*D+col:red
      label 5 @ 1.1*E
      label 6 @ 0.8*E+col:red
      label $\mapsto$ @ (1.8,0)
      label x @ (0,-1.2)+col:red
    \end{tsqx}
    \begin{tsqx}
      ! size(5cm);
      A .= (-1,-1)
      B .= (1,-1)
      C .= (-1,1)
      D .= (1,1)
      E .= (0,2)
      A--B--D--C--A
      C--E--D
      label 1 @ 1.1*A
      label -5-3 @ 0.8*A+col:red
      label 2 @ 1.1*B
      label 2+4 @ 0.8*B+col:red
      label 3 @ 1.1*C
      label 2+6+4 @ 0.8*C+col:red
      label 4 @ 1.1*D
      label -3-5+6 @ 0.8*D+col:red
      label 5 @ 1.1*E
      label -3+4 @ 0.8*E+col:red
      label Ax @ (0,-1.2)+col:red
    \end{tsqx}
  \end{center}
  ``Add up neighbouring values.''
  i.e. if $x = (2, -3, -5, 4, 6)$ then
  \[ \adjmat x
  = (-5 - 3, 2 + 4, 2 + 6 + 4, -3 - 5 + 6, -5 + 4) \]
\end{example*}
\vspace{-1em}

Since $\adjmat$ is real symmetric, $A$ is
diagonalisable, i.e. there exists basis of
\glspl{eval}, say $e_1, \ldots, e_n$ -- may assume
this is is an orthonormal basis (eash $e_i$ length
$1$, orthogonal to each other). Write \glspl{eval}
(real) as $\lambda_1 \ge \lambda_2 \ge \cdots \ge
\lambda_n$. Have $\sum \lambda_i = 0$ (as
$\Trace(A) = 0$), so $\lambda_1 > 0$ and
$\lambda_n < 0$ (unless $G = E_n$). Often, it is
easy to work out the \glspl{eval} of $G$.

\begin{example*}
  \glsref[eval]{Eigenvalues} of of $\cycle_4$:
  \[ \adjmat =
  \begin{pmatrix}
    0 & 1 & 0 & 1 \\
    1 & 0 & 1 & 0 \\
    0 & 1 & 0 & 1 \\
    1 & 0 & 1 & 0
  \end{pmatrix}\]
  Have $\rank(\adjmat) = 2$, so only $2$ non-zero
  \glspl{eval}. Other two? We can spot that the
  following are \glspl{evec}:
  \begin{center}
    \begin{tsqx}
      ! size(3cm);
      A .= (-1,-1)
      B .= (1,-1)
      C .= (-1,1)
      D .= (1,1)
      A--B--D--C--A
      label 1 @ 1.1*A
      label 1 @ 0.8*A+col:red
      label 2 @ 1.1*B
      label 1 @ 0.8*B+col:red
      label 3 @ 1.1*C
      label 1 @ 0.8*C+col:red
      label 4 @ 1.1*D
      label 1 @ 0.8*D+col:red
    \end{tsqx}
    \qquad
    \begin{tsqx}
      ! size(3cm);
      A .= (-1,-1)
      B .= (1,-1)
      C .= (-1,1)
      D .= (1,1)
      A--B--D--C--A
      label 1 @ 1.1*A
      label 1 @ 0.8*A+col:red
      label 2 @ 1.1*B
      label -1 @ 0.8*B+col:red
      label 3 @ 1.1*C
      label 1 @ 0.8*C+col:red
      label 4 @ 1.1*D
      label -1 @ 0.8*D+col:red
    \end{tsqx}
  \end{center}
  So the \glspl{eval} are $0, 0, 2, -2$ (or find
  $0, 0, 2$ and use that the sum is $0$).
\end{example*}
\vspace{-1em}

Write $\lambda_{\max} = \lambda_1$,
$\lambda{\min} = \lambda_n$ -- eg $C_4$ has
$\lambda_{\max} = 2$, $\lambda_{\min} = -2$.

Know $\lambda_{\max} > 0$, $\lambda_{\min} < 0$
(if $G \neq E_n$).

Have out of \glspl{evec} $e_1, \ldots, e_n$,
\glspl{eval} $\lambda_1, \ldots, \lambda_n$, given
any $x \in \RR^n$, write $x = \sum_i c_i e_i$ for
some $c_1, \ldots, c_n \in \RR$. FIx $\|x\| = 1$,
ie $\sum_i c_i^2 = 1$.

Then $\adjmat x = \sum_i \lambda_i c_i e_i$, so
$\langle \adjmat x, x \rangle = \sum_i \lambda_i
c_i^2$. Hence
\[ \lambda_{\min} \le \langle \adjmat x, x \rangle
\le \lambda_{\max} \quad \forall x \in \RR^n,
\|x\| = 1 .\]
Bounds are attained -- $\langle \adjmat x, x
\rangle = \lambda_{\max}$ if $c_1 = 1$, rest $=
0$. $\langle \adjmat x, x \rangle =
\lambda_{\min}$ if $c_n = 1$, rest $= 0$.

\textbf{Conclusion:}
\[ \lambda_{\max} = \max_{\|x\|=1} \langle \adjmat
x, x \rangle, \qquad \text{and} \qquad
\lambda_{\min} = \min_{\|x\| = 1} \langle \adjmat
x, x\rangle . \label{lambda_minmax_eq} \tag{$*$} \]
