%\section{Spectral characterizations}\label{sec:spectralchar}

It is known that distance-regularity of a graph is in general not determined by
the spectrum of the graph; see below and the overview by Van Dam, Haemers,
Koolen, and Spence \cite{DHKS06}. See also the survey by Fiol \cite{Fi02} on
algebraic characterizations of distance-regular graphs, and the surveys by Van
Dam and Haemers \cite{DH03, DH09} on spectral characterizations of graphs.

\subsection{Distance-regularity from the
spectrum}\label{sec:drgfromspectrum}

The following proposition surveys the cases for which it is known that
distance-regularity follows from the spectrum.

\begin{prop}\label{drs1}
If $\G$ is a distance-regular graph with diameter $D$, valency $k$, girth
$g$, and distinct eigenvalues $k=\theta_0,\theta_1, \dots, \theta_D$,
satisfying one of the following properties, then every graph cospectral with
$\G$ is also distance-regular, with the same intersection array as
$\G$:
\begin{enumerate}[{\em (i)}]
\item $g \geq 2D-1$ {\em \cite{BH93}},
\item $g \geq 2D-2$ and $\G$ is bipartite {\em \cite{DH02}},
\item $g \geq 2D-2$ and $c_{D-1}c_D<-(c_{D-1}+1)(\theta_1+\cdots+\theta_D)$
    {\em \cite{DH02}},
\item $\G$ is a generalized odd graph, that is, $a_1=\cdots=a_{D-1}=0,\
    a_D\neq 0$ {\em \cite{DHodd, HL99}},
\item $c_1=\cdots=c_{D-1}=1$ {\em \cite{DH02}},
\item $\G$ is the dodecahedron, or the icosahedron {\em
    \cite{HS95}},
\item $\G$ is the coset graph of the extended ternary Golay code {\em
    \cite{DH02}},
\item $\G$ is the Ivanov-Ivanov-Faradjev graph {\em
    \cite{DHKS06}},
\item $\G$ is the Hamming graph $H(3,e)$, with $e \geq 36$ {\em
    \cite{BDK08}}.
\end{enumerate}
\end{prop}

\noindent In fact, more general results hold, because it is actually not in all cases (explicitly) required that the graph is cospectral to a distance-regular graph. Instead, for the graph to be distance-regular, it suffices that a similar spectral condition holds, where the diameter $D$ is replaced by the number of distinct eigenvalues minus one, and the intersection numbers by the so-called {\em preintersection numbers}; for details, we refer to Abiad, Van Dam, and Fiol \cite{AbiadQuasi14}.

Note that the polygons, strongly regular graphs, and bipartite
distance-regular graphs with diameter three are special cases of
(i) and (ii). We also refer to the survey paper by Van Dam and
Haemers \cite{DH03}, where a list of distance-regular graphs that
are known to be determined by the spectrum is included (except that
the antipodal 7-cover of $K_9$ is not mentioned). Van Dam, Haemers,
Koolen, and Spence \cite{DHKS06} give a list of graphs cospectral
with distance-regular graphs on at most 70 vertices (where Hadamard
graphs on $64$ vertices are missing). Note that Van Dam and Haemers
\cite{DH03} conjectured that almost all graphs are determined by
the spectrum. It follows from the prolific constructions of
distance-regular graphs by Fon-Der-Flaass
\cite{FonDerFlaassprolific} (see also Section
\ref{sec:Preparata}) that almost all distance-regular graphs are {\em not}
determined by the spectrum.

