---
title: Total Perfect Code in Graphs
url: https://www.emergentmind.com/topics/total-perfect-code
type: topic
---

# Total Perfect Code in Graphs

Searching arXiv for recent and foundational papers on total perfect codes to ground the article.
A **total perfect code** in a graph \(\Gamma\) is a subset \(C\) of vertices such that every vertex of \(\Gamma\) is adjacent to exactly one vertex in \(C\). In the terminology used across the literature, this is the open-neighborhood analogue of a perfect code, and it is also called an **efficient open dominating set** [2112.06236], [2210.03336], [2603.20722]. The defining feature is the use of **open** neighborhoods rather than closed neighborhoods: vertices of the code must themselves have exactly one code-neighbor, so the induced subgraph on the code is a matching, and in particular the code has even cardinality [2112.06236], [2504.14942], [2603.20722], [1609.03755]. Research on total perfect codes spans general graph theory, Cayley graphs, coset graphs, subgroup sum graphs, non-cyclic graphs of finite groups, Cayley sum graphs, and generalized Petersen graphs, with several recent papers giving exact classifications in highly structured families [2112.06236], [2412.17509], [2507.11871], [2510.20376], [2603.20722].

## 1. Definition and distinction from ordinary perfect codes

A perfect code in a graph \(\Gamma\) is usually defined as an independent set \(C\) such that every vertex outside \(C\) is adjacent to exactly one vertex in \(C\) [2112.06236], [2210.03336], [2504.14942]. By contrast, a total perfect code is a set \(C\) such that every vertex of \(\Gamma\) is adjacent to exactly one vertex in \(C\) [2112.06236], [2504.14942], [2603.20722], [1609.03755]. The distinction is structural: for a perfect code, vertices in \(C\) are not required to have neighbors in \(C\), indeed \(C\) must be independent, whereas for a total perfect code, every vertex in \(C\) must also have exactly one neighbor in \(C\), so \(\Gamma[C]\) is a matching [2112.06236], [2504.14942], [2603.20722].

This open-neighborhood formulation is the central conceptual difference. In graph-theoretic language, perfect codes correspond to exact covering by closed neighborhoods, while total perfect codes correspond to exact covering by open neighborhoods [2504.14942], [1609.03755]. Several papers make this contrast explicit. In the coset-graph framework, a total perfect code is described as an “open-neighborhood” analogue of a perfect code [2112.06236]. In Cayley sum graphs, the term **efficient open dominating set** is used explicitly for total perfect codes [2210.03336]. In generalized Petersen graphs, the same distinction is emphasized again: perfect codes are efficient dominating sets, while total perfect codes are efficient open dominating sets [2603.20722].

A recurrent source of confusion in adjacent literature is the use of the phrase “perfect code” for domination by closed neighborhoods in settings where total perfect codes are not studied. For example, work on generalized Fibonacci cubes concerns only standard perfect codes, explicitly not total perfect codes, and its notion is based on closed neighborhoods \(N[u]\), not open neighborhoods \(N(u)\) [1801.04106]. The same exclusion is stated in work on 2-valent Cayley digraphs on abelian groups, where domination uses closed out-neighborhoods \(\{u\}\cup N^+(u)\), not open-neighborhood exact domination [2310.19017]. This suggests that precise neighborhood conventions are essential when comparing results across graph families.

## 2. General structural consequences

The most basic consequence of the definition is that a total perfect code induces a matching [2112.06236], [2504.14942], [2603.20722], [1609.03755]. In the non-cyclic graph of a finite group, this is stated in the form: if \(\Gamma\) admits a total perfect code, then the induced subgraph \(\Gamma[T]\) is a matching [2504.14942]. In generalized Petersen graphs the same point is used to derive parity restrictions, since a total perfect code must have even size [2603.20722]. In Cayley graphs, the open-neighborhood partition viewpoint implies exact covering equations that behave like graph factorizations [2507.11871], [1609.03755].

For regular graphs, the definition yields a counting condition. If \(\Gamma\) is \(d\)-regular and admits a total perfect code \(C\), then \(|C|=|V(\Gamma)|/d\) [1601.03471]. This is used repeatedly in structured settings. In a 2-valent Cayley digraph with ordinary perfect codes, the analogous closed-neighborhood count is \(|G|=3|C|\) [2310.19017]; for total perfect codes, one expects a different equation because self-domination is excluded, and the cited paper explicitly warns against conflating the two notions [2310.19017]. In Cayley graphs of abelian groups, the factorization identity for total perfect codes gives \(|S||C|=|G|\), where \(S\) is the connection set [2507.11871]. In Cayley sum graphs of cyclic groups, the corresponding factorization likewise implies \(|G|=|C||S|\) [2510.20376].

