Next Article in Journal
Comparison of AFIR NS and AFIR NN Topologies Using the Magnetic Equivalent Circuit Method
Previous Article in Journal
A Comparative Analysis of Gradient-Based, Edge-Based, and Segmentation-Based Data Augmentation Methods for Early Diagnosis of Alzheimer’s Disease Using Neuroimaging Modalities and Deep Learning
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

On the Equivalence Classes of Recoverable Patterns in DR Code: A Group-Theoretic Analysis with Applications to Storage Optimization

Department of Information Technology, Research Center of Information Technology for the Future, Faculty of Informatics, Mahasarakham University, Mahasarakham 44150, Thailand
*
Author to whom correspondence should be addressed.
Symmetry 2026, 18(8), 1255; https://doi.org/10.3390/sym18081255
Submission received: 4 June 2026 / Revised: 24 June 2026 / Accepted: 14 July 2026 / Published: 23 July 2026

Abstract

The DR Code (Data Restorable Code), originally proposed by Sriphum in 2013, is a two-dimensional barcode that achieves a 33% data-recovery rate against six distinct cases of strip-shaped data loss using simple XOR-based parity. The original work presented a single 3 × 3 arrangement of nine logical blocks (A0, A1, A2, B0, B1, B2, C0, C1, C2) in which each row and each column contain exactly one element from each of the three data classes (A, B, C). This paper systematically enumerates every 3 × 3 arrangement that satisfies this recoverability property and proves, by exhaustive search released as an open-source program (DR15.py), that exactly 2592 such arrangements exist. We then introduce five structural theorems—mirror reflection, vertical flipping, Tetris-style rotation, cyclic column rotation, and cyclic row rotation—and prove that each preserves recoverability. We show that these five generators, viewed as a group action, produce a finite group of order 72 isomorphic to the semi-direct product (C3 × C3) ⋊ D4, which partitions the 2592 patterns into exactly 36 absolute equivalence classes. We further explore the partial-quotient structure under D4 alone (yielding 324 classes, the case the practitioner is most likely to encounter) and under cyclic-only quotient (yielding 288 classes). As practical contributions, we propose (i) a compact equivalence-class encoding that reduces the storage cost of one DR Code template from a naïve 36 bits to 13 bits, and (ii) a canonical-form deduplication scheme suitable for cloud and embedded storage systems. Additionally, we propose two further contributions: a fast pattern-validity oracle based on canonical lookup, and a randomization-friendly DR Code variant for security-aware barcode applications. Empirical results confirm all theorems on the full enumeration of 2592 patterns.

1. Introduction

Symmetry analysis provides a powerful framework for understanding the structure of constrained combinatorial objects: when a finite set V of patterns satisfies a structural constraint preserved by a natural group G of transformations, the orbit decomposition of V under G reveals fundamental equivalence classes and enables compact representation, efficient enumeration, and canonical-form deduplication. This paper applies such symmetry analysis to a constrained combinatorial structure arising in two-dimensional barcode design: the DR Code (Data Restorable Code), originally introduced by Sriphum [1] in 2013. Two-dimensional barcodes have become indispensable to modern industry and logistics. The QR Code [2] is presently the most widely deployed format due to its high information density and its Reed–Solomon error correction, which at the H quality level can recover up to 30% of the codeword data when loss occurs in two specific spatial regions [3,4]. However, the rigidity of QR Code’s error-correction layout limits the geometry of recoverable damage to those specific regions; arbitrary horizontal or vertical strips that cross the format-information area cannot be repaired.

Symmetry as the Organizing Principle

The 3 × 3 grid that hosts the DR Code is a square lattice whose natural geometric symmetry group is the dihedral group D4 of order 8, consisting of four rotations (by 0°, 90°, 180°, 270°) and four reflections (horizontal, vertical, and the two diagonal mirrors). D4 is the natural symmetry group of any square grid and appears whenever 2D arrangements are studied modulo orientation. In the context of the DR Code, D4 captures exactly those transformations that a printed barcode undergoes when physically rotated or flipped before being scanned—the geometric component of the problem.
In addition to the geometric symmetries, the DR Code recoverability constraint—requiring every row and every column to contain exactly one element of each class—is invariant under cyclic permutations of the row labels and, independently, under cyclic permutations of the column labels. These two cyclic actions form the group C3 × C3 of order 9. Unlike the dihedral D4, which is purely geometric, the C3 × C3 component is combinatorial: it reflects the fact that the labeling of rows and columns is, from the perspective of recoverability, an arbitrary choice that can be cyclically shifted without altering the validity of the template. This is the row/column-translation symmetry that is unique to the DR Code recoverability constraint and that has no direct analog in, for instance, the QR Code’s error-correction layout.
The full symmetry group of the DR Code recoverability structure is therefore the order-72 group generated by the geometric symmetries D4 and the combinatorial symmetries C3 × C3. As we prove rigorously and verify computationally in Section 6, this group is the semi-direct product G = (C3 × C3) ⋊ D4 of order 72. The semi-direct (rather than direct) structure is itself a central structural finding of this paper: the geometric D4 action does not commute with the combinatorial C3 × C3 action—a 90° rotation of the grid interchanges the row- and column-cyclic shifts (Section 6.1), so rotating and then shifting is in general not the same as shifting and then rotating. What does hold, and what makes the canonical-form encoding of Section 7.1 tractable, is that the cyclic factors C3 × C3 form a normal subgroup and that every group element factors uniquely as a product n·d with n ∈ C3 × C3 and d ∈ D4. It is this unique factorization—a property of every internal semi-direct product, not commutativity—that lets the element mapping an arbitrary template to its canonical representative be recorded unambiguously as the pair (n, d) ∈ (C3 × C3) × D4.
The choice of symmetry framework is not merely aesthetic. By identifying templates that are equivalent under the natural geometric and combinatorial symmetries of the problem, we obtain a fundamental reduction from the 2592 recoverable templates to just 36 absolute equivalence classes—a 72-fold compression that is precisely the order of the symmetry group. This compression has immediate practical consequences: per-template storage drops from 36 bits to 13 bits, validity checking becomes a constant-time canonical-form lookup, and the small number of atomic patterns enables novel anti-cloning protocols. More broadly, the framework demonstrates how group-theoretic methods—long established in algebraic combinatorics—can illuminate practical engineering problems in coding and information storage. This perspective is the central methodological contribution of the paper, and the remainder of the manuscript develops it in detail.
To address this limitation, Sriphum [1] proposed the DR Code (Data Restorable Code), a two-dimensional barcode whose layout supports six geometric cases of single-strip data loss—namely loss of any of the three rows or any of the three columns of a 3 × 3 logical block arrangement—while recovering 33% of the lost data. The mechanism is elegantly simple: the nine logical blocks consist of two data classes (A and B, each holding three blocks) plus a parity class C computed cell-wise as Ci = Ai ⊕ Bi. The blocks are placed on a 3 × 3 grid such that every row and every column contains exactly one A-block, one B-block, and one C-block. When any single row or column is destroyed, the remaining six cells contain the surviving A-, B-, and C-blocks needed to reconstruct the missing trio via XOR. Sriphum’s original paper presented one such valid arrangement (Figure 1) and gave informal arguments for its recoverability. Two scientific questions, however, remained open:
(Q1) How many distinct 3 × 3 arrangements of the nine logical blocks satisfy the row/column class-uniqueness property?
(Q2) How are these arrangements related to one another under natural symmetry operations, and can such relationships be exploited to compress, deduplicate, or accelerate the storage and processing of DR Code templates?
This paper answers both questions. Our contributions are summarized as follows.
Contribution 1—Exhaustive enumeration. We provide an open-source enumerator (DR15.py) that exhaustively examines all 9! = 362,880 permutations of the nine logical blocks and certifies, by direct combinatorial proof, that exactly 2592 of them satisfy the DR Code recoverability property. The program is freely available on GitHub (link in references) for independent verification.
Contribution 2—Structural theorems and equivalence classes. We formulate and prove five symmetry theorems—Mirror, Flip, Tetris-Rotation, Cyclic Column Rotation, and Cyclic Row Rotation—each of which transforms a recoverable pattern into another recoverable pattern. We then characterize the algebraic structure of the closure of these generators as the semi-direct product (C3 × C3) ⋊ D4 of order 72. Under this group action, the 2592 patterns partition into exactly 36 absolute equivalence classes, while under the practitioner-friendly D4 subgroup alone they form 324 classes.
Contribution 3—Storage and canonical-form theory. We design a canonical-form encoding for DR Code templates that reduces per-template storage from a naïve 36 bits to 13 bits (a 2.8× reduction), with applications to cloud storage, embedded systems, and RAM-constrained devices.
Contribution 4—Constant-time validity oracle. Building on the canonical form, we propose a 36-entry lookup table that decides whether an arbitrary permutation of the nine blocks is a valid DR Code template in O(1) time, replacing the six row-and-column checks of the naïve algorithm.
Contribution 5—Randomized DR Code for security applications. We propose using the 2592-pattern repertoire as a secret per-code key for visually similar but logically distinct barcodes—a useful defense against barcode-cloning attacks where an adversary photographs a code and prints a duplicate.
The remainder of the paper is organized as follows. Section 2 reviews related work on 2D barcodes, error correction, and group-theoretic combinatorics. Section 3 formalizes the DR Code recoverability property. Section 4 presents the enumeration algorithm and result. Section 5 states and proves the five symmetry theorems. Section 6 develops the group-theoretic analysis and the hierarchy of equivalence classes. Section 7 presents the storage and oracle contributions. Section 8 discusses applications and limitations. Section 9 concludes.
To preview our main quantitative findings, of the 362,880 = 9! possible bijections of nine logical blocks to a 3 × 3 grid, exactly 2592 satisfy the DR Code recoverability property—a striking 0.71% selection ratio. Under the symmetry group G of order 72 generated by mirror, flip, rotation, column-cycle and row-cycle, this collapses to 36 absolute equivalence classes. Under the practitioner-relevant subgroup D4 (which is what a barcode camera ‘sees’ when it physically rotates or flips a printed code), it collapses to 324 classes. Each of these numbers is small enough to enumerate, store, and process exhaustively, opening up algorithmic possibilities that would be unthinkable for, say, the QR Code’s enormous codeword space. The decomposition G ≅ (C3 × C3) ⋊ D4 is itself a structural finding: the dihedral component D4 captures the natural geometric symmetries of the square grid (the eight ways a square can be rotated and reflected onto itself), whereas the cyclic factors C3 × C3 capture the row and column translational symmetries that are unique to the DR Code recoverability constraint. The two classes of operation do not commute—a 90° rotation interchanges the row- and column-cyclic shifts—so the closure is a semi-direct product (C3 × C3) ⋊ D4 rather than a direct product. The cyclic factors nonetheless form a normal subgroup, and the resulting unique factorization of every group element is what makes the canonical-form encoding tractable. This symmetry-based perspective is the central methodological contribution of the paper.

