\documentclass[11pt]{article}

\usepackage{amsmath}
\usepackage{amssymb}

\usepackage{xcolor}
\usepackage{tikz}
\usepackage{tikz-cd}

%\usepackage{systeme}

%\usepackage[textheight=8.5in, margin=1.6in]{geometry}
\usepackage[total={6in,8in}]{geometry}

\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\tikzstyle{ball} = [circle,shading=ball, ball color=black,
    minimum size=1mm,inner sep=1.3pt]
\usetikzlibrary{arrows.meta}
\tikzset{>={Latex[length=2mm,width=1.5mm]}}
\tikzset{->-/.style={decoration={markings, mark=at position #1 with
  {\arrow{>}}},postaction={decorate}}}
\usetikzlibrary{decorations.pathmorphing}    
\usetikzlibrary{decorations.pathreplacing}
\usetikzlibrary{arrows.meta,calc}
\usetikzlibrary{bending}
\usetikzlibrary{decorations.markings,shapes.geometric}
\tikzset{->-/.style={decoration={markings, mark=at position #1 with
  {\arrow{>}}},postaction={decorate}}}
\tikzset{-|-/.style={decoration={markings, mark=at position #1 with
  {\arrow{stealth}}},postaction={decorate}}}
\tikzset{movearrow/.style 2 args ={
        decoration={markings,
	  mark= at position {#1} with {\arrow{#2}} ,
        },
        postaction={decorate}
    }
}

%\usepackage{graphicx}

\usepackage{needspace}  % <-- to prevent bad pagebreak over environment titles
% Use:  \Needspace{3\baselineskip} before opening an environment

\usepackage{enumitem}
%\setlist[enumerate]{leftmargin=*}

%\allowdisplaybreaks

%\usepackage[colorlinks=true,citecolor=black,linkcolor=black,urlcolor=blue]{hyperref}

\newcommand{\N}{\mathbb{N}}
\newcommand{\Z}{\mathbb{Z}}
\newcommand{\Q}{\mathbb{Q}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\C}{\mathbb{C}}
\newcommand{\W}{\mathbb{W}}
\newcommand{\sn}{\mathfrak{S}}
\newcommand{\ve}{\varepsilon}
\newcommand{\ips}[2]{\langle{#1}, {#2}\rangle}
\newcommand{\incid}{\mathcal{I}(P)}
\newcommand{\tL}{\widetilde{L}}
\DeclareMathOperator{\tr}{tr}
\DeclareMathOperator{\Span}{\mathrm{Span}}
\DeclareMathOperator{\rk}{\mathrm{rank}}
\DeclareMathOperator{\wt}{\mathrm{wt}}
\DeclareMathOperator{\trace}{\mathrm{tr}}
\DeclareMathOperator{\im}{\mathrm{im}}
\DeclareMathOperator{\Sym}{\mathrm{Sym}}
\DeclareMathOperator{\Hom}{\mathrm{Hom}}
\DeclareMathOperator{\diag}{\mathrm{diag}}
\DeclareMathOperator{\glb}{\mathrm{glb}}
\DeclareMathOperator{\lub}{\mathrm{lub}}
\DeclareMathOperator{\Pic}{\mathrm{Pic}}
\DeclareMathOperator{\Jac}{\mathrm{Jac}}
\DeclareMathOperator{\cok}{\mathrm{cok}}
\DeclareMathOperator{\sgn}{\mathrm{sgn}}
\DeclareMathOperator{\outdeg}{\mathrm{outdeg}}

\parskip = 0.05in
\parindent = 0.0in

%\pagestyle{empty}

\begin{document}
\centerline{Math 372 lecture for Wednesday, Week 11}
\bigskip

\centerline{\bf Matrix-tree theorem}
\bigskip

Let $G=(V,E)$ be a directed graph.  For this means that $V$ is a finite set of
vertices and $E$ is a finite multiset of directed edges.  A directed edge is an
ordered pair~$(u,v)$ with~$u,v\in V$. It is not necessary to
assume~$G$ is connected in any sense.  A {\em subgraph} of $G$ is a directed
graph whose vertices and directed edges form sub(multi)sets of $V$ and $E$,
respectively.  

{\bf The Laplacian for a directed graph.} For~$v\in V$, let~$\outdeg_G(v)$ be the number of edges
in~$G$ of the form~$(v,w)$ for some~$w\in V$. Fix an ordering of the
vertices~$v_1,\cdots,v_n$, and define
\[
  D = \diag(\outdeg_G(v_i))_{i=1,\ldots,n}.
\]
Define the directed~$n\times n$ adjacency matrix~$A$ by letting~$A_{ij}$ be the
number of directed edges starting at~$v_i$, i.e., of the form~$(v_i,w)$ for
some~$w\in V$.  Then the {\em Laplacian matrix} for~$G$ is
\[
  L := D - A^t,
\]
where~$A^t$ is the transpose of~$A$.  (In the literature, what we are
calling~$L$ would often be called the transpose of the Laplacian.) The columns
of~$L$ define firing rules in a chip-firing game on~$G$.
\medskip

{\bf Definition.}
  A {\em (directed) spanning tree of $G$ rooted at $s\in V$} is a subgraph $T$
  such that for all $v\in V$, there exists a unique directed path in $T$ from $v$ to
  $s$.  The vertex $s$ is the {\em root} or {\em sink} of the tree.
\medskip

If $T$ is a directed spanning tree of $G$ rooted at $s$, then one may show that
(i) $T$ contains {\em all} of the vertices of $G$ (hence, the word
``spanning''); (ii)~$T$ contains no directed cycles; and (iii) for all vertices
$v$ of $G$, the outdegree of $v$ in $T$ is $0$ if $v=s$, and is $1$, otherwise.
In particular, $T$ contains no multiple edges.
\medskip

{\bf Example.}  The graph pictured below has three directed edges and one
undirected edge:
  \begin{center}
    \begin{tikzpicture}[scale=0.7]
      \node[ball,label={below:{$s$}}] (1) at (2,0) {};
      \node[ball,label={above:{$v_1$}}] (2) at (1,1.73) {};
      \node[ball,label={below:{$v_2$}}] (3) at (0,0) {};
      \draw[movearrow={0.60}{Latex[scale=1.1]}] (2) to [bend left=20] (3);
      \draw[movearrow={0.60}{Latex[scale=1.1]}] (2) to [bend right=20] (3);
      \draw[movearrow={0.60}{Latex[scale=1.1]}] (3) to (1);
      \draw (1) to (2);
      \node at (2.5,0) {.};
    \end{tikzpicture}
  \end{center}
  The determinant of its reduced Laplacian with respect to $s$ is
  \[
\det
\left(
\begin{array}{rr}
  3& 0\\
  -2&1
\end{array}
\right)=3,
  \]
  which is the number of spanning trees rooted at $s$, as shown below:
  \begin{center}
    \begin{tikzpicture}[scale=0.7]
      \node[ball,label={below:{$s$}}] (1) at (2,0) {};
      \node[ball,label={above:{$v_1$}}] (2) at (1,1.73) {};
      \node[ball,label={below:{$v_2$}}] (3) at (0,0) {};
      \draw[movearrow={0.60}{Latex[scale=1.1]}] (2) to (1);
      \draw[movearrow={0.60}{Latex[scale=1.1]}] (3) to (1);
      \begin{scope}[xshift=1.6in]
	\node[ball,label={below:{$s$}}] (1) at (2,0) {};
	\node[ball,label={above:{$v_1$}}] (2) at (1,1.73) {};
	\node[ball,label={below:{$v_2$}}] (3) at (0,0) {};
	\draw[movearrow={0.60}{Latex[scale=1.1]}] (2) to [bend left=20] (3);
	\draw[movearrow={0.60}{Latex[scale=1.1]}] (3) to (1);
      \end{scope}
      \begin{scope}[xshift=3.2in]
	\node[ball,label={below:{$s$}}] (1) at (2,0) {};
	\node[ball,label={above:{$v_1$}}] (2) at (1,1.73) {};
	\node[ball,label={below:{$v_2$}}] (3) at (0,0) {};
	\draw[movearrow={0.60}{Latex[scale=1.1]}] (2) to [bend right=20] (3);
	\draw[movearrow={0.60}{Latex[scale=1.1]}] (3) to (1);
	\node at (2.5,0) {.};
      \end{scope}
    \end{tikzpicture}
  \end{center}
  Note that second two trees are different since the multiple edges of the
  form~$(v_1,v_2)$ are counted as distinct.
\medskip

Let $L$ be the Laplacian matrix of $G$ relative to an ordering of the vertices,
$v_1,\dots, v_n$. For each $k\in\{1,\dots,n\}$, let $L^{(k)}$ denote the
$(n-1)\times(n-1)$ matrix formed by removing the $k$-th row and column of $L$.
This is the {\em reduced Laplacian} for $G$ with respect to $v_k$.
\medskip

{\bf Matrix-tree Theorem.}
  The determinant of $L^{(k)}$ is the number of spanning trees of~$G$ rooted at
  $v_k$.
\smallskip

{\bf Proof.} Since a permutation of the vertices induces a corresponding
permutation of the rows and columns of $L$, it suffices to consider the case
$k=n$. For ease of notation, we write $\tL:=L^{(n)}$.  Letting $a_{ij}$ denote
the number of times $(v_i,v_j)$ appears as an edge of $G$, we have
\[
\tL=
\left(
\begin{array}{ccccc}
  \sum_{i\neq 1}a_{1i}&-a_{21}&-a_{31}&\dots&-a_{n-1,1}\\
  -a_{12}&\sum_{i\neq 2}a_{2i}&-a_{32}&\dots&-a_{n-1,2}\\
  \vdots&\vdots&\vdots&\ddots&\vdots\\
  -a_{1,n-1}&-a_{2,n-1}&-a_{3,n-1}&\dots&\sum_{i\neq n-1}a_{n-1,i}
\end{array}
\right)
\]
where $\sum_{i\neq k}a_{ki}$ denotes the sum over
$i\in\{1,\dots,n\}\setminus\{k\}$.  Each column encodes the rule for
reverse-firing the corresponding vertex.
\hfill$\Box$

Let $\mathfrak{S}_{n-1}$ be the permutation group on $\{1,\dots,n-1\}$.  Recall
that the {\em sign} of $\sigma\in\mathfrak{S}_{n-1}$ is
$\sgn(\sigma):=(-1)^t$ where $t$ is the number of factors in any
expression for $\sigma$ as a product of transpositions---it records whether an
even or odd number of swaps is required to create the permutation $\sigma$.
Let $\mathrm{Fix}(\sigma)$ be the set of {\em fixed points} of $\sigma$:
\[
  \mathrm{Fix}(\sigma):=\{i\in\{1,\dots,n-1\}: \sigma(i)=i\}.
\]
Then
\begin{equation}\label{eqn: matrix-tree}
  \det\tL=\sum_{\sigma\in\mathfrak{S}_{n-1}}\sgn(\sigma)\tL_{\sigma(1),1}\cdots
  \tL_{\sigma(n-1),n-1},
  \end{equation}
where
\[
  \tL_{\sigma(k),k}=
  \begin{cases}
    \sum_{i\neq k}a_{k,i}&\text{if $k\in\mathrm{Fix(\sigma)}$}\\
    -a_{k,\sigma(k)}&\text{otherwise.}
  \end{cases}
\]

  The idea now is to expand~(\ref{eqn: matrix-tree}) into signed monomials in
  the $a_{ij}$ and to think of each monomial as a directed graph by identifying
  $a_{ij}$ with the directed edge $(v_i,v_j)$ labeled with the number of times
  this edge appears in $G$, i.e., with $a_{ij}$, itself:
  \begin{center}
    \begin{tikzpicture}
      \node[ball,label={below:{$v_i$}}] (i) at (0,0) {};
      \node[ball,label={below:{$v_j$}}] (j) at (2,0) {};
      \draw[style={-{Latex[scale=1.1]}}] (i) to [bend left=15] node[above] {$a_{ij}$} (j);
      \node at (2.5,0) {.};
    \end{tikzpicture}
  \end{center}
  We then show that after cancellation due to the signs of the permutations, the
  remaining monomials correspond exactly to the distinct spanning trees rooted
  at~$v_n$.  Each monomial itself---a product of various $a_{ij}$---is an
  integer which counts the number of times its corresponding spanning tree
  occurs as a spanning tree of $G$.  (Recall that since $G$ may have repeated
  edges, a spanning tree may occur more than once.) 

  We pause now for an extended example.  For those readers wishing to skip
  ahead, the end of the example is marked with a line.
  \medskip

  {\bf Example.}\label{example: monomial graphs}
    Take $n=10$ and $\sigma=(2,7)(3,5,9)\in\mathfrak{S}_9$.  The set of fixed points is
    $\mathrm{Fix}(\sigma)=\{1,4,6,8\}$ and
    $\sgn(\sigma)=\sgn ((2,7))\,\sgn((3,5,9))=(-1)\cdot 1=-1$.
    The term in the expansion of $\det\tL$ corresponding to~$\sigma$ is
    \begin{align*}
      &\sgn(\sigma)\tL_{\sigma(1),1}\tL_{\sigma(2),2} \cdots\tL_{\sigma(9),9}\\
      &\ \  =(-1)(a_{1,2}+\dots+a_{1,10})(-a_{2,7})(-a_{3,5})(a_{4,1}+\dots+a_{4,10})'\\
      &\qquad\cdot(-a_{5,10})(a_{6,1}+\dots+a_{6,10})'(-a_{7,2})(a_{8,1}+\dots+a_{8,10})'(-a_{9,3}),
    \end{align*}
    where the prime symbol on a factor indicates the term of the form~$a_{i,i}$ should be
    omitted from the enclosed sum.  Continuing,
    \begin{align*}
      &=(-1)[\
	\overbrace{(a_{1,2}+\dots)}^{\sigma(1)=1}\overbrace{(a_{4,1}+\dots)'}^{\sigma(4)=4}
      \overbrace{(a_{6,1}+\dots)'}^{\sigma(6)=6}\overbrace{(a_{8,1}+\dots)'}^{\sigma(8)=8}\,]
      \\[5pt]
      &\qquad\cdot [\, \underbrace{(-a_{2,7})(-a_{7,2})}_{(2,7)} 
      \underbrace{(-a_{3,5})(-a_{5,9})(-a_{9,3})}_{(3,5,9)}\,].
    \end{align*}
  {\bf Question:} Which monomials, identified with directed graphs, appear in
  the expansion of the above?
  \smallskip

  \noindent{\bf Answer:} For each fixed point $i$ of $\sigma$, we get a choice of any
  edge of the form \tikz[baseline=-0.4pt]{
      \node[ball,label={below:{$v_i$}}] (i) at (0,0) {};
      \node[ball,label={below:{$v_j$}}] (j) at (1,0) {};
      \draw[style={-{Latex[scale=1.1]}}] (i) to node[above] {$a_{ij}$} (j);
      }
      where $j\in\{1,\dots,10\}$ and $j\neq i$.  For each non-trivial cycle of $\sigma$, there is only
      one choice:
  \begin{center}
    \begin{tikzpicture}[scale=0.7]
      \node (s1) at (-2,0) {(2,7)} {};
      \node (arleft) at (-1.3,0) {};
      \node (arright) at (0.1,0) {};
      \node[ball,label={above:{$v_2$}}] (2) at (1.7,1) {};
      \node[ball,label={below:{$v_7$}}] (7) at (1.7,-1) {};
      \draw[movearrow={0.60}{Latex[scale=1.1]}] (2) to [bend right] node[left] {$a_{2,7}$} (7);
      \draw[movearrow={0.60}{Latex[scale=1.1]}] (7) to [bend right] node[right] {$a_{7,2}$} (2);
      \draw[<->,densely dashed] (arleft)--(arright);
    \begin{scope}[xshift=3in]
      \node (s1) at (-2,0) {(3,5,9)} {};
      \node (arleft) at (-1.1,0) {};
      \node (arright) at (0.3,0) {};
      \node[ball,label={below left:{$v_3$}}] (3) at (1.3,-1) {};
      \node[ball,label={above:{$v_5$}}] (5) at (2.3,1) {};
      \node[ball,label={below right:{$v_9$}}] (9) at (3.3,-1) {};
      \draw[movearrow={0.60}{Latex[scale=1.1]}] (3) to [bend left=15] node[left] {$a_{3,5}$} (5);
      \draw[movearrow={0.60}{Latex[scale=1.1]}] (5) to [bend left=15] node[right] {$a_{5,9}$} (9);
      \draw[movearrow={0.60}{Latex[scale=1.1]}] (9) to [bend left=15] node[below] {$a_{9,3}$} (3);
      \draw[<->,densely dashed] (arleft)--(arright);
    \end{scope}
    \end{tikzpicture}
  \end{center}
  Figure~\ref{fig: graphs and monomials} considers three monomials coming from
  the expansion of the term in $\det\tL$ corresponding to $\sigma$.  Each
  monomial $m$ corresponds to a directed graph $G_m$.  Column $F$ shows the part
  of $G_m$ that comes from choices for the fixed points of $\sigma$, and
  column $C$ shows the part that comes from the nontrivial cycles.  Note that, as
  in example~(c), these two parts may share vertices.  There may be an edge
  connecting a fixed point vertex to a cycle vertex in $G_m$.  Example~(b) shows
  that it is not necessary for $v_{10}$  to occur in $G_m$.  In general,
  $v_{10}$ does not appear if and only
  if each vertex in $G_m$ has a path to a directed cycle (since the outdegree
  for each non-root vertex is $1$).
  \begin{figure}[ht] 
    \centering
    \begin{tikzpicture}[scale=0.35]
    \node at (1.7,4) {$F$};
    \node at (10.5,4) {$C$};
    \node at (20.5,4) {monomial};
    \node at (-3,0) {(a)};
    \node[ball,label={above:{$v_1$}}] (1) at (0,1) {};
    \node[ball,label={below:{$v_{10}$}}] (10) at (0,-1) {};
    \draw[movearrow={0.70}{Latex[scale=1.1]}] (1) to (10);
    \node[ball,label={below:{$v_4$}}] (4) at (2,-1) {};
    \node[ball,label={below:{$v_6$}}] (6) at (4,-1) {};
    \node[ball,label={above:{$v_8$}}] (8) at (3,1) {};
    \draw[movearrow={0.60}{Latex[scale=1.1]}] (4) to [bend left=15] (8);
    \draw[movearrow={0.60}{Latex[scale=1.1]}] (8) to [bend left=15] (6);
    \draw[movearrow={0.60}{Latex[scale=1.1]}] (6) to [bend left=15] (4);
    \begin{scope}[xshift=3.5in]
    \node[ball,label={above:{$v_2$}}] (2) at (0,1) {};
    \node[ball,label={below:{$v_7$}}] (7) at (0,-1) {};
    \draw[movearrow={0.75}{Latex[scale=1.1]}] (2) to [bend right] (7);
    \draw[movearrow={0.75}{Latex[scale=1.1]}] (7) to [bend right] (2);
    \node[ball,label={below:{$v_3$}}] (3) at (2,-1) {};
    \node[ball,label={above:{$v_5$}}] (5) at (3,1) {};
    \node[ball,label={below:{$v_9$}}] (9) at (4,-1) {};
    \draw[movearrow={0.60}{Latex[scale=1.1]}] (3) to [bend left=15] (5);
    \draw[movearrow={0.60}{Latex[scale=1.1]}] (5) to [bend left=15] (9);
    \draw[movearrow={0.60}{Latex[scale=1.1]}] (9) to [bend left=15] (3);
    \end{scope}
    \node at (21,0) {$a_{1,10}\,a_{2,7}\,a_{3,5}\cdots a_{9,3}$};
    \begin{scope}[yshift=-2.5in]
    \node at (-3,0) {(b)};
    \node[ball,label={above:{$v_4$}}] (1) at (0,0.6) {};
    \node[ball,label={below:{$v_1$}}] (4) at (2,-1) {};
    \node[ball,label={below:{$v_6$}}] (6) at (4,-1) {};
    \node[ball,label={above:{$v_8$}}] (8) at (3,1) {};
    \draw[movearrow={0.70}{Latex[scale=1.1]}] (1) to [bend right] (4);
    \draw[movearrow={0.60}{Latex[scale=1.1]}] (4) to [bend left=15] (8);
    \draw[movearrow={0.60}{Latex[scale=1.1]}] (8) to [bend left=15] (6);
    \draw[movearrow={0.60}{Latex[scale=1.1]}] (6) to [bend left=15] (4);
    \begin{scope}[xshift=3.5in]
    \node[ball,label={above:{$v_2$}}] (2) at (0,1) {};
    \node[ball,label={below:{$v_7$}}] (7) at (0,-1) {};
    \draw[movearrow={0.75}{Latex[scale=1.1]}] (2) to [bend right] (7);
    \draw[movearrow={0.75}{Latex[scale=1.1]}] (7) to [bend right] (2);
    \node[ball,label={below:{$v_3$}}] (3) at (2,-1) {};
    \node[ball,label={above:{$v_5$}}] (5) at (3,1) {};
    \node[ball,label={below:{$v_9$}}] (9) at (4,-1) {};
    \draw[movearrow={0.60}{Latex[scale=1.1]}] (3) to [bend left=15] (5);
    \draw[movearrow={0.60}{Latex[scale=1.1]}] (5) to [bend left=15] (9);
    \draw[movearrow={0.60}{Latex[scale=1.1]}] (9) to [bend left=15] (3);
    \end{scope}
    \node at (21,0) {$a_{1,8}\,a_{2,7}\,a_{3,5}\cdots a_{9,3}$};
  \end{scope}
    \begin{scope}[yshift=-5in]
    \node at (-3,0) {(c)};
    \node[ball,label={above:{$v_4\ $}}] (4) at (1.1,1) {};
    \node[ball,label={above left:{$v_6$}}] (6) at (0,-0.2) {};
    \node[ball,label={below:{$v_{10}$}}] (10) at (1.4,-1) {};
    \node[ball,label={above:{$v_1$}}] (1) at (2.7,1) {};
    \node[ball,label={below:{$v_5$}}] (5) at (3.5,-1) {};
    \node[ball,label={above:{$\ v_8$}}] (8) at (4,1) {};
    \draw[movearrow={0.75}{Latex[scale=1.1]}] (4) to (6);
    \draw[movearrow={0.70}{Latex[scale=1.1]}] (6) to (10);
    \draw[movearrow={0.70}{Latex[scale=1.1]}] (1) to [bend right=15] (5);
    \draw[movearrow={0.70}{Latex[scale=1.1]}] (8) to [bend left=15] (5);
    \begin{scope}[xshift=3.5in]
    \node[ball,label={above:{$v_2$}}] (2) at (0,1) {};
    \node[ball,label={below:{$v_7$}}] (7) at (0,-1) {};
    \draw[movearrow={0.75}{Latex[scale=1.1]}] (2) to [bend right] (7);
    \draw[movearrow={0.75}{Latex[scale=1.1]}] (7) to [bend right] (2);
    \node[ball,label={below:{$v_3$}}] (3) at (2,-1) {};
    \node[ball,label={above:{$v_5$}}] (5) at (3,1) {};
    \node[ball,label={below:{$v_9$}}] (9) at (4,-1) {};
    \draw[movearrow={0.60}{Latex[scale=1.1]}] (3) to [bend left=15] (5);
    \draw[movearrow={0.60}{Latex[scale=1.1]}] (5) to [bend left=15] (9);
    \draw[movearrow={0.60}{Latex[scale=1.1]}] (9) to [bend left=15] (3);
    \end{scope}
    \node at (21,0) {$a_{1,5}\,a_{2,7}\,a_{3,5}\cdots a_{9,3}$};
  \end{scope}
  \end{tikzpicture}
  \caption{Monomials and corresponding graphs for Example~\ref{example:
  monomial graphs}.}\label{fig: graphs and monomials}
  \end{figure}

  Finally, it is important to determine the sign of each monomial corresponding
  to $\sigma$ in the expansion of $\det\tL$.  The sign is determined by
  $\sgn{\sigma}$ and by the number of factors of the form $-a_{ij}$ that go into
  the calculation of the monomial.  With these two considerations in mind, it is
  straightforward to see that the resulting sign is $(-1)^{\#\text{ non-trivial cycles of
  $\sigma$}}$.  For instance, consider the monomial in example~(a) in Figure~\ref{fig: graphs
  and monomials}.  It appears in the expansion of $\det\tL$ in the term
  \[
    \sgn(\text{\footnotesize$(2,7)(3,5,9)$})\underbrace{a_{1,10}a_{4,8}a_{6,4}a_{8,6}}_{\text{\footnotesize$\mathrm{Fix}(\sigma)=\{1,4,6,8\}$}}
    \underbrace{(-a_{2,7})(-a_{7,2})}_{\text{\footnotesize$(2,7)$}}
    \underbrace{(-a_{3,5})(-a_{5,9})(-a_{9,3})}_{\text{\footnotesize$(3,5,9)$}}.
  \]
  Each cycle of $\sigma$ ultimately contributes a factor of $-1$:
  \begin{align*}
    \sgn((2,7))(-a_{2,7})(-a_{7,2})&=-1\cdot a_{2,7}a_{7,2}\\
    \sgn((3,5,9))(-a_{3,5})(-a_{5,9})(-a_{9,3})&=-1\cdot a_{3,5}a_{5,9}a_{9,3}.
  \end{align*}
\noindent\rule{3in}{0.4mm}
\medskip

  We now return to the proof.  The monomials in the
  expansion of~(\ref{eqn: matrix-tree}) correspond exactly with signed,
  weighted, ordered pairs $(F,C)$ of graphs~$F$ and~$C$ formed as follows:
  \begin{enumerate}[leftmargin=*]
    \item Choose a subset $X\subseteq\{1,\dots,n-1\}$ (representing the fixed
      points of some $\sigma$).
    \item\label{item: fixed points} Make any loopless, directed (not necessarily connected) graph $F$ with
      vertices $\{1,\dots,n\}$ such that
      \[
      \outdeg_F(i)=
      \begin{cases}
	1&\text{if $i\in X$}\\
	0&\text{if $i\notin X$.}
      \end{cases}
      \]
    \item  Let $C$ be any vertex-disjoint
      union of directed cycles of length at least~$2$ (i.e., no loops)
      such that $C$ contains all of the vertices $\{1,\dots,n-1\}\setminus X$.
  \end{enumerate}
  Each of these ordered pairs of graphs $(F,C)$ is associated with an element of
  $\mathfrak{S}_{n-1}$, with the vertices of outdegree one in $F$ determining
  the fixed points and with $C$ determining the cycles.  In general, this is a
  many-to-one relationship, given the choices in step~(\ref{item: fixed
  points}).  The {\em weight} of $(F,C)$, denoted $\wt(F,C)$ is the product of its
  labels---those $a_{ij}$ such that $(v_i,v_j)$ occurs in either $F$ or
  $C$---multiplied by $(-1)^{\gamma}$ where~$\gamma$ is the number of cycles in
  $C$.  For instance, for each of the three examples in Figure~\ref{fig: graphs
  and monomials}, the number of cycles in $C$ is $2$, so the weight is just the
  listed monomial, without a sign change.  With this notion of weight, it then
  follows in general that
  \[
  \det\tL=\sum_{(F,C)}\wt(F,C).
  \]
  
  Let $\Omega$ denote the set of ordered pairs $(F,C)$, constructed as above,
  but such that either $F$ or $C$ contains a directed cycle.  We show that the
  monomials corresponding to elements of $\Omega$ cancel in pairs in the
  expansion of~(\ref{eqn: matrix-tree}) by constructing a {\em sign reversing
  transposition} on~$\Omega$.  Given $(F,C)\in\Omega$, pick the cycle $\gamma$
  of the disjoint union $F\sqcup C$ with the vertex of smallest index.  Then if
  $\gamma$ is in $F$, move it to $C$, and vice versa.  Formally, if the cycle
  is in $F$, define $F'=F\setminus \{\gamma\}$ and $C'=C\cup\{\gamma\}$, and if
  it is in $C$, define $F'=F\cup \{\gamma\}$ and $C'=C\setminus\{\gamma\}$.  This
  defines a transposition  $(F,C)\mapsto(F',C')$ on $\Omega$ such that
  $\wt(F,C)=-\wt(F',C')$ since the number of cycles in $C$ differs from the
  number of cycles in $C'$ by one.  See Figure~\ref{fig: sign reversing} for an example.
  \begin{figure}[ht] 
    \centering
    \begin{tikzpicture}[scale=0.35]
      \node at (0,3.6) {$(F,C)$};
      \node at (2.7,3.6) {$=$};
      \node at (0,-2.5) {$(F',C')$};
      \node at (3,-2.5) {$=$};
      \node (artop) at (0,2.5) {};
      \node (arbottom) at (0,-1.2) {};
      \draw[<->,densely dashed] (artop)--(arbottom);
      \begin{scope}[xshift=2in,yshift=1.5in]
      \node (top) at (-0.7,2) {};
      \node (bottom) at (-0.7,-2.3) {};
      \draw (top) to [bend right=20] (bottom);
      \node[ball,label={above:{$v_4$}}] (1) at (0,0.6) {};
      \node[ball,label={below:{$v_1$}}] (4) at (2,-1) {};
      \node[ball,label={below:{$v_6$}}] (6) at (4,-1) {};
      \node[ball,label={above:{$v_8$}}] (8) at (3,1) {};
      \draw[movearrow={0.70}{Latex[scale=1.1]}] (1) to [bend right] (4);
      \draw[movearrow={0.60}{Latex[scale=1.1]}] (4) to [bend left=15] (8);
      \draw[movearrow={0.60}{Latex[scale=1.1]}] (8) to [bend left=15] (6);
      \draw[movearrow={0.60}{Latex[scale=1.1]}] (6) to [bend left=15] (4);
      \node at (5.5,-1.2) {,};
      \end{scope}
      \begin{scope}[xshift=5in,yshift=1.5in]
      \node[ball,label={above:{$v_2$}}] (2) at (0,1) {};
      \node[ball,label={below:{$v_7$}}] (7) at (0,-1) {};
      \draw[movearrow={0.75}{Latex[scale=1.1]}] (2) to [bend right] (7);
      \draw[movearrow={0.75}{Latex[scale=1.1]}] (7) to [bend right] (2);
      \node[ball,label={below:{$v_3$}}] (3) at (2,-1) {};
      \node[ball,label={above:{$v_5$}}] (5) at (3,1) {};
      \node[ball,label={below:{$v_9$}}] (9) at (4,-1) {};
      \draw[movearrow={0.60}{Latex[scale=1.1]}] (3) to [bend left=15] (5);
      \draw[movearrow={0.60}{Latex[scale=1.1]}] (5) to [bend left=15] (9);
      \draw[movearrow={0.60}{Latex[scale=1.1]}] (9) to [bend left=15] (3);
      \node (top) at (5,2) {};
      \node (bottom) at (5,-2.3) {};
      \draw (top) to [bend left=20] (bottom);
      \end{scope}
      \begin{scope}[yshift=-2.4in]
	\begin{scope}[xshift=2in,yshift=1.5in]
	\node (top) at (-0.7,2) {};
	\node (bottom) at (-0.7,-2.3) {};
	\draw (top) to [bend right=20] (bottom);
	\node[ball,label={above:{$v_4$}}] (1) at (1.5,0.6) {};
	\node[ball,label={below:{$v_1$}}] (4) at (3.5,-1) {};
	\draw[movearrow={0.70}{Latex[scale=1.1]}] (1) to [bend right] (4);
	\node at (5.5,-1.2) {,};
	\end{scope}
	\begin{scope}[xshift=5in,yshift=1.5in]
	\node[ball,label={below:{$v_1$}}] (4) at (-1,-1) {};
	\node[ball,label={below:{$v_6$}}] (6) at (1,-1) {};
	\node[ball,label={above:{$v_8$}}] (8) at (0,1) {};
	\node[ball,label={above:{$v_2$}}] (2) at (3,1) {};
	\node[ball,label={below:{$v_7$}}] (7) at (3,-1) {};
	\draw[movearrow={0.75}{Latex[scale=1.1]}] (2) to [bend right] (7);
	\draw[movearrow={0.75}{Latex[scale=1.1]}] (7) to [bend right] (2);
	\node[ball,label={below:{$v_3$}}] (3) at (5,-1) {};
	\node[ball,label={above:{$v_5$}}] (5) at (6,1) {};
	\node[ball,label={below:{$v_9$}}] (9) at (7,-1) {};
	\draw[movearrow={0.60}{Latex[scale=1.1]}] (3) to [bend left=15] (5);
	\draw[movearrow={0.60}{Latex[scale=1.1]}] (5) to [bend left=15] (9);
	\draw[movearrow={0.60}{Latex[scale=1.1]}] (9) to [bend left=15] (3);
	\draw[movearrow={0.60}{Latex[scale=1.1]}] (4) to [bend left=15] (8);
	\draw[movearrow={0.60}{Latex[scale=1.1]}] (8) to [bend left=15] (6);
	\draw[movearrow={0.60}{Latex[scale=1.1]}] (6) to [bend left=15] (4);
	\node (top) at (8.5,2) {};
	\node (bottom) at (8.5,-2.3) {};
	\draw (top) to [bend left=20] (bottom);
	\end{scope}
      \end{scope}
    \end{tikzpicture}
    \caption{Sign reversing transposition.}\label{fig: sign reversing}
  \end{figure}
  It follows that in the sum $\sum\wt(F,C)$, terms paired by the transposition
  cancel, leaving only those terms $\wt(F,C)$ for which the transposition is
  undefined, i.e., those $(F,C)$ such that the graph $F\sqcup C$ contains no
  cycles.  In this case, the corresponding permutation is the identity
  permutation, $C=\emptyset$, and~$F$ is a spanning tree rooted at $v_n$.  The
  weight, $\wt(F,C)$, counts the number of times this spanning tree occurs as a
  spanning tree of~$G$ due to $G$ having multiple edges.
\medskip

{\bf Consequences of the matrix-tree theorem}
\smallskip

We now obtain several corollaries of the matrix-tree theorem.
\medskip

{\bf Corollary.} 
Let $G$ be an undirected multigraph.  Then the order of~$\Jac(G)$ is
  the number of directed spanning trees of $G$ rooted at the sink.
\smallskip

{\bf Proof.} We have seen that~$\Jac(G)\simeq\Z^{n-1}/\im{\tL}$ where~$\tL$ is
the reduced Laplacian of~$G$ with respect to any vertex.  Let~$D$ be the Smith
normal form for~$\tL$, and write~$D = U\tL V$ for some integer invertible
matrices~$U$ and~$V$. Then we have seen that~$U$ defines an
isomorphism $\Z^{n-1}/\im{\tL}\simeq\Z^{n-1}/\im(D)$, and
$\Z^{n-1}/\im(D)\simeq\prod_{i=1}^{n-1}\Z/d_i\Z$ where the~$d_i$ are the
diagonal entries of~$D$.  Therefore, the number of elements
in the group~$\Z^{n-1}/\im(D)$ is~$\det(D)$. Since~$U$ and~$V$ are invertible
over the integers, we have~$\det(D)=\det(U\tL V)=\pm\tL$.  By the matrix-tree
theorem~$\tL$ is nonnegative since it counts the number of spanning trees
of~$G$, and we know~$\det(D)$ is nonnegative.  Putting this all together:
\[
  |\Jac(G)|=|\Z^{n-1}/\im(D)|=\det(D)=\det(\tL)= \text{ \# spanning trees
  of~$G$}.
\]
\hfill$\Box$

A {\em tree on $n$ labeled vertices} is a connected undirected graph
with~$n$ labeled vertices and no cycles.
\medskip

{\bf Corollary.} (Cayley's formula)
  The number of trees on~$n$ labeled vertices is~$n^{n-2}$.
\smallskip

{\bf Proof.}  Let~$\tL$ be the reduced Laplacian matrix of the complete
graph~$K_n$.  Then by the matrix-tree theorem, Cayley's number is~$\det(\tL)$.
In homework, we showed this determinant is~$n^{n-2}$.
\hfill$\Box$

Let $L^{(ij)}$ denote the matrix obtained from the Laplacian $L$ of $G$ by
removing the $i$-th row and $j$-th column.  
\medskip

{\bf Corollary.} 
  The $ij$-th cofactor, $(-1)^{i+j}\det L^{(ij)}$, of $L$ is the number of
  directed spanning trees rooted at the $j$-th vertex.
\smallskip

{\bf Proof.} We have $(-1)^{i+j}\det L^{(ij)}=\det L^{(jj)}$ since the sum of
  the rows of $L$ is the zero vector (exercise for the reader). The
  result then follows from the matrix-tree theorem.
\medskip

{\bf Corollary.} Let $G$ be a directed graph with $n$ vertices. Suppose the
Laplacian matrix of $G$ has eigenvalues $\mu_1,\dots,\mu_n$ with $\mu_n=0$.  For
each vertex $v$, let $\kappa_v$ be the number of directed spanning trees of~$G$
rooted at $v$.  Then,
  \[
    \mu_1\cdots\mu_{n-1}=\sum_{v}\kappa_v.
   \]
 In other words, the product of these eigenvalues is the total number of
 rooted trees.
 \smallskip

 {\bf Proof.} 
We may assume the vertex set is $1,\dots,n$, with the $i$-th
  column of $L$ corresponding to vertex $i$.  First note that since $L$ is
  singular, a zero eigenvalue $\mu_n$ always exists. Factoring the
  characteristic polynomial of $L$, we have
  \[
\det(L-I_nx) = (\mu_1-x)\cdots(\mu_n-x).
  \]
  We calculate the coefficient of $x$ in this expression in two ways.
  Since $\mu_n=0$, by expanding the right-hand side, we see the coefficient is
  $-\mu_1\dots\mu_{n-1}$.  Now consider the left-hand side.  For each $i$, let $r_i$ denote
  the $i$-th row of $L$, and let $e_i$ denote the $i$-th standard basis vector.
  Then
  \[
  \det(L-I_nx) = \det(r_1-e_1x,\dots,r_n-e_nx).
  \]
  By multilinearity of the determinant, letting $\tL_i$ denote the reduced
  Laplacian with respect to vertex $i$, the coefficient of $x$ is
  \[
    \sum_{i=1}^n\det(r_1,\dots,r_{i-1},-e_i,r_{i+1},\dots,r_n)=-\sum_{i=1}^n\det(\tL_i)
    =-\sum_{i=1}^n\kappa_i.
  \]
 \hfill$\Box$
\medskip

{\bf Remark.} If $G$ is undirected, or more generally, if $G$ is Eulerian (which
  means that for each vertex~$v$, the number of edges directed into~$v$ is equal
to the number of edges directed out of~$v$)
  then the number of spanning trees rooted at a vertex is independent
  of the particular vertex.  Calling this number $\kappa$, the previous
  Corollary says in this case that
\[
  \kappa=\frac{\mu_1\dots\mu_{n-1}}{n}.
\]
\end{document}
