

%\section{Completely regular codes}\label{sec:crc}

In this section, we discuss completely regular codes in distance-regular graphs.
Many combinatorial configurations can be viewed as completely regular codes with certain additional properties and/or special parameters in their underlying distance-regular graphs; cf.~Section \ref{sec: crc in other drg}.

As we have seen, a Delsarte clique in a distance-regular graph $\G$ with diameter $D$ is a completely regular code in $\G$ with covering radius $D-1$, and all the geometric distance-regular graphs have plenty of Delsarte cliques.
Martin \cite[Thm.~2.3.3]{Martinthesis} showed that if two distinct vertices $x,y$ in a distance-regular graph $\G$ with diameter $D$ form a completely regular code then either $d(x,y)=1$ and $a_1=a_2=\dots=a_{D-1}=0$, i.e., $\G$ is bipartite or almost bipartite, or $d(x,y)=D$ and $\G$ is antipodal.
C\'{a}mara, Dalf\'{o}, Delorme, Fiol, and Suzuki \cite{CDDFS2013JCTA} showed that all the edges of a connected graph are completely regular codes with the same parameters if and only if the graph is a bipartite or almost bipartite distance-regular graph.
(The assumption on the parameters of the edges was later dropped by Suzuki \cite{Suzuki2014JAC}.)
See \cite{FG1999LAA,FG2001SIAM,CFFG2009EJC,CFFG2010EJC,CFFG2014DAM} and also Section \ref{sec:Terwilliger algebra w.r.t. code} for some algebraic characterizations of complete regularity.

For certain distance-regular graphs, we can show that they come from completely regular partitions in Hamming graphs.

\begin{theorem}\label{thmquotient}
Let $\G$ be a distance-regular graph with diameter $D \geq 3$, valency $k$, intersection numbers $c_i = i$
for $i=1, 2, 3$, and $a_2 = 2 a_1$. Then $a_1 +1$ divides $k$ and there exists a completely regular partition
of the Hamming graph $H(k/(a_1 +1), a_1+2)$ or a Doob graph with valency $k$, with covering radius $D$ and
parameters $\gamma_i = c_i$, $\beta_{i-1} = b_{i-1}$ for $i=1,2, \ldots, D$. The latter case only occurs when
$a_1 = 2$.
\end{theorem}