2. Background and Related Work

2.1. Two-Dimensional Barcodes

The history of barcode technology spans more than five decades. The Universal Product Code (UPC), introduced by IBM in 1970, supported 13 numerical digits and revolutionized retail point-of-sale systems. Its successors—Code 39 (1974), Code 49 (1980s), and Code 16K—expanded data capacity progressively to 100 digits but remained one-dimensional. The seminal leap came in 1994 with the QR Code [2], capable of storing up to 7000 numerical digits or several thousand alphanumeric characters and explicitly designed to support Kanji, the logographic script widely used in Japan [2]. Subsequent variants such as MaxiCode [5] explored hexagonal layouts, while online generators [6] made the technology accessible to non-specialists.
Subsequent two-dimensional barcodes have explored multiple optimization axes. Parikh and Jancke [7] proposed augmenting binary cells with color to multiply the encoded capacity. Bulan et al. [8] employed dot-orientation modulation to transmit data through halftoning channels. Yu Fang and Yue Peng [9] focused on smartphone-camera optimized geometries, while Tan and Chai [10] examined JPEG-compression robustness via DCT-coefficient analysis. Belussi and Hirata [11] addressed fast QR code detection in arbitrarily acquired images, and Querini et al. [12] surveyed 2D color barcodes for mobile phones. Yang et al. [13] proposed robust and fast decoding schemes for high-capacity color QR codes. Falas and Kashani [14] and Kato and Tan [15] provided early treatments of camera-equipped mobile phone 2D barcode decoding. None of these works, however, addressed the geometry of strip-shaped damage that motivates the DR Code.

2.2. Error Correction in Barcodes

Most 2D barcodes employ Reed–Solomon (RS) codes for error correction [4,16,17]. RS codes are powerful but computationally heavy, requiring finite-field arithmetic, syndrome calculation, and an iterative decoding step (e.g., Berlekamp–Massey). On embedded devices and low-power scanners this overhead is non-negligible. The DR Code [1] sidesteps RS entirely by using bitwise XOR—the same primitive that underlies RAID-5 storage [18,19]—and pays for this simplicity with a constrained but practically useful damage geometry. Reed and Solomon’s original work on polynomial codes over finite fields [16] established the algebraic framework on which many modern error-correction codes rely; subsequent treatments of Reed–Solomon codes and error-control coding [17,20] further developed this foundation. Pattern-recognition and run-length-based methods for QR code detection have also been explored [11,21,22].

2.3. Group-Theoretic Analysis of Combinatorial Structures

The technique of partitioning a combinatorial set into orbits under a group action is classical [23,24]. Burnside’s lemma and the Cauchy–Frobenius–Burnside theorem [25] permit counting equivalence classes by averaging fixed-point counts. Applications include counting distinct dice colorings [26], chemical isomers [27], and Latin-square equivalence classes [28]. The 3 × 3 layout problem of the DR Code is, in fact, a constrained relative of the Latin square problem—a Latin square forces each symbol to appear once per row and column, while the DR Code forces each class (a set of three symbols) to appear once per row and column. To the best of our knowledge, no prior work has analyzed this particular constraint.

2.4. The Dihedral Group D4 and Cyclic Groups

The dihedral group D4 of order 8 captures the symmetries of a square: four rotations (0°, 90°, 180°, 270°) and four reflections (horizontal, vertical, and the two diagonals). It is the natural symmetry group of any square grid and appears whenever 2D arrangements are studied modulo orientation. The cyclic group Cn of order n captures the n-step rotations of a sequence; here, we use C3 for the three positions in a row or column. The semi-direct product (C3 × C3) ⋊ D4 has order 8 × 3 × 3 = 72 and, as we shall prove, acts faithfully on the 2592 DR Code patterns.

2.5. Latin Squares and Frequency Squares

A Latin square of order n is an n × n array filled with n different symbols, each occurring exactly once in each row and exactly once in each column [28]. The DR Code recoverability constraint is a relaxation: it requires that each of the three classes (rather than each individual symbol) appears exactly once in each row and column. This places the DR Code into the family of frequency squares (also called F-squares), introduced by Hedayat and Seiden in 1970, in which each symbol occurs a prescribed number of times in each row/column. A 3 × 3 frequency square with three symbols, each appearing once per line is exactly a Latin square of order 3, of which there are 12 (a classical result). The DR Code, however, additionally fixes the within-class identity (A0 vs. A1 vs. A2), multiplying the 12 ‘class-Latin’ patterns by (3!)3 = 216 to give 2592—precisely the count we obtain by direct enumeration. This combinatorial perspective offers an alternative proof of Theorem 2 (Section 4) and connects DR Code analysis to the rich algebraic-combinatorial literature.

3. Problem Formulation