For (ix), we refer to Bang, Van Dam, and Koolen \cite{BDK08}, who showed that the Hamming graph $H(3,e)$ with diameter
three is uniquely determined by its spectrum for $e\geq 36$. Moreover, it is shown that for given $D\geq 2$, every
graph cospectral with the Hamming graph $H(D,e)$ is locally the disjoint union of $D$ copies of the complete graph of
size $e-1$, that is, it is geometric, for $e$ large enough. The latter is obtained by bounding the number of common
neighbours of two vertices in terms of the spectrum, and applying Proposition \ref{Metschresult-2.2}. The result on the
Hamming graphs with diameter three then follows from a result by Bang and Koolen \cite{BK08} who showed that if a graph
cospectral with $H(3,e)$ has the same local structure as $H(3,e)$, i.e., if it is geometric, then it is either the
Hamming graph $H(3,e)$ or the dual graph of $H(3,3)$. Furthermore, it is known that for $D\geq e\geq 3$, $(D\geq 4
\mbox{ and }e=2)$, or $(D \geq 2 \mbox{ and }e=4)$, the Hamming graph $H(D,e)$ is not uniquely determined by its
spectrum, whereas for $(2\leq D\leq 3 \mbox{ and }e=2)$ or $(e \geq D=2 \mbox{ and }e\neq 4)$, the Hamming graph
$H(D,e)$ is uniquely determined by its spectrum (cf.~\cite{bcn, DHKS06, HS95,hoffman63}).

Van Dam, Haemers, Koolen, and Spence \cite{DHKS06} showed that the
Ivanov-Ivanov-Faradjev graph is determined by its spectrum, whereas the Johnson
graphs, the Doubled Odd graphs, the Grassmann graphs, the Doubled Grassmann
graphs, the antipodal covers of complete bipartite graphs, and many of the
Taylor graphs are shown to have cospectral mates that are not distance-regular.
These mates are usually obtained by Godsil-McKay switching or by constructing
partial linear spaces that resemble the structure of the distance-regular
graphs in question. Van Dam and Haemers \cite{DH02} also used switching to
construct cospectral mates that are not distance-regular for the Wells graph,
the bipartite double of the Hoffman-Singleton graph, the triple cover of
$GQ(2,2)$, and the Foster graph.



\subsection{The \texorpdfstring{$p$-rank}{p-rank}}\label{sec:prank}

The $p$-ranks of $\G$, that is, the ranks over $GF(p)$ of matrices of the form
$A+\alpha I+\beta J$ with $\alpha,\beta$ integral (and $A$ the adjacency
matrix), can sometimes be used to distinguish cospectral graphs. Peeters
\cite{Peetersprank} studied these $p$-ranks of distance-regular graphs. He
showed among other results that for odd $e$, the Hamming graphs $H(3,e)$ are
determined by the spectrum and the $2$-rank of $A+I$. On the other hand, he
showed that the $p$-ranks of the Doob graphs and the Hamming graphs (with the
same intersection array) are the same.


\subsection{Spectral excess theorem}\label{sec:spectralexcess}