Another general consequence is spectral. In a \(d\)-regular graph, if \(C\) is a total perfect code, then the adjacency operator satisfies \(\varphi(\delta_C)=\delta_V\), and one consequence is that \(0\) must be an eigenvalue of the graph if \(d\ge 2\) [1601.03471]. In abelian Cayley graphs this becomes a multiplicity condition: the multiplicity of \(0\) as an eigenvalue must be at least \(|S|\) [1601.03471]. This suggests that total perfect codes are constrained not only combinatorially but also by the representation-theoretic structure of the graph.

## 3. Cayley graphs and factorization principles

A major strand of the literature treats total perfect codes in Cayley graphs through group factorizations. If \(G\) is a finite group and \(S\subseteq G\setminus\{e\}\) satisfies \(S^{-1}=S\), then \(\operatorname{Cay}(G,S)\) has a total perfect code \(C\) precisely when every group element has a unique representation relative to \(S\) and \(C\) [2507.11871]. In the abelian notation used there, \(C\) is a total perfect code if and only if \((S,C)\) is a factorization of \(G\), equivalently
\[
G=S\oplus C.
\]
This means every \(g\in G\) has a unique expression \(g=s+c\) with \(s\in S\) and \(c\in C\) [2507.11871]. The corresponding necessary condition is
\[
|S||C|=|G|,
\]
and a practical uniqueness criterion is
\[
(S-S)\cap(C-C)=\{0\}
\]
[2507.11871].

The same philosophy appears in Cayley sum graphs, but with the graph operation changed from differences to sums. In \(\mathrm{CS}(\mathbb Z_n,S)\), vertices \(g,h\) are adjacent when \(g+h\in S\) and \(g\neq h\), and a total perfect code is equivalent to the factorization
\[
\mathbb Z_n=(-C)\oplus S
\]
[2510.20376]. The paper establishes this correspondence first and then derives periodic, aperiodic, and square-free criteria from it [2510.20376]. A similar factorization criterion is also developed for subgroup total perfect codes in Cayley sum graphs of arbitrary finite groups, where existence is characterized by a normal left transversal whose unique point in the subgroup is a nonsquare of the subgroup [2210.03336].

In ordinary Cayley graphs, subgroup total perfect codes are governed by inverse-closed transversals. A subgroup \(H\) is a total perfect code in \(\operatorname{Cay}(G,S)\) if and only if \(S\) is a left transversal of \(H\) in \(G\) [1609.03755]. For normal subgroups, this leads to an exact criterion: \(H\) is a total perfect code of \(G\) if and only if \(|H|\) is even and
\[
\forall g\in G\ (g^2\in H)\ \exists h\in H\ ((gh)^2=e)
\]
[1609.03755]. In abelian groups the problem reduces to the Sylow \(2\)-subgroup, and when \(H\cap P\) is cyclic there is an exact projection criterion [1609.03755]. For cyclic groups this simplifies completely:
\[
H \text{ is a total perfect code of } G \iff |H| \text{ is even and } |G/H| \text{ is odd}
\]
[1609.03755].

## 4. Vertex-transitive and coset-graph formulations

Every vertex-transitive graph can be represented as a coset graph, and this provides a broader setting for subgroup total perfect codes beyond ordinary Cayley graphs [2112.06236]. For a finite group \(G\), a subgroup \(H\le G\), and a union \(U\) of double cosets satisfying \(H\cap U=\varnothing\) and \(U^{-1}=U\), the coset graph
\[
\Gamma=\operatorname{Cos}(G,H,U)
\]
has vertex set \(G/H\), with adjacency \(g_1H\sim g_2H\) iff \(g_1^{-1}g_2\in U\) [2112.06236]. In this framework, a subgroup \(A\) with \(H\le A\le G\) is a subgroup total perfect code of the pair \((G,H)\) if \(A/H\) is a total perfect code in some such coset graph [2112.06236].