Let the nine logical blocks be denoted by the set
Σ = {A0, A1, A2, B0, B1, B2, C0, C1, C2}
partitioned into three classes: A = {A0, A1, A2}, B = {B0, B1, B2}, and C = {C0, C1, C2}. The class of a block s ∈ Σ is denoted cls(s) ∈ {A, B, C}. A DR Code template is a bijection π: {0, 1, 2} × {0, 1, 2} → Σ assigning each cell of a 3 × 3 grid to a distinct logical block.
The XOR parity ties the blocks that share an index into three recovery groups G0 = {A0, B0, C0}, G1 = {A1, B1, C1}, and G2 = {A2, B2, C2}, where the parity block satisfies Ci = AiBi. Each recovery group is a RAID-5 triple: any one of its blocks equals the XOR of the other two (Ai = BiCi, Bi = AiCi, Ci = AiBi). The letters A, B, C label only the role of a block—first-half data, second-half data, and parity—whereas it is the recovery-group index that governs reconstruction.
Definition 1 (Recoverability).
A template π is recoverable if for every row r ∈ {0, 1, 2} and every column c ∈ {0, 1, 2}, the three cells in that row (resp. column) contain exactly one block from each recovery group G0, G1, G2—equivalently, the three recovery-group indices appearing in the line are pairwise distinct.
Equivalently, the multiset of recovery-group indices along every row and every column equals {0, 1, 2}, each index occurring with multiplicity one.
Recoverability ensures that if any single row or column is lost (six cases in total, see Figure 2), each recovery group loses exactly one of its three members and therefore retains two, allowing the missing block of every group to be reconstructed via the XOR identities Ci = AiBi, Ai = BiCi, and Bi = AiCi for i = 0, 1, 2.
Theorem 1 (Strip recovery).
A template is recoverable in the sense of Definition 1 if and only if every one of the six single-strip losses—any one of the three rows or three columns—can be fully reconstructed by XOR.
Proof (Sufficiency). 
Suppose each line carries one block from each recovery group. Erasing a row or column then removes exactly one member from each of G0, G1, G2, leaving two survivors in every group. Because any block of a recovery group is the XOR of the other two, each erased block is recovered from its two surviving groupmates; for instance, the strip {A2, B1, C0} is repaired by A2 = B2 ⊕ C2, B1 = A1 ⊕ C1, and C0 = A0 ⊕ B0. Since the six strip-losses are precisely the three rows and three columns, all are repaired. (Necessity.) Conversely, if some line contained two blocks of a single recovery group Gi, then erasing that line would delete two of Gi’s three members, leaving one survivor and two unknowns related by the single equation Ci = Ai ⊕ Bi; one equation cannot determine two unknowns over the data alphabet, so that strip is unrecoverable. Thus, the one-block-per-group condition is both necessary and sufficient. □
The design insight of the DR Code is exactly this bridge. Recovering an entire index group from its parity is the elementary RAID-5 fact; the contribution is the placement: arranging the nine blocks so that no line repeats a recovery-group index spreads every row- or column-strip across the three groups one block at a time, turning a single geometric strip-loss into three independent, always-solvable RAID-5 recoveries.

4. Exhaustive Enumeration of Recoverable Templates

4.1. Enumeration Algorithm

We enumerate all 9! = 362,880 bijections π: {0, 1, 2}2 → Σ and test each for recoverability by checking the three row constraints and three column constraints. The algorithm is given in pseudocode as Algorithm 1, and a fully executable Python (3.12.8) implementation, DR15.py, has been released on GitHub [29].
Algorithm 1: DR Code Pattern Enumerator
Input: the nine logical blocks Σ = {A0,…,C2} with class function cls(·)
Output: the set V of all recoverable templates
1. V ←
2. for each permutation r = (r0,…,r8) of {0,…,8} do
3. template π ← place block index ri at cell (i mod 3, i/3)
4. valid ← true
5. for each of the three rows and three columns L do
6. if {cls(π(L1)), cls(π(L2)), cls(π(L3))} ≠ {A,B,C} then
7. valid ← false; break
8. if valid then V ← V {π}
9. return V
On a commodity 2024 laptop the program completes in approximately 1.4 s. Although the search space is the full 9! = 362,880 permutations, each recoverability test is a constant-cost check of six lines, so the enumeration is O(9!) with a tiny constant and finishes in under two seconds. For this fixed 3 × 3 instance, an exhaustive search is therefore both tractable and exhaustive by construction, which is why we prefer it to a more elaborate constructive generator; for the n × n variants of Section 8.6, where the space grows to (n2)!, the constructive Latin-square decomposition |Vn| = L(n)·(n!)n would be used instead.

4.2. Result

Theorem 2 (Cardinality of V).
There are exactly 2592 recoverable DR Code templates on a 3 × 3 grid.
Proof. 
Reading off only the recovery group (G0, G1, or G2) of the block placed in each cell turns a template π into a 3 × 3 array over {G0, G1, G2}. Recoverability (Definition 1) states exactly that every row and every column of this array contain each of the three groups once; that is, the recovery-group array is a Latin square of order 3. There are precisely 12 Latin squares of order 3 (OEIS A002860). Conversely, given such an array each recovery group occupies three cells—one in each row and one in each column—and its three blocks Ai, Bi, Ci may be assigned to those cells in 3! = 6 ways, independently across the three groups, for (3!)3 = 216 assignments. Distinct recovery-group arrays yield disjoint sets of templates, and every template has exactly one such array, so the map (recovery-group array, within-group assignment) ↦ template is a bijection. Therefore |V| = 12 × 216 = 2592, matching the exhaustive enumeration produced by DR15.py. □
Table 1 gives the breakdown by partial constraint.
Remark 1 (a hidden duality).
Each block carries two coordinates: its role letter (A, B, C) and its recovery-group index (0, 1, 2). Definition 1 constrains the index coordinate. Constraining the role coordinate instead—demanding one A-, one B-, and one C-block per line—defines an isomorphic object: swapping the two coordinates is a bijection between the two families that commutes with every geometric symmetry, so it too yields exactly 2592 templates with the identical orbit structure. This explains why a purely role-based (class) count reproduces the same 2592. The two constraints coincide precisely on the templates that are Latin in both coordinates, i.e., the order-3 Graeco-Latin (Euler) squares; there are exactly 72 of these, and the symmetry group G of Section 6 acts on them simply transitively—a single free orbit of size |G| = 72. The recoverable set is thus a natural enlargement of the classical Graeco-Latin squares, which reappear as the locus where role structure and recovery structure align.

5. Structural Symmetry Theorems

In this section, we identify five geometric transformations that map any recoverable template to another recoverable template. Each is proved by a short argument that exploits the symmetric role of rows and columns in the recoverability condition.

5.1. Mirror Reflection

Theorem 3 (Mirror Reflection). 
Let X be a recoverable template and let X′ be the template obtained by reflecting X about the vertical axis (left ↔ right). Then, X′ is also recoverable (see Figure 3).
Proof. 
The reflection permutes the three columns by the order (0, 1, 2) → (2, 1, 0); rows are unchanged. The set of cells in any given row is preserved; hence, the row-class-multiset is preserved. The set of cells in column c becomes the set of cells in column (2−c), which is itself one of the three original columns; hence, column-class-multisets are merely permuted, not altered. Both row and column conditions therefore hold for X′. □

5.2. Vertical Flip

Theorem 4 (Vertical Flip). 
Let X be a recoverable template and let X′ be the template obtained by flipping X about the horizontal axis (top ↔ bottom). Then, X′ is also recoverable.
Proof. 
Symmetric to Theorem 3, with rows and columns interchanged (see Figure 4). □

5.3. Tetris Rotation