The spectral excess theorem by Fiol and Garriga \cite{FG97} states that a
connected regular graph with $d+1$ distinct eigenvalues is distance-regular
(with diameter $d$) if and only if for every vertex, the number of vertices at
distance $d$ from that vertex (the excess) equals a given expression in terms
of the spectrum (the spectral excess). So a simple `quasi-spectral' property
suffices for a graph to be distance-regular. To specify the result, one should
know that from the spectrum of a regular graph, a system of orthogonal
polynomials $v_i, i=0,1,\dots,d$
--- the so-called {\em predistance polynomials} --- can be constructed. For
distance-regular graphs, this system is well-known, and satisfies $A_i=v_i(A)$,
for $i=0,1,\dots,d$, where $A_i$ is the distance-$i$ adjacency matrix; see
(\ref{distancepolynomials}).

\begin{theorem}{\em (Spectral excess theorem)}\label{spectral excess theorem}
Let $\G$ be a connected k-regular graph on
$n$ vertices with $d+1$ distinct eigenvalues and corresponding orthogonal
polynomials $v_i, i=0,1,\dots,d$, and let $k_d(x)$ be the number of vertices at
distance $d$ from $x$. Then $\G$ is distance-regular if and only if
$k_d(x)=v_d(k)$ for all $x$.
\end{theorem}

\noindent In fact, the theorem can be stated a bit stronger: instead of
requiring that $k_d(x)=v_d(k)$ for all $x$, it is sufficient to require that
the harmonic mean of $n-k_d(x)$ equals $n-v_d(k)$. Another remark is that the
spectral excess $v_d(k)$ can be computed from the spectrum
$\{k=\theta_0^{1},\theta_1^{m_1},\dots,\theta_d^{m_d} \}$ directly as
$$v_d(k)=\frac{n}{\pi_0^2}\left[\sum_{i=0}^d\frac{1}{m_i
\pi_i^2}\right]^{-1},$$ where $\pi_i=\prod_{j \neq
i}|\theta_i-\theta_j|$ for $i=0,1,\dots,d$.

The first result of this kind was obtained by Cvetkovi\'c \cite{C70} and by
Laskar \cite{L69}, who showed that for a Hamming or Doob graph with diameter
three, distance-regularity is determined by the spectrum and having the correct
number of vertices at distance two from each vertex. This result was
generalized to all distance-regular graphs with diameter three by Haemers
\cite{Ha96}, and subsequently by Van Dam and Haemers \cite{DH97}, who proved
the spectral excess theorem for graphs with four distinct eigenvalues (not
assuming that the graph has the spectrum of a distance-regular graph).

At the same time, Fiol, Garriga, and Yebra \cite{FHY96} showed that
a graph with $d+1$ distinct eigenvalues is distance-regular if each
vertex has at least one vertex at distance $d$ and its distance-$d$
adjacency matrix $A_d$ is a polynomial of degree $d$ in the
adjacency matrix $A$, which is the first important step towards the
spectral excess theorem, which was then proved by Fiol and Garriga
in \cite{FG97}. The improvement to considering the above mentioned
harmonic mean was later proved in \cite{Fi02} (see also
\cite{Damexcess}). Fiol also obtained more specific results for
antipodal distance-regular graphs \cite{F97} and for strongly
distance-regular graphs \cite{F00} (a distance-regular graph with
diameter $D$ is {\em strongly distance-regular} if its distance-$D$
graph is strongly regular; examples are the connected strongly
regular graphs, antipodal distance-regular graphs, and
distance-regular graphs with $D=3$ and $\theta_2=-1$). Elementary
proofs of the spectral excess theorem are given by Van Dam
\cite{Damexcess} and Fiol, Gago, and Garriga \cite{Fiolexcess}. The
original proof by Fiol et al.~\cite{FG97, FHY96} has a local
approach and, because of that, it is quite technical.\footnote{In
the language of the Terwilliger algebra, (part of) this local
approach can be interpreted as finding a condition on the thinness
of the primary $\TT$-module; see Footnote
\ref{similar to SET}.} We remark however that by this local
approach, Fiol et al.~manage to prove more related results. Van Dam
and Fiol \cite{DFLaplacian} generalized the spectral excess theorem
by dropping the regularity condition and using the Laplacian
eigenvalues. We refer the interested reader also to surveys by Fiol
\cite{Fi02,Fi05}.

A useful application of the spectral excess theorem is, for example, given by the construction by Van Dam and
Koolen \cite{DK05} of a new family of distance-regular graphs with the same intersection array as certain
Grassmann graphs, see Section \ref{twistedsection}. Distance-regularity of these graphs is proved by showing
that they have the same spectrum as the Grassmann graphs, and then checking the number of vertices at
extremal distance from each vertex. The spectral excess theorem was also used by Van Dam and Haemers
\cite{DHodd} to show that each regular graph with $d+1$ distinct eigenvalues and shortest odd cycle of length
$2d+1$ is a distance-regular generalized odd graph. Lee and Weng \cite{LeeWeng12} generalized this by
dropping the regularity condition, using a version of the spectral excess theorem for nonregular graphs. Van
Dam and Fiol \cite{damfiol12} obtained the same result by an alternative method that avoids the spectral
excess theorem; these results generalize Proposition \ref{drs1} (iv) above.

Kurihara \cite{Kur2011T} obtained a dual version of the spectral excess theorem, in the sense that it
characterizes when a spherical $2$-design generates a cometric association scheme. Kurihara and Nozaki
\cite{KN2011pre} and Nomura and Terwilliger \cite{NT2011LAA} independently derived a spectral
characterization of $P$-polynomial schemes (and hence distance-regular graphs) among symmetric association
schemes that is closely related to the spectral excess theorem.

\subsection{Almost distance-regular graphs}\label{sec:almostdrg}

Motivated by spectral and other algebraic characterizations of distance-regular graphs, Dalf\'{o}, Van Dam,
Fiol, Garriga, and Gorissen \cite{DalfoDamFiol} studied 
\emph{almost} distance-regular graphs.
%`almost distance-regular' graphs.
They used the
spectrum and the predistance polynomials of a graph to discuss concepts such as $m$-walk-regularity and
partial distance-regularity. It was shown by Rowlinson \cite{r97} that a graph is distance-regular if and
only if the number of walks of given length between vertices depends only on the distance between these
vertices. Godsil and McKay \cite{gmk} called a graph walk-regular if the number of closed walks of given
length is constant. The concept of $m$-walk-regularity, as introduced by Dalf\'{o}, Fiol, and Garriga
\cite{DaFiGa09}, generalizes both, and requires the invariance of the number of walks of each given length
between vertices at each given distance at most $m$. Algebraically, this is equivalent to $A_i \circ E_j =
\frac1v Q_{ij} A_i$ for all $i=0,1,\ldots,m$ and $j=0,1,\ldots,d$ (and some $Q_{ij}$), where the notation is
as usual (cf.~Section \ref{sec2:evmult}). An interesting problem raised in \cite{DalfoDamFiol} is to
determine the smallest $m=m(D)$ such that each $m$-walk-regular graph with diameter $D$ is distance-regular.
Informally, the question is till what distance $m$ one needs to check $m$-walk-regularity to assure
distance-regularity. We expect that $m(D)$ is approximately $D/2$.