The key result is a two-part characterization. First, total perfect codehood is equivalent to perfect codehood plus an internal involution-type element:
\[
A \text{ is a total perfect code of } (G,H)
\]
if and only if
\[
A \text{ is a perfect code of } (G,H)\quad\text{and}\quad \exists\, x\in N_A(H)\setminus H \text{ such that } x^2\in H
\]
[2112.06236]. Second, there is a direct transversal form:
\[
A \text{ is a total perfect code of } (G,H)
\]
if and only if there exists a left transversal \(X\) of \(A\) in \(G\) such that
\[
XH=HX^{-1}
\]
and \(X\) contains an element of \(A\setminus H\) [2112.06236]. This extra element in \(A\setminus H\) encodes the matching required inside the code.

This coset-graph perspective makes explicit that total perfect codes are a refinement of subgroup perfect codes rather than a completely separate object. Theorems on heredity to intermediate subgroups and transfer across semidirect-product-type decompositions further show that total-perfect-code status behaves functorially in the pair \((G,H)\) [2112.06236]. A plausible implication is that many existence questions can be reduced to quotient or transversal data rather than studied directly on the graph.

## 5. Total perfect codes in Cayley sum graphs and subgroup sum graphs

Cayley sum graphs provide a distinct open-neighborhood geometry. For a finite group \(G\) and a normal subset \(X\subseteq G\), \(\mathrm{CS}(G,X)\) has vertex set \(G\), with \(g\sim h\) iff \(gh\in X\) and \(g\neq h\) [2210.03336]. In this setting, a subgroup \(H\) is a total perfect code exactly when there exists a normal left transversal \(Y\) of \(H\) in \(G\) such that the unique common element of \(H\) and \(Y\) is a nonsquare of \(H\) [2210.03336]. For normal subgroups, there is a sharp reduction: \(H\) is a total perfect code of some Cayley sum graph of \(G\) if and only if \(H\) is a perfect code of some Cayley sum graph of \(G\) and \(Z(G)\) contains a nonsquare of \(H\) [2210.03336].

This theory becomes especially explicit in several group families. Every even-order subgroup of an abelian group is a total perfect code of some Cayley sum graph [2210.03336]. Connected dihedral Cayley sum graphs admitting subgroup total perfect codes are completely classified by explicit examples [2210.03336]. For \(\mathrm{AGL}_1(q)\), subgroup total perfect codes in Cayley sum graphs are classified exactly by a family constructed from transversals in a Frobenius complement, with the extra requirement that a distinguished representative be a nonsquare in the subgroup [2210.03336].

A separate graph family is given by subgroup sum graphs \(\Gamma_{G,H}\) and extended subgroup sum graphs \(\Gamma_{G,H}^{+}\), defined from a finite group \(G\) and a normal subgroup \(H\trianglelefteq G\) by adjacency conditions \(xy\in H\setminus\{e\}\) and \(xy\in H\), respectively [2412.17509]. Here the total-perfect-code problem is completely solved. For \(\Gamma_{G,H}\), a total perfect code exists if and only if either \(|H|=2\) and every \(x\in G\setminus H\) with \(x^2\in H\) is an involution, or
\[
G=\mathbb Z_2^n\times \mathbb Z_3
\quad\text{and}\quad
H=\{e,(0,\ldots,0,1),(0,\ldots,0,2)\}
\]
for some \(n\ge 0\) [2412.17509]. For abelian groups this becomes a full structural classification [2412.17509]. For the extended subgroup sum graph, the criterion is even simpler:
\[
\Gamma_{G,H}^{+}\text{ has a total perfect code} \iff |G| \text{ is even and } |H|=2
\]
[2412.17509]. This suggests that the open-neighborhood requirement is extremely rigid in subgroup-sum settings.

## 6. Cyclic and abelian cases: congruence criteria

In cyclic and abelian Cayley-type graphs, many total-perfect-code existence theorems reduce to residue conditions. For ordinary Cayley graphs of finite abelian groups, the factorization program yields exact criteria when \(|S|=p\) or \(|S|=p^\ell\) and the relevant prime divides exactly one cyclic factor. If
\[
G=\mathbb Z_{n_1}\times\cdots\times \mathbb Z_{n_d}
\]
and \(|S|=p\) is an odd prime dividing exactly one \(n_t\), then \((G,S)\) admits a total perfect code if and only if, for distinct elements of \(S\), the \(t\)-th coordinates are pairwise distinct modulo \(p\) [2507.11871]. The same statement holds with \(p^\ell\) in place of \(p\), requiring distinctness modulo \(p^\ell\) [2507.11871]. In cyclic groups, this specializes to the practical condition
\[
s\not\equiv s' \pmod{|S|}
\qquad\text{for distinct } s,s'\in S,
\]
which is exact in many major cases, including prime and prime-power degrees, \(pq\)-size connection sets under appropriate hypotheses, and the good-family orders listed in the paper [2507.11871].