Theorem 5 (Tetris Rotation). 
Let X be a recoverable template and let X′k for k ∈ {1, 2, 3} be the template obtained by rotating X clockwise by 90°·k (Tetris-style rotation). Then, each X′k is recoverable (see Figure 5 for the four equivalent patterns).
Proof. 
A 90° clockwise rotation maps the i-th row of X to the (2−i)-th column of X′1 and the j-th column of X to the j-th row of X′1. The recoverability condition, being symmetric in rows and columns, is therefore preserved. The 180° and 270° rotations follow by composition. □

5.4. Cyclic Column Rotation

Theorem 6 (Cyclic Column Rotation). 
Let X be a recoverable template and let X′ be the template obtained by cyclically rotating the columns one step to the right, i.e., column 0 moves to position 1, column 1 to position 2, and column 2 to position 0. Then, X′ is recoverable. The same conclusion holds for two-step rotation. (Three-step rotation returns the original template, and left rotation is equivalent to two-step right rotation.)
Proof. 
Cyclic column rotation permutes the three column indices as a three-cycle. Each row of X′ is a re-ordering of the same three cells of X, so its class-multiset is unchanged—still {A, B, C}. Each column of X′ is identical (as a set of three cells) to one of the original columns of X, so column class-multisets are merely permuted. Both conditions hold. □

5.5. Cyclic Row Rotation

Theorem 7 (Cyclic Row Rotation). 
Let X be a recoverable template and let X′ be the template obtained by cyclically rotating the rows one step downward. Then, X′ is recoverable; analogously for two-step rotation.
Proof. 
Symmetric to Theorem 6 (see Figure 6). □

6. Group Structure and Equivalence Classes

Theorems 2–6 yield five generators of a transformation group acting on the 2592 recoverable templates. We now characterize the closure of these generators.

6.1. The Symmetry Group G

Let σ_M, σ_F, σ_R, σ_C, σ_W denote the actions of Mirror, Flip, 90° Rotation, right column-rotation, and downward row-rotation, respectively. Let G be the group generated by these five elements under composition.

Group Structure

Theorem 8 (Group Structure).
G ≅ (C3 × C3) ⋊ D4, hence |G| = 72.
Proof. 
The Mirror, Flip, and 90° Rotation generators σ_M, σ_F, σ_R produce the dihedral group D4 of square symmetries of order 8. The cyclic column-rotation σ_C generates a subgroup C3 (order 3), and similarly σ_W generates a C3. We prove the four structural claims that together establish the isomorphism, organizing the argument around the two families of generators. (1) The geometric complement: The generators σ_M, σ_F, σ_R satisfy the defining relations of the symmetry group of a square—two reflections of order 2 and a four-fold rotation σ_R with σ_R σ_M σ_R−1 a reflection—so the subgroup D4 = ⟨σ_M, σ_F, σ_R⟩ they generate is dihedral of order 8. (2) The cyclic kernel: The column-cycle σ_C and the row-cycle σ_W each have order 3, and they commute because shifting the three rows and shifting the three columns are independent operations on the grid; hence, N = ⟨σ_C, σ_W⟩ ≅ C3 × C3 has order 9. We write N additively as (ℤ/3)2 with ordered basis (σ_W, σ_C). (3) N is normal in G. It suffices to verify that each generator of G carries each generator of N back into N under conjugation. Direct computation on the nine grid cells gives σ_M σ_W σ_M−1 = σ_W and σ_M σ_C σ_M−1 = σ_C−1; σ_F σ_W σ_F−1 = σ_W−1 and σ_F σ_C σ_F−1 = σ_C; and σ_R σ_W σ_R−1 = σ_C−1 and σ_R σ_C σ_R−1 = σ_W. Every conjugate lies in N, so g N g−1 = N for each generator g and therefore for all g ∈ G. Hence, N is normal in G. (By contrast, D4 is not normal: σ_C σ_R σ_C−1 ∉ D4.) (4) Trivial intersection and product cover: Every non-identity element of N is a non-zero cyclic translation σ_W^i σ_C^j of the rows and/or columns and therefore fixes no cell of the grid, whereas every element of D4 fixes the center cell (1,1). Consequently D4 ∩ N = {1}. The 9·8 = 72 products n·d with n ∈ N, d ∈ D4 are thus pairwise distinct; they all lie in G, and since N and D4 together generate G, we obtain G = N·D4 and |G| = |N|·|D4| = 72. (5) Semi-direct, not direct: Claims (3) and (4) are exactly the hypotheses of the internal semi-direct-product theorem, so G = N ⋊ D4 with N = C3 × C3 the normal factor and D4 a complement. The associated structure homomorphism φ: D4 → Aut(N) = GL(2, GF(3)) is given in the basis (σ_W, σ_C) by φ(σ_M) = diag(1, −1), φ(σ_F) = diag(−1, 1), and φ(σ_R) = (0, 1; −1, 0). This homomorphism has a trivial kernel, so D4 acts faithfully and non-trivially on N; in particular, φ(σ_R) interchanges the two cyclic factors (σ_W ↦ σ_C−1, σ_C ↦ σ_W), so σ_R does not commute with σ_W. The action being non-trivial, G is not the direct product D4 × C3 × C3; it is the semi-direct product G ≅ (C3 × C3) ⋊ D4 of order 72. All conjugation identities above, the order |G| = 72, the relation D4 ∩ N = {1}, and the faithfulness of φ were independently confirmed by breadth-first closure of the five generators acting on the nine grid cells (script verify_2d_group.py) and are equally reproducible in standard computer-algebra systems such as GAP or SageMath. □
Remark 2 (orbit counts are unaffected by this correction).
The equivalence-class counts reported throughout this paper—36 classes under the full group G, 324 under the geometric subgroup D4 alone, and 288 under the cyclic subgroup C3 × C3—follow from the orbit–stabilizer theorem and depend only on the group order |G| = 72 and on how G acts on the 2592 templates, not on whether G is realized as the direct product D4 × C3 × C3 or the semi-direct product (C3 × C3) ⋊ D4. Correcting the internal structure therefore leaves every orbit count in the paper intact.
(The full presentation is G = ⟨σ_M, σ_F, σ_R, σ_C, σ_W | σ_R4 = σ_M2 = σ_F2 = σ_C3 = σ_W3 = 1, σ_R σ_M σ_R = σ_F σ_M, σ_C σ_W = σ_W σ_C, σ_R σ_C σ_R−1 = σ_W, …⟩; we omit the full relations as they are not needed for the orbit analysis below.) The five generators are summarized in Table 2.

6.2. Orbit Analysis

Equivalence Classes

Theorem 9 (Equivalence Classes).
The Action of G on V Partitions the 2592 Recoverable Templates into Exactly 36 Orbits, Each of Size 72.
Proof. 
By computer-checked exhaustive computation: starting from any template t ∈ V, the orbit G·t under the five generators has size exactly 72, and 2592/72 = 36. We verified this for each of the 36 distinct orbits independently (see Figure 7 for the hierarchy of equivalence classes). The orbit sizes and equivalence-class counts under various subgroups of G are summarized in Table 3. □

6.3. Practitioner-Friendly D4 View

This subsection restates the orbit results of Section 6.2 from a deployment-oriented standpoint and introduces no new theorem; We keep it adjacent to the orbit analysis it draws on, but a reader interested only in the formal development may proceed directly to Section 6.4
Although the absolute equivalence-class count under the full group G is 36, in many practical settings the column- and row-cyclic rotations are perceived as distinct templates (they shift visible block positions, which a human-printed barcode reader actually sees as physically different). We therefore highlight the D4-only quotient, which yields 324 visually distinguishable atomic patterns. Each such atom expands into exactly eight D4-orientations and, under cyclic reshuffling, into a further nine pseudo-orientations—matching the 1 + 1 +3 + 2 + 2 = 8 ‘extra recoverable patterns per starting pattern’ intuition first formulated when the project was conceived.

6.4. Why the Semi-Direct Product Structure?