\noindent
This theorem was shown by Rif\`{a} and Huguet \cite{RiHu} when $a_1 =0$ following ideas of Brouwer \cite{Brouwer1983IEEE} (cf.~\cite[Prop.~4.3.6, Thm.~11.3.2]{bcn}), by Nomura \cite{Nomura90} when  $a_1 \neq 2$, and by Koolen \cite{KoolenDoob} when $a_1 =2$.

\subsection{Parameters}
It is known that the sequence $(c_i)_i$ in a distance-regular graph
$\G$ is non-decreasing, but this is not true in general for the
sequence $(\gamma_i)_i$ of a completely regular code in $\G$.
Koolen \cite{Ko95} gave an infinite family of completely regular
codes in the Doubled Odd graphs with the property that the sequence
$(\gamma_i)_i$ is not necessarily increasing, disproving a
conjecture of Martin \cite{Martinthesis}. Koolen also gave a
sufficient condition for $\G$ that the sequence $(\gamma_i)_i$ is
increasing for every completely regular code in $\G$. Martin
[private communication] showed that the sequence $(\gamma_i)_i$ is
strictly increasing for any completely regular code in a Hamming
graph.


\subsection{Leonard completely regular codes}

Let $\G$ be a distance-regular graph with diameter $D$, valency $k$, and eigenvalues $k=\theta_0,\theta_1,\dots,\theta_D$ (not necessarily in decreasing order).
Let $E_i$ be the primitive idempotent associated with $\theta_i$ for $i=0,1,\dots,D$.
Let $C$ be a completely regular code in $\G$ with covering radius $\rho$.
Let $\{C_0 = C,C_1, \dots, C_{\rho}\}$ be the distance partition with respect to $C$, and let $\mathbf{x}_i$ be the characteristic vector of $C_i$ for $i=0,1,\dots, \rho$.
Let $\mathrm{Spec}(C)=\{\theta_{i_0}=k,\theta_{i_1},\dots,\theta_{i_{\rho}}\}$ be (an ordering of) the spectrum of the quotient matrix of the corresponding distance partition.
We say $C$ is \emph{Leonard} (with respect the above ordering) if
\begin{equation*}
	(E_{i_1} \mathbf{x}_0)^{\circ \ell} \in \mathrm{span}_{\mathbb{C}}\{E_{i_0}\mathbf{x}_0,\dots,E_{i_{\ell}}\mathbf{x}_0\} \, \backslash \, \mathrm{span}_{\mathbb{C}}\{E_{i_0}\mathbf{x}_0,\dots,E_{i_{\ell-1}}\mathbf{x}_0\}
\end{equation*}
for $\ell=1,2,\dots,\rho$.
This definition is due to Koolen, Lee, and Martin \cite{KoLeMa2010}.
Let $A$ be the adjacency matrix of $\G$, and let $A^{\ster}=A^{\ster}(C)$ be the diagonal matrix in $M_{v\times v}(\mathbb{C})$ with diagonal entries $(A^{\ster})_{yy}=\frac{v}{|C|}(E_{i_1}\mathbf{x}_0)_y$.
They showed among other results that $C$ is Leonard if and only if the matrices $A$ and $A^{\ster}$ act on $\mathrm{span}_{\mathbb{C}}\{\mathbf{x}_0,\dots,\mathbf{x}_{\rho}\}=\mathrm{span}_{\mathbb{C}}\{E_{i_0}\mathbf{x}_0,\dots,E_{i_{\rho}}\mathbf{x}_0\}$ as a Leonard pair \cite{Terwilliger2001LAA}.
If $\G$ is a translation distance-regular graph and $C$ is additive, then it follows that $C$ is Leonard if and only if its coset graph is a $Q$-polynomial distance-regular graph.

Next we consider a weaker condition than being Leonard:
\begin{equation*}
	(E_{i_1} \mathbf{x}_0)^{\circ \ell} \in \mathrm{span}_{\mathbb{C}}\{E_{i_0}\mathbf{x}_0,\dots,E_{i_{\ell}}\mathbf{x}_0\} \quad (\ell=1,2,\dots,\rho).
\end{equation*}
As a class of completely regular codes satisfying this condition, Koolen, Lee, and Martin \cite{KoLeMa2010} also introduced \emph{harmonic} completely regular codes as follows.
Suppose $\G$ is $Q$-polynomial with respect to the ordering $\theta_0,\theta_1,\dots,\theta_D$.
We say $C$ is \emph{harmonic} if there is a positive integer $t$ such that $i_{\ell}=t\ell$ for $\ell=0,1,\dots,\rho$.
Descendents (cf.~Section \ref{sec: posets}) are examples of harmonic completely regular codes with $t=1$.
Tanaka \cite[Prop.~4.6]{Tanaka2011EJC} showed that a descendent in $\G$ with width $w$ and dual width $w^*=D-w(=\rho)>1$ is \emph{not} Leonard (with respect to this ordering) \emph{precisely when} $w$ is odd and the $Q$-polynomial structure satisfies type III in the notation of Bannai and Ito \cite[\S III.5]{bi} (cf.~\cite{Talgebra92}).


\subsection{Completely regular codes in the Hamming graphs}

Neumaier \cite{Neu92} conjectured that the only completely regular codes (with at least two words) in the Hamming graphs with minimum distance at least $8$ are the extended binary Golay code and the (binary) repetition codes of length at least $8$.
But he forgot to mention the even subcode of the binary Golay code (i.e., the subcode of the Golay code consisting of the codewords with even weight), as remarked by Borges, Rif\`{a}, and  Zinoviev \cite{BoRiZiDM08}, which was implicitly known to be completely regular.
(The bipartite double of the coset graph of the binary Golay code is distance-regular and has intersection array $\{ 23, 22, 21, 20, 3, 2, 1; 1, 2, 3, 20, 21, 22, 23\}$, and it follows from Theorem \ref{thmquotient} that there is a completely regular partition of the $23$-cube corresponding to this graph.
It is easy to check that this partition corresponds to the cosets of the even subcode of the Golay code, because all distances are even and it has exactly half the number of codewords of the Golay code; see also \cite[p.~362]{bcn}).
So we would like to rephrase Neumaier's conjecture as follows.

\begin{conj}
The only completely regular codes (with at least two words) in the Hamming graphs with minimum distance at least $8$ are the extended binary Golay code, the even subcode of the binary Golay code, and the repetition codes.
\end{conj}

Gillespie \cite{Gillespie2013DM} showed that the only completely regular codes in the binary Hamming graphs $H(D,2)$ with minimum distance greater than $\max\{2,D/2\}$ are the repetition codes and the dual code of the binary $[7,4,3]$-Hamming code.
Meyerowitz \cite{Meyerowitz2003DM} described all the completely regular codes with strength $0$ in the Hamming graphs.

Brouwer \cite{Brouwer1990DM} showed that any truncation of an even and almost even binary completely regular code is again completely regular.
Brouwer \cite{Brouwer1993DM} also gave a necessary and sufficient condition on when the extension of a binary completely regular code is again completely regular.

We say that a binary code $C$ of length $D$ is \emph{self-complementary} if $\mathbf{1} + c\in C$ for all $c \in C$, and \emph{non-self-complementary} otherwise,\footnote{Self-complementary codes and non-self-complementary codes are sometimes called antipodal codes and non-antipodal codes, respectively, in the literature. However, it seems that these are somewhat confusing names.} where $\mathbf{1}=(1,1,\dots,1)$ denotes the all-ones vector in $GF(2)^D$.
Borges, Rif\`{a}, and Zinoviev \cite{BoRiZiDM08} showed among other results that if $C$ is a binary non-self-complementary completely regular code with covering radius $\rho$, minimum distance at least $3$, and distance partition $\{C_0 = C,C_1, \dots, C_{\rho}\}$, then $C_{\rho}=C+\mathbf{1}$, from which it follows that $C \cup C_{\rho}$ is again a completely regular code.
This is a special case of the following construction:
if $C$ is a completely regular code with covering radius $\rho$ and if $\gamma_i = \beta_{\rho-i}$ for $i = 1,2, \ldots, \rho$ with $2i \neq \rho$, then $C \cup C_{\rho}$ is also completely regular.

\subsubsection{Completely transitive codes and generalizations}
\label{sec: completely transitive codes}
Giudici and Praeger \cite{GuPr99} defined the notion of a completely transitive code in a graph.
A code $C$ in a graph $\G$ is called \emph{completely transitive} if there is a group $H$ of automorphisms of $\G$ such that every cell of the distance-partition of $C$ is an orbit of $H$.
It is clear that a completely transitive code is completely regular.
Next suppose that $\G$ is a Cayley graph $\mathrm{Cay}(G, S)$.
Let $C$ be a subgroup of $G$ with covering radius $\rho$ (as a code in $\G$).
We say $C$ is \emph{coset-completely transitive} if the subgroup $\mathfrak{T}$ of the automorphism group of $G$ consisting of the elements that stabilize both $C$ and $S$ has exactly $\rho +1$ orbits on $G/C$.
This is an extension of the notion of coset-completely transitive codes in Hamming graphs $H(D,q)$ defined by Giudici and Praeger \cite{GuPr99},\footnote{To be more precise, they defined the concept for linear codes and considered the stabilizer of $C$ in the group
of weight-preserving sesquilinear automorphisms of $GF(q)^D$.} which in turn generalizes a concept of Sol\'{e} \cite{Sole1990DM}.
It is easy to see that if $C$ is coset-completely transitive and is in the center of $G$,
then $C$ is completely transitive with $H=C\rtimes\mathfrak{T}$.

There are many examples of coset-completely transitive additive codes in Hamming graphs, such as the codes in the Golay family:
the binary Golay code, the extended binary  Golay code, the even subcode of the binary Golay code, the punctured code of the binary Golay code, the even subcode of the punctured Golay code, the twice punctured binary Golay code, the ternary Golay code, and the extended ternary Golay code.
Rif\`{a} and Zinoviev \cite{RiZi11} showed that the lifts of the perfect Hamming codes are coset-completely transitive and that the coset graphs of these codes are the bilinear forms graphs.
Rif\`{a} and Zinoviev \cite{RiZipre08} also constructed an infinite family of binary linear completely transitive codes whose coset graphs are the halved cubes.
Borges, Rif\`{a}, and Zinoviev constructed many more linear completely regular and completely transitive codes;  see, e.g., \cite{BRZ2014DCC,RZ2010IEEE}.
Gillespie and Praeger \cite{GP2013DCC,GP2012-4pre} also considered generalizations of completely transitive codes.

There are only a few completely transitive binary codes known which are not coset-completely transitive, among them are the Hadamard code of length $12$ and its punctured code.
Gillespie and Praeger \cite{GP2013JCTA} showed that these codes are characterized as binary completely regular codes by their lengths and minimum distances.
See also \cite{GP2012-5pre}.
Borges, Rif\`{a}, and Zinoviev \cite{BR2000IEEE,BRZ2001IEEE} showed that the only binary coset-completely transitive codes with minimum distance at least $9$ are the binary repetition codes.
Gillespie, Giudici, and Praeger \cite{GGP2012pre} showed that the only completely transitive codes in the Hamming graphs with minimum distance at least $5$ such that the corresponding groups $H$ of automorphisms are faithful on coordinates are the binary repetition codes.

\subsubsection{Arithmetic completely regular codes}
\label{sec: arithmetic crc}

Harmonic completely regular codes in Hamming graphs
were called \emph{arithmetic} completely regular codes and studied in detail by Koolen, Lee, Martin, and Tanaka \cite{KoLeMapre09}.
Let $C$ be a completely regular code in $H(n,q)$ with covering radius $1$.
Then the cartesian product $C \times C \times \dots \times C$ ($t$ times) is an arithmetic completely regular code with covering radius $t$ in $H(nt, q)$.
Next, let $C$ be a completely regular code in $H(n,q)$ with covering radius $\rho\geq 1$ and parameters $\beta_i,\gamma_i$ ($i=0,1,\dots,\rho$).
Similarly, let $C'$ be a completely regular code in $H(n',q')$ with covering radius $\rho'\geq 1$ and corresponding parameters $\beta_i',\gamma_i'$ ($i=0,1,\dots,\rho'$).
Koolen, Lee, Martin, and Tanaka \cite[Prop.~3.4]{KoLeMapre09} showed that $C \times C'$ is completely regular in $H(n,q)\times H(n',q')$ if and only if there are integers $\beta,\gamma$ such that $\beta_{\rho-i}=\beta i$, $\gamma_i=\gamma i$ for $i=0,1,\dots,\rho$, and $\beta_{\rho'-i}'=\beta i$, $\gamma_i'=\gamma i$ for $i=0,1,\dots,\rho'$.
We note that completely regular codes having parameters of this form are arithmetic.
From this result it follows that if we take $C'$ to be a perfect binary $1$-error correcting code with length $2^t-1$ which is not isomorphic to the binary Hamming code $C$ of the same length, then the cartesian product of $C'$ and $s$ copies of $C$ is completely regular with covering radius $s+1$, but this code is certainly not completely transitive, answering a problem of Gillespie \cite[Problem 11.6]{gillespiethesis}.

Koolen, Lee, Martin, and Tanaka \cite[Thm.~3.16]{KoLeMapre09} also classified all arithmetic completely regular linear codes.
This is a generalization of a result of Bier \cite{Bier1987DM}.
Borges, Rif\`{a}, and Zinoviev \cite{BRZ2010AMC} classified all completely regular linear codes with covering radius $1$ (which are clearly arithmetic) using a different approach.

Fon-Der-Flaass \cite{FonDerFlaass2007SMJ} showed that, for fixed positive integers $\beta_0$ and $\gamma_1$, there is a completely regular code in $H(D,2)$ with covering radius $1$ and parameters $\beta_0$ and $\gamma_1$ for \emph{some} $D$ if and only if $\frac{\beta_0+\gamma_1}{(\beta_0,\gamma_1)}$ is a power of $2$.
(He attributed this result to S.~Avgustinovich and A.~Frid.)
Note that if $C$ is such a code in $H(D,2)$ then so is $C\times GF(2)$ in $H(D+1,2)$.
Fon-Der-Flaass \cite{FonDerFlaass2007SMJ} also obtained lower and upper bounds on the smallest diameter $D=D_0(\beta_0,\gamma_1)$ for which such a code exists.
A code in $H(D,2)$ is called \emph{degenerated} if it is isomorphic to $C\times GF(2)$ for some code $C$ in $H(D-1,2)$, and \emph{non-degenerated} otherwise.
Simon \cite{Simon1983P} showed that for any non-degenerated bipartition of $GF(2)^D(=V_{H(D,2)})$ there is a vertex adjacent to at least $\Omega(\log_2 D)$ vertices in the other cell.
This gives an upper bound on the maximum diameter $D=D_1(\beta_0,\gamma_1)(\geq D_0(\beta_0,\gamma_1))$ for which there is a non-degenerated binary completely regular code with covering radius $1$ and parameters $\beta_0$ and $\gamma_1$.
We remark that the method of Simon works in general for binary completely regular codes, not only for covering radius $1$.


\subsection{Completely regular codes in other distance-regular graphs}
\label{sec: crc in other drg}

The completely regular codes with strength $0$ in the Johnson graphs as well as Hamming graphs were described by Meyerowitz \cite{Meyerowitz1992JCISS,Meyerowitz2003DM}.
Note that descendents (cf.~Section \ref{sec: posets}) in $Q$-polynomial distance-regular graphs are examples of completely regular codes with strength $0$.
Brouwer, Godsil, Koolen, and Martin \cite{BGKM03} used Meyerowitz's results to determine all the descendents in the Johnson and Hamming graphs.
Tanaka \cite{Tanaka2006JCTA,Tanaka2011EJC} extended the classification of descendents to all of the $15$ known infinite families of distance-regular graphs having classical parameters with unbounded diameter.

Martin \cite{Martin1994JAC} determined the completely regular codes with strength $1$ and minimum distance at least $2$ in the Johnson graphs.
Martin \cite{Martin1998JCD} also studied general completely regular $t$-designs in the Johnson graphs in detail.
Sporadic examples include the $5$-$(24,8,1)$, $4$-$(23,7,1)$, and $3$-$(12,6,2)$ designs.
Completely transitive codes (cf.~Section \ref{sec: completely transitive codes}) in the Johnson graphs were studied by Godsil and Praeger \cite{GP1997pre}.
Liebler and Praeger \cite{LP2013pre} also considered generalizations of completely transitive codes in the Johnson graphs.
Completely regular codes in the Odd graphs were studied by Martin \cite{Martin-pre}.
Koolen \cite{Ko95} classified the completely regular codes in the Biggs-Smith graph.

The completely regular codes of a distance-regular graph with covering radius $1$ are exactly the same as (non-trivial) \emph{intriguing sets} studied by De Bruyn and Suzuki \cite{DBS10}.
Note that a code in a distance-regular graph is an intriguing set if and only if it has dual degree $1$.
Tight sets and $m$-ovoids in finite polar spaces are examples of intriguing sets.
Hemisystems (cf.~Section \ref{sec:recentclassical}) are $1$-designs in the dual polar graphs $^2\A_3(\sqrt{q})$ with $q$ odd, and are therefore intriguing sets.
Gavrilyuk and Mogilnykh \cite{GM2012pre} showed among other results the non-existence and uniqueness of certain Cameron-Liebler line classes in $PG(3,q)$, which are intriguing sets with dual width $1$ in $J_q(4,2)$.
See also \cite{Metsch2014JCTA,GM2014JCTA,FMX2014pre,BDMR2014pre}.

Recall that the incidence graph of a symmetric design is a $Q$-polynomial bipartite distance-regular graph with diameter $3$.
Martin \cite{Martin2001JCMCC} observed that several geometric substructures in finite projective spaces are Delsarte $T$-designs with $T\in\{\{1,3\},\{2,3\}\}$ in the corresponding bipartite distance-regular graphs, so that they provide more examples of intriguing sets.

Vanhove \cite{Vanhove2011JCD} showed among other results that partial spreads with maximum size $\sqrt{q^3}+1$ in $^2\A_5(\sqrt{q})$ as well as spreads in $\B_D(q)$ and $\C_D(q)$ with $D\in\{3,5\}$ are completely regular.
See also \cite{Vanhove2011PhD} for more results.

Perfect codes in a distance-regular graph $\G$ are completely regular, but non-trivial ones are very rare.\footnote{Here, `non-trivial' means that the minimum distance is at least $3$, and also at most $D_{\G}-2$ if $\G$ is an antipodal $2$-cover with $D_{\G}$ odd.}
It is well known that the only non-trivial perfect codes in the Hamming graphs $H(D,q)$ with minimum distance $\delta\geq 7$ (or $\delta=5$ and $q$ a prime power) are the binary Golay code and the ternary Golay code; cf.~\cite[\S 11.1D]{bcn}.
See, e.g., \cite{Etzion2007JCD} and the references therein for recent progress towards proving a longstanding conjecture of Delsarte \cite[p.~55]{del} that there are no non-trivial perfect codes in the Johnson graphs.
Chihara \cite{Chihara1987SIAM} showed that there are no non-trivial perfect codes in the Grassmann graphs, dual polar graphs, and the forms graphs, except possibly $\B_D(q)$ and $\C_D(q)$ with $D=2^m-1$ for some positive integer $m$.
Her proof depends only on a detailed analysis of the orthogonal polynomials $(v_i)_{i=0}^D$ associated with these graphs (see \eqref{distancepolynomials} and the remark after \eqref{TTR}), so that we also obtain, e.g., the non-existence for the twisted Grassmann graphs.
Martin and Zhu \cite{MZ1995DCC} gave a simple proof of the non-existence for the Grassmann and bilinear forms graphs using Delsarte's `Anticode Bound' (cf.~\cite[Prop.~2.5.3]{bcn}).
We note that the maximum anticodes in this case are precisely the descendents, in view of the Erd\H{o}s-Ko-Rado theorem for these graphs; cf.~\cite{Tanaka2006JCTA}.
Koolen and Munemasa \cite{KM2000JSPI} constructed perfect codes with minimum distance $3$ in the two Doob graphs with diameter $5$.
Krotov \cite{Krotov2014pre} recently showed among other results the existence of perfect codes with minimum distance $3$ in infinitely many Doob graphs.