For Cayley sum graphs of cyclic groups, the picture is similar but the graph operation is addition rather than subtraction. The paper "Total perfect codes in Cayley sum graphs of cyclic groups" [2510.20376] proves that \(C\) is a total perfect code in \(\mathrm{CS}(\mathbb Z_n,S)\) if and only if
\[
\mathbb Z_n=(-C)\oplus S,
\]
and then derives several necessary and sufficient conditions when \(S\) is periodic, aperiodic, or square-free [2510.20376]. In many cyclic cases the same residue condition
\[
s\not\equiv s' \pmod{|S|}
\]
for distinct \(s,s'\in S\) is again the governing criterion [2510.20376].

The earlier paper "Perfect codes in circulant graphs" [1703.08652] gives analogous exact theorems directly for total perfect codes in undirected circulants \(\mathrm{Cay}(\mathbb Z_n,S)\). If the degree is \(p\), where \(p\) is an odd prime, then a connected circulant admits a total perfect code if and only if
\[
p\mid n
\quad\text{and}\quad
s\not\equiv s' \pmod p
\text{ for distinct } s,s'\in S
\]
[1703.08652]. More generally, if the degree is \(p^\ell\), where \(p^\ell\) is the largest power of \(p\) dividing \(n\), then a total perfect code exists if and only if
\[
s\not\equiv s' \pmod{p^\ell}
\text{ for distinct } s,s'\in S
\]
[1703.08652]. These results are exact open-neighborhood analogues of the paper’s perfect-code theorems, with \(S\) replacing \(S\cup\{0\}\) in the generating-polynomial argument [1703.08652].

## 7. Nonexistence phenomena in non-cyclic graphs of groups

A striking contrast between perfect codes and total perfect codes appears in the non-cyclic graph \(\Gamma(G)\) of a finite group \(G\), whose vertices are \(G\setminus \mathrm{Cyc}(G)\) and where \(x\sim y\) iff \(\langle x,y\rangle\) is not cyclic [2504.14942]. The paper proves a complete characterization of perfect-code existence:
\[
\Gamma(G)\text{ admits a perfect code}
\iff
\Gamma(G)\text{ has a dominating vertex}
\iff
G\text{ has a maximal cyclic subgroup of order }2
\]
[2504.14942]. In this situation, any perfect code must be a singleton consisting of an involution [2504.14942].

For total perfect codes the result is much more restrictive. If \(G\) is a finite non-cyclic nilpotent group, then \(\Gamma(G)\) does not admit a total perfect code [2504.14942]. The proof uses two nilpotent-group features: the existence of a non-cyclic Sylow \(p\)-subgroup containing at least \(p+1\) subgroups of order \(p\), and the fact that elements of coprime orders commute [2504.14942]. Together these create unavoidable double-adjacency obstructions to the uniqueness requirement. This establishes an explicit class where perfect codes may exist but total perfect codes do not.

This suggests a general principle: total perfect codes are often far more fragile than perfect codes in graphs whose adjacency reflects deep algebraic overlap, because open-neighborhood uniqueness is sensitive to local multiplicities that closed-neighborhood domination can tolerate.

## 8. Classification in generalized Petersen graphs

The 2026 paper "Classification of perfect and total perfect codes in generalized Petersen graphs" [2603.20722] gives one of the cleanest modern classifications in a classical graph family. The generalized Petersen graph \(GP(n,k)\) has vertex set
\[
\{u_i,v_i\mid i\in\mathbb Z_n\},
\]
with edges
\[
u_i\sim u_{i+1},\qquad u_i\sim v_i,\qquad v_i\sim v_{i+k}
\]
[2603.20722]. Total perfect codes are completely classified, and they occur in exactly two forms.

The first family exists when
\[
n\equiv 0\pmod 3,\qquad k\not\equiv 0\pmod 3,
\]
and the code is
\[
C_j=\{u_{3i+j},\, v_{3i+j}\mid i\in\mathbb Z_n\},
\qquad j\in\{0,1,2\}
\]
[2603.20722]. Here the code edges are spokes \(u_\ell v_\ell\), appearing every third position.

The second family exists when
\[
n\equiv 0\pmod 6,\qquad k\equiv \pm 1\pmod 6,
\]
and the code is
\[
C'_j=\{u_{6i+j},\,u_{6i+j+1},\,v_{6i+j+3},\,v_{6i+j+4}\mid i\in\mathbb Z_n\},
\qquad j\in\{0,1,2,3,4,5\}
\]
[2603.20722]. In this case, the matching lies on the outer and inner cycles rather than on spokes.

The proof combines a global counting identity,
\[
|E(C)\cap E(U)|=|E(C)\cap E(V)|,
\qquad
2|E(C)\cap E(U)|+|E(C)\cap E(U,V)|=\frac n3,
\]
with a structural lemma showing that if a total perfect code contains even one outer-cycle code edge, then it contains no spoke code edge [2603.20722]. This forces the two-family dichotomy. A plausible implication is that periodicity modulo \(3\) and \(6\) is not accidental but arises from the cubic local geometry of generalized Petersen graphs under the matching constraint.

## 9. Cubelike graphs and degree constraints

The paper "Total perfect codes in Cayley graphs" [1601.03471] gives a sharp classification for connected cubelike graphs, that is, Cayley graphs on \(\mathbb Z_2^n\). A connected cubelike graph admits a total perfect code if and only if its degree is a power of \(2\) [1601.03471]. The proof uses the abelian criterion
\[
|C||S|=|G|
\quad\text{and}\quad
(C-C)\cap(S+S)=\{0\}
\]
together with a linear-algebraic construction of a subgroup \(C\) as the null space of a matrix \(M\) whose syndrome values separate the elements of the connection set [1601.03471]. In particular, for the hypercube \(Q_d\), a total perfect code exists if and only if
\[
d=2^t
\]
for some integer \(t\ge 1\) [1601.03471].

This result is notable because it converts a domination problem into a coding-theoretic linear-syndrome construction. It also shows that, unlike in general Cayley graphs, the characteristic \(2\) setting is unusually favorable: every subgroup is normal, every element is its own inverse, and the condition on \(S+S\) is naturally linearized [1601.03471].

## 10. Directions not covered by total perfect code theory in adjacent perfect-code literature

A number of papers in the broader perfect-code literature are relevant mainly as contrast cases. Work on generalized Fibonacci cubes proves existence of standard perfect codes in \(\Gamma_n(1^s)\) for
\[
n=2^p-1,\qquad s\ge 3\cdot 2^{p-2},
\]
but explicitly does not study total perfect codes [1801.04106]. Work on perfect codes in 2-valent Cayley digraphs on abelian groups gives a complete classification for domination by closed out-neighborhoods, again not total perfect codes [2310.19017]. Several coding-theoretic papers on binary, \(\mathbb Z_2\mathbb Z_4\)-additive, or \(\mathbb Z_4\)-linear perfect codes also concern only ordinary radius-1 perfect codes, not efficient open domination [1510.06166], [0710.0198], [2605.12148].

This repeated boundary suggests that total perfect codes remain a distinctly graph-theoretic object even when studied in algebraic graph families. A plausible implication is that techniques from perfect-code theory transfer only partially: counting and factorization often survive, but independence-based arguments do not.

## 11. Synthesis

Across the literature, a total perfect code is best understood as an exact open-neighborhood partition, equivalently a matching-structured efficient open dominating set [2112.06236], [2210.03336], [2603.20722], [1609.03755], [1601.03471]. In highly symmetric graphs, especially Cayley, coset, and sum-graph settings, this condition translates into algebraic factorizations, transversal conditions, or residue constraints [2112.06236], [2210.03336], [2507.11871], [2510.20376]. The strongest general patterns are these: total perfect codes are strictly more rigid than perfect codes; subgroup total perfect codes often require involution-type structure; in abelian settings they are frequently governed by congruence classes modulo the degree; and in many structured families complete classifications reduce existence to a small number of arithmetic possibilities [1609.03755], [1703.08652], [2412.17509], [2603.20722].

At the same time, nonexistence results are prominent. Finite non-cyclic nilpotent groups have no total perfect codes in their non-cyclic graphs [2504.14942]. Many graph families studied for perfect codes have not yet been systematically treated in the total-perfect setting [1801.04106], [2310.19017]. This suggests that the theory is both mature in selected algebraic families and still incomplete as a general theory of open-neighborhood exact domination.

Source: https://www.emergentmind.com/topics/total-perfect-code