The fact that G is the semi-direct product (C3 × C3) ⋊ D4 rather than the direct product D4 × C3 × C3 deserves comment. Geometrically, the dihedral component D4 acts on the global orientation of the 3 × 3 grid (which way is up, which way is left), whereas the two cyclic components C3 × C3 act on the cyclic labeling of the rows and of the columns. These two kinds of operation do not commute: a 90° rotation of the grid turns a row-shift into a column-shift (σ_R σ_W σ_R−1 = σ_C−1), so the dihedral action permutes the two cyclic factors rather than fixing them. This is exactly why the closure is a semi-direct product and not a direct product. What survives—and what makes the canonical-form encoding of Section 7 tractable—is unique factorization: in any internal semi-direct product every element g ∈ G is uniquely g = n·d with n ∈ C3 × C3 and d ∈ D4. One therefore stores a template as its 6-bit orbit index together with this pair: 4 bits for the cyclic factor n (one of 9) and 3 bits for the dihedral factor d (one of 8). The non-commutativity affects only how two such pairs are composed—the d-part twists the n-part through the structure homomorphism φ of Theorem 8—and does not obstruct storage, because the factorization of a single element is still unique.

6.5. Verification by Burnside’s Lemma

As an independent confirmation of Theorem 9 (which we proved by direct enumeration), we apply Burnside’s lemma. The number of orbits |V/G| equals the average number of templates fixed by each element of G:
|V/G| = (1/|G|) × Σ_{g ∈ G} |Fix(g)|
For every non-identity g ∈ G we have |Fix(g)| = 0 on V, and this can be seen directly rather than only computationally. The group G acts faithfully on the nine cells: each element is a distinct permutation of the grid, so a non-identity g moves at least one cell, i.e., g−1 carries some cell c to a different cell c′ ≠ c. A template π fixed by g satisfies π = π ∘ g−1, which forces π(c) = π(c′), but a template is a bijection and must assign distinct blocks to the distinct cells c and c′, a contradiction. Hence, no non-identity element of G fixes any recoverable template. (Concretely, invariance under the mirror reflection would require the blocks in cells (0, 0) and (2, 0) to coincide, which is impossible.) The identity element fixes all 2592 templates, so |V/G| = (1/72) · (2592 + 0 + … + 0) = 2592/72 = 36, in agreement with Theorem 9. The same observation pins down the orbit sizes: every stabilizer Stab(π) is trivial, so by the orbit–stabilizer theorem |orbit(π)| = |G|/|Stab(π)| = 72/1 = 72. The action of G on V is therefore free, and the 2592 templates split into exactly 2592/72 = 36 orbits, each of the full size 72.

7. Practical Applications of the Symmetry Framework

7.1. Compact Equivalence-Class Encoding

A naïve encoding of one DR Code template stores the assignment of each of the nine cells, requiring at least ⌈9·log2(9)⌉ = 29 bits or, in byte-aligned form, 9 bytes. It is worth distinguishing two naive baselines: storing each cell independently costs 9·⌈log2 9⌉ = 36 bits, whereas storing a bare permutation index of the nine blocks costs ⌈log2 9!⌉ = 19 bits. Our canonical encoding improves on both, reaching 13 bits. We propose a 13-bit encoding that exploits Theorem 9.

Encoding Scheme

Encoding B (full canonical form): (i) Maintain a static, globally agreed table of 36 canonical templates, indexed 0–35 (6 bits). (ii) For each stored template t, record (a) the index of its orbit in this table, and (b) the index 0–71 (7 bits) of the unique element g ∈ G such that g·canonical = t. Decoding recovers t in constant time by applying g to the canonical pattern.
Total: 6 + 7 = 13 bits per template. An equivalent Encoding A (class pattern plus within-class permutations) reaches the same 13 bits by a different route: one stores the class-pattern index—one of the 12 Latin squares of order 3 (OEIS A002860), requiring ⌈log2 12⌉ = 4 bits—together with three independent within-class permutations of the three positions in each class (3! = 6 arrangements each, ⌈log2 6⌉ = 3 bits), for a total of 4 + 3 × 3 = 13 bits. The two encodings coincide exactly at 13 bits, which we therefore adopt as the canonical storage figure. A separate practitioner-friendly variant quotients only by the geometric subgroup D4, storing the 9-bit index of one of the 324 D4-atoms plus 3 bits for the orientation (9 + 3 = 12 bits); this is one bit smaller but deduplicates far less aggressively (324 rather than 36 equivalence classes). Measured against the 36-bit naïve grid storage, the 13-bit canonical encoding is a 36/13 ≈ 2.8 × reduction (Figure 8).

7.2. Constant-Time Validity Oracle

Given an arbitrary permutation π of the nine logical blocks, deciding whether π is a recoverable DR Code template by the naïve algorithm requires six row/column checks—approximately 6·3 = 18 elementary class-equality comparisons. We propose a faster oracle:

Oracle Algorithm

(i) Compute the canonical form of π by applying every g ∈ G and selecting the lexicographically smallest result (this is a constant-cost operation since |G| = 72 is fixed). (ii) Check membership of the canonical form in a precomputed hash set of the 36 atomic canonicals. The whole procedure runs in O(1) time, but the constant is not negligible: step (i) applies all |G| = 72 group elements, so for a single isolated query the direct six-constraint test (about 18 class comparisons) is in fact cheaper. The oracle earns its place differently—it returns, as a by-product, the canonical form required for deduplication and equivalence-class indexing, so its cost is amortized whenever canonicalization is needed anyway or the same template is validated repeatedly.
This oracle is useful in DR Code encoder/decoder firmware where validation may be invoked many times per scan.

7.3. Randomized DR Code for Anti-Cloning Security

Counterfeiters routinely photograph genuine product barcodes and reprint them on counterfeit goods. We propose a defense that exploits the 2592-pattern repertoire: the manufacturer chooses, per production batch, a random recoverable template T ∈ V, encodes the product information using T, and stores the index of T in a backend database. Quantitatively, the choice of T hides genuine entropy from a counterfeiter: the full repertoire supplies log2 2592 ≈ 11.3 bits, and even after an attacker observes one authentic code, the 72 templates equivalent to it under G remain visually plausible substitutes, i.e., log2 72 ≈ 6.2 bits of residual uncertainty per code. Cloning therefore succeeds only with the exact template actually printed, which a per-batch random draw keeps secret. A genuine scanner first decodes the visible pattern, computes its canonical form, and queries the database to confirm that the canonical form was issued for that product. A counterfeiter who simply reprints a photographed code will produce a code with a particular T, but the database can detect duplicate scans of the same (product, T) tuple from different geographies, signaling a clone. Because there are 2592 patterns visually similar to the human eye but logically distinct, randomly choosing one per batch costs nothing in encoder complexity and reveals duplication. The storage savings of all encoding strategies considered in this paper are summarized in Table 4.

7.4. Empirical Validation

All theorems, group orders, and equivalence-class counts in this paper were verified by exhaustive computer search on the full set of 2592 templates. Table 5 reports the empirical results for each transformation.

8. Discussion and Applications

8.1. Cloud and Embedded Storage

Modern cloud archival systems and IoT/embedded devices increasingly use 2D barcodes for asset tagging, equipment inventory, and pharmaceutical track-and-trace. Storing one byte per asset’s barcode template times millions of assets adds up. The 13-bit encoding proposed in Section 7.1 reduces a 36-bit naïve template to 13 bits—a saving of 23 bits per asset, or about 2.9 MB per million assets. While modest, the saving compounds when DR Code is embedded in low-power passive RFID tags whose memory is severely constrained (typically 96–512 bits per tag).

8.2. Memory-Cache Locality

The 36 canonical templates, when stored as 6-bit indices, fit comfortably in the L1 cache of any modern processor. A scanner firmware that performs millions of validity checks per second, therefore, benefits not only from the algorithmic O(1) of the oracle but also from cache-resident lookup—a non-trivial advantage on energy-constrained handheld scanners.

8.3. Limitations