Dalf\'{o}, Van Dam, and Fiol \cite{dalfoperturbation} showed that
$m$-walk-regular graphs can be characterized through the cospectrality of
certain perturbations of such graphs. As a consequence, some new
characterizations of distance-regularity in terms of certain perturbations are
obtained. C\'{a}mara, Van Dam, Koolen, and Park \cite{CDKP2013} observed a
structural gap between $1$-walk-regularity and $2$-walk-regularity. They showed
among other results that Godsil's bound on the valency in terms of a
multiplicity (in Theorem \ref{thm:godsilbound}), Terwilliger's bounds on the
local eigenvalues \cite[Thm.~4.4.3]{bcn}, and the fundamental bound \eqref{FB}
generalize to $2$-walk-regular graphs. Moreover, they show that there are
finitely many non-geometric $2$-walk-regular graphs with given smallest
eigenvalue and given diameter (in the same spirit as Theorem
\ref{thm:nongeometric}).

Another concept is that of $m$-partial distance-regularity (distance-regularity up to distance $m$). This
means that for $i \le m$, the distance-$i$ matrix can be expressed as a polynomial of degree $i$ in the
adjacency matrix, which is equivalent to saying that the intersection numbers $c_i,a_i,b_i$ are well defined
up to $c_m$. We note that there are $(D-1)$-partially distance-regular graphs with diameter $D$ that are not
distance-regular; for example the direct product of an edge and the folded cube. Lee and Weng
\cite{LeeWeng14} used $2$-partial distance-regularity to characterize the distance-regular graphs among the
bipartite graphs whose halved graphs are distance-regular (cf.~Proposition \ref{prop:halved}).

Related to these concepts are two other generalizations of distance-regular
graphs. Weichsel \cite{w82} called a graph distance-polynomial if each
distance-$i$ matrix can be expressed as a polynomial in the adjacency matrix. A
graph is called distance degree regular if each distance-$i$ graph is regular.
Such graphs were studied by Bloom, Quintas, and Kennedy \cite{bloom}, Hilano
and Nomura \cite {hilanomura}, and also by Weichsel \cite{w82} (as
super-regular graphs). A concept that is dual to partial distance-regularity
was introduced by Dalf\'{o}, Van Dam, Fiol, and Garriga \cite{dalfodual}.