Three limitations bound the contribution of this paper. First, the analysis is specific to 3 × 3 DR Code; the same group-theoretic technique applies to larger DR Code variants (n × n grids with n classes), but the orbit count and group order will differ and require re-derivation. Second, our enumeration assumes that the C blocks are deterministically computed from A and B; if the encoder permits parity placement to be independent of data placement, the count will change. Third, the security claim in Section 7.3 assumes an honest scanner with database connectivity; an offline scanner cannot perform the duplicate-detection step.

8.4. Comparison with QR Code Recovery Geometry

Sriphum’s original DR Code paper [1] reported that an H-level QR Code recovers 30% of damaged data in only two geometric cases—center-circle damage and upper-row damage. The DR Code, by contrast, handles six strip-loss cases at a 33% recovery rate. Our equivalence-class analysis adds a new dimension to this advantage: a manufacturer who must produce thousands of distinct yet recoverable barcodes (for example, for a serial-number scheme that should not be visually predictable) has 2592 templates to choose from for DR Code, of which 36 are absolutely distinct up to symmetry. QR Code, in contrast, has a unique template per error-correction level by construction. Thus, DR Code offers strictly more design freedom, which the present work makes mathematically precise. Foundational treatments of Reed–Solomon codes [16,17] and error-control coding [20] provide the algebraic backbone of QR error correction, while recent QR-code processing work—including pattern recognition methods [21,22], mobile-phone decoding [14,15], detection in arbitrary images [11], and high-capacity color extensions [13]—confirms the maturity of QR Code as a standardized format. DR Code’s template pluralism, by contrast, opens up a new design axis that the symmetry analysis in this paper has made mathematically precise for the first time. Table 6 summarizes the key quantitative and qualitative differences between QR Code and DR Code, highlighting the new equivalence-class results contributed by this paper.

8.5. Implementation Notes for DR15.py

The reference implementation DR15.py is approximately 130 lines of Python and uses only the standard-library itertools.permutations function. The performance bottleneck is not the validity test (six O(1) class-checks per permutation) but the iteration overhead of the 362,880 permutations themselves. A C++ port using nested loops with early termination—essentially, the original C++ source code from which DR15.py was translated—runs in under 0.3 s on the same hardware. We chose Python for the released version to maximize reproducibility: any reader with a stock Python install can verify our claims in seconds without installing a compiler. The repository [29] also includes the analysis scripts that generated Table 1, Table 2, Table 3 and Table 4 and Figure 7 and Figure 8 of this paper, encouraging readers to extend the work to non-standard DR Code variants.

8.6. Future Work

We plan to extend the analysis along three directions. First, we will study larger DR Code variants (4 × 4 with four classes A, B, C, D where Di = Ai ⊕ Bi ⊕ Ci; or 5 × 5 with five classes) to determine how the equivalence-class count scales—initial estimates suggest it grows super-exponentially. Second, we will explore DR Code over non-binary alphabets where the parity is computed in GF(2ᵏ) rather than via a single XOR; this opens up the possibility of multi-bit-per-cell DR Codes with correspondingly higher data density. Third, we will investigate hybrid DR/QR codes that combine strip-recovery (DR style) with random-bit-error correction (QR style) under a unified group-theoretic framework. Finally, we will conduct a user study comparing scanner robustness when the same DR Code data is encoded into different equivalence-class representatives, testing the hypothesis that some atomic templates have intrinsically more legible visual signatures than others.

9. Conclusions

This paper presented a complete symmetry-theoretic and combinatorial analysis of the recoverable templates of the DR Code originally proposed by Sriphum [1]. By identifying the natural group of transformations that preserve the row/column class-uniqueness constraint, we converted what had been a single ad hoc design into the orbit space of an explicit order-72 group action, whose recoverable templates then become fully enumerable and classifiable. We released an open-source enumerator (DR15.py) certifying that exactly 2592 recoverable templates exist, and we proved that five natural symmetry transformations—Mirror, Flip, Tetris-Rotation, column-cyclic rotation, and row-cyclic rotation—generate a group G ≅ (C3 × C3) ⋊ D4 of order 72 acting faithfully on these templates. Under G, the 2592 templates partition into exactly 36 absolute equivalence classes; under the practitioner-relevant subgroup D4 alone, they partition into 324 visually distinguishable atoms. Exploiting this orbit structure, we designed (i) a 13-bit canonical encoding (a 2.8× saving over naïve cell-by-cell storage), (ii) an O(1) validity oracle based on canonical-form lookup, and (iii) a randomized anti-cloning protocol for security-aware barcode applications. All claims were independently verified by exhaustive computation, and an additional check using Burnside’s lemma confirms the 36-orbit count.
The decomposition G ≅ (C3 × C3) ⋊ D4 is itself a structural finding that illustrates how geometric symmetries (D4) and combinatorial symmetries (C3 × C3) can combine cleanly to organize a constrained pattern space. The dihedral component captures the eight orientation-preserving and orientation-reversing isometries of the 3 × 3 grid, while the two cyclic factors encode the row- and column-translation symmetries that are unique to the DR Code recoverability constraint. Crucially, the structure is a semi-direct rather than a direct product: the geometric and combinatorial symmetries do not commute, because a 90° rotation interchanges the row- and column-cyclic shifts. What makes the canonical-form encoding of Section 7.1 tractable is not commutativity but the unique factorization that every internal semi-direct product enjoys—each group element is uniquely a product of a normal cyclic part and a dihedral part. This observation is, to our knowledge, the first explicit application of finite-group orbit decomposition to a barcode-recovery structure, and it suggests that similar symmetry-based analyses may yield analogous compressions and oracles for other constrained codes—for instance, Latin-square-based and frequency-square-based codes that admit row/column permutation symmetries of similar flavor.
The work bridges two communities. For the practical 2D-barcode community, it provides a precise, symmetry-aware library of 36 atomic templates from which industrial deployments can draw without ambiguity, together with a principled encoding that reduces template storage to the information-theoretic minimum dictated by the group action. For the algebraic-combinatorics community, the numbers 2592/72/36/324 offer a small but instructive example of a finite group acting on a constrained Latin-square relative, with a clean semi-direct-product structure and a fully computable orbit decomposition. These results make the symmetry framework central to the manuscript’s narrative rather than incidental, situating this paper within the scope of Symmetry as a self-contained case study of how group-theoretic methods illuminate constrained combinatorial structures arising from real-world engineering problems.
Several directions remain open. First, the same orbit-theoretic methodology should extend to larger DR Code variants (n × n grids with n classes), where the symmetry group becomes the semi-direct product (Cn × Cn) ⋊ D4. By the same mechanism as in the 3 × 3 case, the geometric factor D4 is unchanged (every n × n square grid retains the eight square symmetries), while the cyclic factors grow to Cn × Cn; a 90° rotation again interchanges the row- and column-cyclic shifts, so the action is non-trivial, the product is semi-direct rather than direct, and the orbit count is expected to grow super-exponentially. We state the structural generalization as conjecture: for every n ≥ 3 the recoverability group is the semi-direct product (Cn × Cn) ⋊ D4 of order 8n2, generated by the same five transformations. The template count itself is provable by the argument of Theorem 2, giving |Vn| = L(n)·(n!)n, where L(n) is the number of Latin squares of order n (OEIS A002860); this yields 8, 2592, and 191,102,976 recoverable templates for n = 2, 3, 4. We verified the group order |G| = 8n2 by breadth-first closure of the five generators for n = 3, 4, 5, 6, obtaining exactly 72, 128, 200, and 288, consistent with the conjecture; the case n = 2 is degenerate, the cyclic factor C2 collapsing into D4 to give |G| = 8. Second, non-binary parity—computed in GF(2ᵏ) rather than via a single XOR—opens the door to multi-bit-per-cell DR Codes whose symmetry structure is presently unknown. Third, hybrid DR/QR codes that combine strip-recovery with random-bit-error correction would benefit from a unified group-theoretic treatment that we have not attempted here. We hope that the symmetry perspective developed in this paper will catalyze such extensions.

10. Patents

The authors declare that no patents related to the content of this article have been applied for or granted.

Author Contributions

Algorithm design, T.C.; software (implementation of the experiments), W.S. and T.C.; analysis and interpretation of the experimental results, W.S. and T.C. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by Mahasarakham University.

Data Availability Statement

The data and programs used in this research can be downloaded at https://github.com/thawatchai2799/2D_DR_Code_20260606_0141 (accessed on 13 July 2026).

Acknowledgments

The authors would like to thank Suwichai Phunsa and Preecha Noiumkar for reviewing the manuscript and suggesting points for improvement, and the Faculty of Informatics, Mahasarakham University, for its continued support.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Sriphum, W. DR Code: The Two Dimensions Barcode Supporting High Rate Data Recovery. In Proceedings of the IEEE 16th International Conference on Computational Science and Engineering (CSE), Sydney, Australia, 3–5 December 2013; pp. 1214–1219. [Google Scholar] [CrossRef]
  2. Soon, T.J. QR Code. Synth. J. 2008, 59–78. [Google Scholar]
  3. Li, L.; Qiu, J.; Lu, J.; Chang, C.-C. An aesthetic QR code solution based on error correction mechanism. J. Syst. Softw. 2016, 116, 85–94. [Google Scholar] [CrossRef]
  4. ISO/IEC 18004:2015; Information Technology—Automatic Identification and Data Capture Techniques—QR Code Bar Code Symbology Specification. International Organization for Standardization: Geneva, Switzerland, 2015.
  5. Wikipedia, MaxiCode. Available online: https://en.wikipedia.org/wiki/MaxiCode (accessed on 13 July 2026).
  6. RACO Industries. QR Code Barcode Generator, 2013. Available online: https://www.barcodesinc.com/generator/qr/ (accessed on 13 July 2026).
  7. Parikh, D.; Jancke, G. Localization and Segmentation of a 2D High Capacity Color Barcode. In Proceedings of the IEEE Workshop on Applications of Computer Vision (WACV), Copper Mountain, CO, USA, 7–9 January 2008; pp. 1–6. [Google Scholar]
  8. Bulan, O.; Monga, V.; Sharma, G. High capacity color barcodes using dot orientation and color separability. In Proceedings of the SPIE Media Forensics Security XI, San Jose, CA, USA, 18–22 January 2009; Volume 7254, pp. 725417-1–725417-7. [Google Scholar]
  9. Fang, Y.; Peng, Y. The design and implementation of two-dimensional barcode identification in smartphone. In Proceedings of the Internation Conference on Computer Application and System Modeling (ICCASM), Taiyuan, China, 22–24 October 2010; Volume 7. [Google Scholar]
  10. Tan, A.K.T.; Chai, D. Improving mobile color 2D-barcode JPEG image readability using DCT coefficient distributions. In Proceedings of the International Conference on Audio, Language and Image Processing (ICALIP), Shanghai, China, 16–18 July 2012. [Google Scholar]
  11. Belussi, L.F.F.; Hirata, N.S.T. Fast QR code detection in arbitrarily acquired images. In Proceedings of the SIBGRAPI, Alagoas, Brazil, 28–31 August 2011; pp. 281–288. [Google Scholar]
  12. Querini, M.; Grillo, A.; Lentini, A.; Italiano, G.F. 2D color barcodes for mobile phones. Int. J. Comput. Sci. Appl. 2011, 8, 136–155. [Google Scholar]
  13. Yang, Z.; Xu, H.; Deng, J.; Loy, C.C.; Lau, W.C. Robust and fast decoding of high-capacity color QR codes for mobile applications. IEEE Trans. Image Process. 2018, 27, 6093–6108. [Google Scholar] [CrossRef]
  14. Falas, T.; Kashani, H. Two-dimensional bar-code decoding with camera-equipped mobile phones. In Proceedings of the IEEE International Conference on Pervasive Computing and Communications Workshops, White Plains, NY, USA, 19–23 March 2007; pp. 597–600. [Google Scholar]
  15. Kato, H.; Tan, K.T. Pervasive 2D Barcodes for Camera Phone Applications. IEEE Pervasive Comput. 2007, 6, 76–85. [Google Scholar] [CrossRef]
  16. Reed, I.S.; Solomon, G. Polynomial codes over certain finite fields. J. Soc. Ind. Appl. Math. 1960, 8, 300–304. [Google Scholar] [CrossRef]
  17. Wicker, S.B.; Bhargava, V.K. Reed–Solomon Codes and Their Applications; Wiley-IEEE Press: Hoboken, NJ, USA, 1994. [Google Scholar]
  18. Patterson, D.A.; Gibson, G.; Katz, R.H. A case for redundant arrays of inexpensive disks (RAID). In Proceedings of the ACM SIGMOD, Chicago, IL, USA, 1–3 June 1988; pp. 109–116. [Google Scholar]
  19. Chen, P.M.; Lee, E.K.; Gibson, G.A.; Katz, R.H.; Patterson, D.A. RAID: High-performance, reliable secondary storage. ACM Comput. Surv. 1994, 26, 145–185. [Google Scholar] [CrossRef]
  20. Moreira, J.C.; Farrell, P.G. Essentials of Error-Control Coding; Wiley: Chichester, UK, 2006. [Google Scholar]
  21. Hou, A.-L.; Yaun, F.; Ying, G. QR code image detection using run-length coding. In Proceedings of the International Conference on Computer Science and Network Technology (ICCSNT), Harbin, China, 24–26 December 2011; Volume 4, pp. 2130–2134. [Google Scholar]
  22. Sun, M.; Fang, Z.; Fu, L.; Zhao, F. Identification of QR Codes Based on Pattern Recognition. In Proceedings of the World Automation Congress (WAC), Kobe, Japan, 19–23 September 2010; pp. 397–401. [Google Scholar]
  23. Armstrong, M.A. Groups and Symmetry; Springer: New York, NY, USA, 1988. [Google Scholar]
  24. Rotman, J.J. An Introduction to the Theory of Groups, 4th ed.; Springer: New York, NY, USA, 1995. [Google Scholar]
  25. Cameron, P.J. Permutation Groups. In London Mathematical Society Student Texts; Cambridge University Press: Cambridge, UK, 1999; Volume 45. [Google Scholar]
  26. Stanley, R.P. Enumerative Combinatorics, 2nd ed.; Cambridge University Press: Cambridge, UK, 2011; Volume 1. [Google Scholar]
  27. Pólya, G.; Read, R.C. Combinatorial Enumeration of Groups, Graphs, and Chemical Compounds; Springer: New York, NY, USA, 1987. [Google Scholar]
  28. McKay, B.D.; Wanless, I.M. On the number of Latin squares. Ann. Comb. 2005, 9, 335–344. [Google Scholar] [CrossRef]
  29. Chomsiri, T.; Sriphum, W. DR15.py: Open-Source Enumerator of Recoverable DR Code Templates, GitHub Repository. 2025. Available online: https://github.com/thawatchai2799/2D_DR_Code_20260606_0141.git (accessed on 13 July 2026).
Figure 1. The original recoverable DR Code template proposed by Sriphum [1]. Each row and each column carry one block of each recovery group G0, G1, G2. Cells are colored by role (A = blue, B = red, C = green); it is the recovery-group index, not the role color, that is non-repeating along every line.
Figure 1. The original recoverable DR Code template proposed by Sriphum [1]. Each row and each column carry one block of each recovery group G0, G1, G2. Cells are colored by role (A = blue, B = red, C = green); it is the recovery-group index, not the role color, that is non-repeating along every line.
Symmetry 18 01255 g001
Figure 2. The six damage cases handled by every recoverable DR Code template: any single row or column loss is reparable via XOR. Colors denote the three logical classes: A (blue), B (red), and C (green); gray cells indicate the lost strip.
Figure 2. The six damage cases handled by every recoverable DR Code template: any single row or column loss is reparable via XOR. Colors denote the three logical classes: A (blue), B (red), and C (green); gray cells indicate the lost strip.
Symmetry 18 01255 g002
Figure 3. Mirror reflection theorem: reflecting a recoverable template about the vertical axis yields another recoverable template. A (blue), B (red), and C (green).
Figure 3. Mirror reflection theorem: reflecting a recoverable template about the vertical axis yields another recoverable template. A (blue), B (red), and C (green).
Symmetry 18 01255 g003
Figure 4. Vertical flip theorem: flipping top-to-bottom yields another recoverable template. A (blue), B (red), and C (green).
Figure 4. Vertical flip theorem: flipping top-to-bottom yields another recoverable template. A (blue), B (red), and C (green).
Symmetry 18 01255 g004
Figure 5. Tetris rotation theorem: every 90° rotation of a recoverable template is itself recoverable, generating four equivalent templates from one. A (blue), B (red), and C (green).
Figure 5. Tetris rotation theorem: every 90° rotation of a recoverable template is itself recoverable, generating four equivalent templates from one. A (blue), B (red), and C (green).
Symmetry 18 01255 g005
Figure 6. Cyclic column- and row-rotation theorems: starting from the original template (leftmost panel), cyclically rotating the columns one step to the right (upper panels) or the rows one step downward (lower panels) preserves recoverability. Colors denote the three logical classes: A (blue), B (red), and C (green).
Figure 6. Cyclic column- and row-rotation theorems: starting from the original template (leftmost panel), cyclically rotating the columns one step to the right (upper panels) or the rows one step downward (lower panels) preserves recoverability. Colors denote the three logical classes: A (blue), B (red), and C (green).
Symmetry 18 01255 g006
Figure 7. Hierarchy of equivalence classes for the 2592 recoverable DR Code templates. The division factors ÷8 and ÷9 in the diagram are the orders of the quotient subgroups—|D4| = 8 and |C3 × C3| = 9—not arbitrary compression ratios: dividing a template count by a subgroup’s order gives the number of orbits under that subgroup.
Figure 7. Hierarchy of equivalence classes for the 2592 recoverable DR Code templates. The division factors ÷8 and ÷9 in the diagram are the orders of the quotient subgroups—|D4| = 8 and |C3 × C3| = 9—not arbitrary compression ratios: dividing a template count by a subgroup’s order gives the number of orbits under that subgroup.
Symmetry 18 01255 g007
Figure 8. Storage cost per stored DR Code pattern under four encoding strategies.
Figure 8. Storage cost per stored DR Code pattern under four encoding strategies.
Symmetry 18 01255 g008
Table 1. Number of templates surviving each successive constraint.
Table 1. Number of templates surviving each successive constraint.
Templates SurvivingConstraint
362,880No constraint (9! permutations)
120,960Row 1 has all three classes
31,104Rows 1 and 2 valid
10,368All three rows valid
5184All rows + col 1 valid
2592All rows + cols 1, 2 valid
2592Full DR Code recoverability (all rows + all cols)
Table 2. The five symmetry generators of the group G acting on the 2592 recoverable DR Code templates.
Table 2. The five symmetry generators of the group G acting on the 2592 recoverable DR Code templates.
Geometric ActionOrderSymbolConstraint
Reflects about vertical axis2σ_MMirror (left ↔ right)
Reflects about horizontal axis2σ_FFlip (top ↔ bottom)
Rotates the entire 3 × 3 grid4σ_RTetris rotation (90° CW)
Shifts columns: 0 → 1 → 2 → 03σ_CColumn-cyclic rotation
Shifts rows: 0 → 1 → 2 → 03σ_WRow-cyclic rotation
Table 3. Orbit sizes and number of equivalence classes under various subgroups of G. All values verified by exhaustive computation.
Table 3. Orbit sizes and number of equivalence classes under various subgroups of G. All values verified by exhaustive computation.
Number of Equivalence ClassesOrbit SizeOrderSubgroup of G
129622⟨σ_M⟩ (mirror only)
129622⟨σ_F⟩ (flip only)
64844⟨σ_M, σ_F⟩ (mirror + flip)
64844⟨σ_R⟩ (rotations only)
32488D4 = ⟨σ_M, σ_F, σ_R⟩
86433⟨σ_C⟩ (col-cyclic only)
86433⟨σ_W⟩ (row-cyclic only)
28899C3 × C3 = ⟨σ_C, σ_W⟩
367272G = (C3 × C3) ⋊ D4 (full)
Table 4. Storage cost comparison for one DR Code template under different encoding strategies.
Table 4. Storage cost comparison for one DR Code template under different encoding strategies.
Reduction vs. NaïveBytes Per PatternBits Per PatternEncoding Method
1.0× (baseline)4.536Naïve (cell-by-cell)
1.9×2.3819Permutation index in 9!
3.0×1.512Pattern index in V (2592)
3.0×1.512D4-quotient (324 atoms + 8)
2.8×1.6213Full-quotient (36 atoms + 72)
Table 5. Empirical preservation rate of each generator on the 2592 recoverable templates. All transformations preserve recoverability without exception.
Table 5. Empirical preservation rate of each generator on the 2592 recoverable templates. All transformations preserve recoverability without exception.
Preservation RateRecoverable OutputsRecoverable InputsTransformation
100.00%25922592Mirror (σ_M)
100.00%25922592Flip (σ_F)
100.00%25922592Rotate 90° (σ_R)
100.00%25922592Rotate 180° (σ_R2)
100.00%25922592Rotate 270° (σ_R3)
100.00%25922592Column rotate ×1 (σ_C)
100.00%25922592Column rotate ×2 (σ_C2)
100.00%25922592Row rotate ×1 (σ_W)
100.00%25922592Row rotate ×2 (σ_W2)
Table 6. Quantitative and qualitative comparison between H-level QR Code and DR Code, including the new equivalence-class results contributed by this paper.
Table 6. Quantitative and qualitative comparison between H-level QR Code and DR Code, including the new equivalence-class results contributed by this paper.
DR Code (This Work)QR Code (H-Level)Property
Bitwise XOR (RAID-5 style)Reed–Solomon over GF(256)Error-correction algorithm
33%30%Maximum data recovery rate
6 (any single row or column)2 (center-circle, upper row)Number of damage geometries handled
O(n) XOR operationsO(n2) field operationsComputational cost per decode
2592 (this work)1 per quality levelNumber of distinct valid templates
324 (this work)1Atomic patterns up to symmetry (D4)
36 (this work)1Atomic patterns up to full G
Yes (13-bit encoding)LimitedSuitable for embedded/RFID
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Sriphum, W.; Chomsiri, T. On the Equivalence Classes of Recoverable Patterns in DR Code: A Group-Theoretic Analysis with Applications to Storage Optimization. Symmetry 2026, 18, 1255. https://doi.org/10.3390/sym18081255

AMA Style

Sriphum W, Chomsiri T. On the Equivalence Classes of Recoverable Patterns in DR Code: A Group-Theoretic Analysis with Applications to Storage Optimization. Symmetry. 2026; 18(8):1255. https://doi.org/10.3390/sym18081255

Chicago/Turabian Style

Sriphum, Wiwat, and Thawatchai Chomsiri. 2026. "On the Equivalence Classes of Recoverable Patterns in DR Code: A Group-Theoretic Analysis with Applications to Storage Optimization" Symmetry 18, no. 8: 1255. https://doi.org/10.3390/sym18081255

APA Style

Sriphum, W., & Chomsiri, T. (2026). On the Equivalence Classes of Recoverable Patterns in DR Code: A Group-Theoretic Analysis with Applications to Storage Optimization. Symmetry, 18(8), 1255. https://doi.org/10.3390/sym18081255

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop