---
title: Zigzag Array Codes in Distributed Storage
url: https://www.emergentmind.com/topics/zigzag-array-codes
type: topic
---

# Zigzag Array Codes in Distributed Storage

Searching arXiv for relevant papers on zigzag array codes and related developments.
Zigzag Array Codes are a family of maximum-distance separable (MDS) array codes for distributed and RAID-style storage systems in which parity equations are organized through structured permutations of row indices, called zigzag sets, so that erased columns can be rebuilt by accessing only a prescribed fraction of the surviving array rather than reading all remaining data. In the original formulation, the central quantity is the rebuilding ratio \(R(e)\), defined as the fraction of surviving information accessed to exactly rebuild \(e\) erased columns. The defining result is that, for an \(r\)-erasure-correcting MDS array code, Zigzag Codes attain the information-theoretically optimal rebuilding ratio \(R(e)=e/r\) for \(1\le e\le r\), while retaining efficient encoding and decoding and, in the classical construction, the optimal update property [1112.0371]. Subsequent work generalized the lower-bound theory, extended optimal rebuilding from single to multiple erasures, constructed variants with optimal rebuilding for parity-node erasures, developed error-correction algorithms beyond minimum Hamming distance, and revisited the framework to obtain small-field and low-skip-cost repair schemes [1603.01213, 2509.23090].

## 1. Definition and core coding model

An MDS array code is a two-dimensional array of size \(p\times n\) over a finite field \(F\), with \(k\) systematic columns containing raw data and \(r=n-k\) parity columns. The code is MDS if any \(r\) erased columns can be exactly reconstructed from the remaining \(n-r\) columns [1112.0371]. In later notation, the same structure is described as a systematic \((n,k)\) MDS array code with sub-packetization \(p\), where a node erasure means loss of all \(p\) elements in a column [1603.01213].

The distinctive performance metric is the rebuilding ratio. For \(e\) erasures, it is the fraction of surviving data that must be accessed in order to rebuild the erased nodes exactly. In the original formulation,
\[
R(e)=\frac{\text{number of accessed symbols}}{\text{number of surviving symbols}}.
\]
For a single erasure in an \(r\)-erasure-correcting code, the surviving symbols are \((n-1)\times p\); for \(e\) erasures, they are \((n-e)\times p\) [1112.0371]. A later averaged formulation writes the rebuilding ratio over a set \(S\) of candidate erased nodes as
\[
\mathrm{RR}(e;S)=\frac{\sum_{E\subseteq S,\;|E|=e}A(E)}{\binom{|S|}{e}\,p(n-e)},
\]
where \(A(E)\) is the minimum number of accessed elements required to rebuild the erased set \(E\) [1603.01213].

This framework is closely related to repair bandwidth. If \(T(E)\) is the minimum number of elements transmitted from surviving nodes during rebuilding, then the normalized repair bandwidth is
\[
\mathrm{RB}(e;S)=\frac{\sum_{E\subseteq S,\;|E|=e}T(E)}{\binom{|S|}{e}\,p(n-e)}.
\]
Because transmitted information cannot exceed accessed information, \(\mathrm{RB}(e;S)\) is a lower bound on \(\mathrm{RR}(e;S)\) [1603.01213]. This relation is important because the optimality of Zigzag Codes can be derived both from direct combinatorial counting in the array and from the storage–repair trade-off associated with regenerating-code theory [1112.0371, 1603.01213].

A further structural notion is optimal update. An MDS array code with \(r\) parities is optimal update if each information element appears in exactly \(r\) parity elements [1603.01213]. In the original Zigzag construction, every parity element is a linear combination of exactly one element from each systematic column, and every information symbol appears exactly once in each parity column; consequently, updating one information symbol affects the information element itself and one parity symbol in each parity column, for a total of \(r+1\) updates, which is optimal [1112.0371].

## 2. Optimal rebuilding ratio and lower bounds

The central theorem of the original construction is that an MDS array code with \(r\) parity columns must satisfy the lower bound
\[
R(e)\ge \frac{e}{r}
\]
for exact rebuilding of \(e\) erasures, and Zigzag Codes attain this bound for all \(1\le e\le r\) [1112.0371]. For the particularly important case of a single erasure in a two-parity code, previous work had only bounded the rebuilding ratio between \(1/2\) and \(3/4\); Zigzag Codes resolved the open problem by proving that the exact optimum is \(1/2\) and by constructing codes that achieve it [1112.0371].

The lower bound has both an array-theoretic and a bandwidth-theoretic interpretation. In array terms, for arrays with \(r^m\) rows, at least \(e r^m\) zigzag equations are required across the \(r\) parity columns; by the pigeonhole principle, one parity contributes at least \(e r^{m-1}\) equations, which forces each surviving systematic column to supply at least an \(e/r\) fraction of its symbols [1112.0371]. In bandwidth terms, for exact-repair reconstructing codes with node storage \(\alpha\), helper degree \(d_e\), and per-helper transmission \(\beta_e\), the file size \(M\) satisfies
\[
M \le s\alpha+\sum_{i=0}^{\left\lfloor\frac{k}{e}\right\rfloor-1}\min\{e\alpha,(d_e-ie-s)\beta_e\},
\]
where \(s=k\bmod e\), \(0\le s<e\). For MDS codes, this yields
\[
\beta_e\ge \frac{e}{k(d_e-k+e)},
\]
and with all remaining nodes available, \(d_e=n-e\), the normalized repair-bandwidth lower bound becomes \(e/r\), implying \(\mathrm{RR}(e)\ge e/r\) [1603.01213].

The practical significance of this optimum is clearest in comparison with earlier two-parity array codes. EVENODD and RDP require approximately \(3/4\) of the surviving data to rebuild one erased systematic column, whereas Zigzag achieves the optimal \(1/2\); with three parities, the generalized Zigzag construction attains \(1/3\) [1112.0371]. This suggests that the contribution of Zigzag Codes is not merely an incremental improvement in access volume, but the exact attainment of the minimum permitted by the MDS and exact-repair constraints.

## 3. Classical construction for two parities

The canonical \(r=2\) Zigzag construction is specified by a binary-vector permutation framework. Fix \(m\ge 1\). The array has \(p=2^m\) rows, \(k\) systematic columns, and two parity columns: a row parity and a zigzag parity [1112.0371]. Choose a set \(T\subset F_2^m\) of \(k\) nonzero binary vectors \(\{v_0,v_1,\dots,v_{k-1}\}\). For each \(v\in T\), define a permutation on row indices \(x\in[0,2^m-1]\), viewed in binary, by
\[
f_v(x)=x+v,
\]
where addition is bitwise XOR. Also define the orthogonality set
\[
X_v=\{x\in[0,2^m-1]: x\cdot v=0\},
\]
where the inner product is over \(F_2\). Each \(X_v\) has size \(2^{m-1}\) [1112.0371].

The row parity is defined by
\[
r_u=\sum_{j=0}^{k-1}\alpha_{u,j}a_{u,j},
\]
and the zigzag parity by
\[
z_t=\sum_{j=0}^{k-1}\beta_{f_{v_j}^{-1}(t),j}\,a_{f_{v_j}^{-1}(t),j}.
\]
In the optimal-update form, every parity element is a linear combination of exactly one element from each systematic column [1112.0371].

For single-erasure rebuilding of systematic column \(j\), the rows are partitioned into
\[
S_r=X_{v_j},\qquad S_z=[0,2^m-1]\setminus X_{v_j}.
\]
Elements in rows \(S_r\) are rebuilt from row parity, and elements in rows \(S_z\) are rebuilt from zigzag parity [1112.0371]. Explicitly, for \(i\in X_{v_j}\),
\[
a_{i,j}=r_i-\sum_{u\ne j}a_{i,u},
\]
and for \(i\notin X_{v_j}\),
\[
a_{i,j}=z_{f_{v_j}(i)}-\sum_{u\ne j}\beta_{f_{v_u}^{-1}f_{v_j}(i),u}\,a_{f_{v_u}^{-1}f_{v_j}(i),u}.
\]
Only half the rows are used, so \(R=1/2\) [1112.0371].

The exact access count is governed by the interaction between the row-based and zigzag-based accesses. For distinct \(v,u\in T\), the number of elements accessed in surviving node \(u\) while rebuilding node \(v\) equals
\[
2^{m-1}+|f_v(X_v)\cap f_u(X_v)|.
\]
Moreover, when \(v\ne 0\) and \(u\ne 0\),
\[
|f_v(X_v)\cap f_u(X_v)|=
\begin{cases}
|X_v|, & |v\setminus u|\bmod 2=0,\\
0, & |v\setminus u|\bmod 2=1,
\end{cases}
\]
where \(|v\setminus u|\) counts positions with \(v_i=1\) and \(u_i=0\) [1112.0371]. This leads to the notion of orthogonal permutations: a family \(\{f_0,\dots,f_{k-1}\}\) with associated subsets \(X_i\) of size \(2^{m-1}\) is orthogonal if
\[
\frac{|f_i(X_i)\cap f_j(X_i)|}{2^{m-1}}=\delta_{i,j}.
\]

The fundamental \(r=2\) theorem chooses
\[
T=\{e_0,e_1,\dots,e_m\},
\]
where \(e_1,\dots,e_m\) is the standard basis of \(F_2^m\) and \(e_0\) is the all-ones mask used to define
\[
X_0=\{x:x\cdot(1,\dots,1)=0\}.
\]
With \(f_v(x)=x+v\) and \(X_i\) defined as above, the resulting \((m+3,m+1)\) array code has rebuilding ratio \(R=1/2\) for any single systematic erasure [1112.0371].

## 4. MDS property, coefficients, and decoding

Achieving the rebuilding optimum does not by itself ensure the MDS property; the parity coefficients must be chosen so that any two erased columns can be recovered. For the \(r=2\) optimal Zigzag Code, a simple assignment over \(GF(3)\) suffices, and \(GF(3)\) is the smallest possible field [1112.0371].

The coefficient assignment is:
\[
\alpha_{i,j}=1\quad\text{for all }i,j,
\]
and
\[
\beta_{i,j}=2^{i\cdot u_j}\in F_3,
\]
where
\[
u_j=\sum_{\ell=0}^{j}e_\ell.
\]
Here the exponent \(i\cdot u_j\) is computed in \(F_2\), and \(2\in F_3\) is the primitive element [1112.0371]. With these coefficients, the \((m+3,m+1)\) Zigzag Code is MDS. In particular, for any two erased systematic columns \(i<j\) and rows \(r,r'=r+e_i+e_j\),
\[
\beta_{r,i}\beta_{r',i}\ne \beta_{r,j}\beta_{r',j},
\]
so the resulting \(4\times 4\) linear system built from two row-parity and two zigzag-parity equations is nonsingular [1112.0371].

The explicit encoding equations are correspondingly simple. If \(a_{i,j}\) is the systematic symbol at row \(i\), column \(j\), then
\[
r_t=\sum_{j=0}^{k-1}a_{t,j},
\]
and
\[
z_t=\sum_{j=0}^{k-1}\beta_{f_{v_j}^{-1}(t),j}\,a_{f_{v_j}^{-1}(t),j}.
\]
This form makes both encoding and rebuilding sparse: each parity symbol depends on one symbol per systematic column [1112.0371].

For two systematic erasures with \(r=2\), two cases arise. If the corresponding permutations are equal, the unknowns in each row decouple into a \(2\times 2\) system,
\[
\begin{bmatrix}
1 & 1\\
\beta_{i,j_1} & \beta_{i,j_2}
\end{bmatrix}
\begin{bmatrix}
a_{i,j_1}\\
a_{i,j_2}
\end{bmatrix}
=
\begin{bmatrix}
x_i\\
y_i
\end{bmatrix},
\]
where \(x_i,y_i\) are assembled from row and zigzag parities. Otherwise, rows are paired by \(i' = i + e_{j_1}+e_{j_2}\), giving a coupled \(4\times 4\) system that remains nonsingular over \(GF(3)\) under the above coefficient assignment [1112.0371].

The later general formalism rewrites Zigzag Codes by parity encoding matrices. For prime \(r\), with \(p=r^m\), vectors \(T=\{v_0,\dots,v_{k-1}\}\subset \mathbb{F}_r^m\), and parity index \(l\in\{0,\dots,r-1\}\), the parity node \(l\) is governed by permutations
\[
f_{v_j}^l(x)=x+l\,v_j,
\]
and can be represented through generalized permutation matrices \(P_j^{(l)}\). The full generator matrix has the block form
\[
G=
\begin{pmatrix}
I & & \\
& \ddots & \\
& & I\\
I & \cdots & I\\
P_0^{(1)} & \cdots & P_{k-1}^{(1)}\\
\vdots & & \vdots\\
P_0^{(r-1)} & \cdots & P_{k-1}^{(r-1)}
\end{pmatrix},
\]
and sufficiently large fields allow coefficient assignments that make every \(k\times k\) block submatrix corresponding to \(r\) erased nodes invertible [1603.01213].

## 5. Generalization to \(r\) parities and multiple erasures

The original paper generalized the binary construction to \(r\)-ary permutations, taking \(p=r^m\) rows and vectors \(T=\{v_0,\dots,v_{k-1}\}\subset Z_r^m\) satisfying \(\gcd(v_1,\dots,v_m,r)=1\) for each \(v\in T\) [1112.0371]. For parity index \(l\in\{0,\dots,r-1\}\),
\[
f_v^l(x)=x+l v,
\]
and
\[
X_i^l=\{x:x\cdot v_i=r-l\}.
\]
Parity node \(l\) uses zigzag sets \(Z_t^l\) containing symbols \(a_{i,j}\) satisfying \(f_{v_j}^l(i)=t\) [1112.0371].

The optimal single-erasure result over \(r\) parities is obtained by choosing the orthogonal family generated by \(\{e_0,e_1,\dots,e_m\}\). The resulting \((m+1+r,m+1)\) Zigzag Code has rebuilding ratio \(R=1/r\) for any single systematic erasure [1112.0371]. For \(r=3\), a field of size at most \(2(m+1)\) suffices in the optimal construction via commuting block-permutation matrices augmented by powers of a primitive element [1112.0371].

The later multiple-erasure theory established precise necessary and sufficient conditions for optimal rebuilding in general Zigzag Codes. For erasures \([0,e-1]\), define, for each parity \(l\), the group \(G^l\) generated by \(\{(f_e^l)^{-1}f_j^l\}_{j=e}^{k-1}\). Optimal rebuilding ratio \(e/r\) holds if there exists a set \(X\subset [0,p-1]\) of size \(|X|=ep/r\) such that:

1. for each parity \(l\), every \(g\in G^l\) stabilizes \(X\);
2. for each erased systematic node \(i\in[0,e-1]\),
   \[
   \bigcup_{l=0}^{r-1}(f_i^l)^{-1}f_e^l(X)=[0,p-1];
   \]
3. the selected \(ep\) zigzag equations are linearly independent [1603.01213].

In the vector-indexed special case, writing rows as \(x\in\mathbb{F}_r^m\), define
\[
Z=\mathrm{span}\{v_{e+1}-v_e,\dots,v_{k-1}-v_e\}.
\]
Then optimal rebuilding is achieved if there exists \(X\) of size \(e r^{m-1}\) that is a union of cosets of \(Z\) and satisfies
\[
\bigcup_{l=0}^{r-1}\big(X+l(v_i-v_e)\big)=\mathbb{F}_r^m
\]
for each erased \(i\), together with linear independence of the selected equations [1603.01213]. This condition reduces further to
\[
v_i-v_e\notin Z\qquad\text{for all erased }i\in[0,e-1],
\]
which is both necessary and sufficient for the existence of such an \(X\) [1603.01213].

An explicit rebuilding algorithm follows this structure. For given erasures \([0,e-1]\):

1. compute \(Z=\mathrm{span}\{v_i-v_e\}_{i\in I}\) with \(I\) a maximal admissible subset of survivors;
2. find \(u\perp Z\) such that \(u\cdot (v_i-v_e)\ne 0\) for all erased \(i\), set \(X_0=(u)^\perp\), and let \(X\) be any union of \(e\) cosets of \(X_0\);
3. from each parity \(l\), access rows \(f_e^l(X)\) and the corresponding surviving systematic elements, then solve the resulting \(ep\) equations [1603.01213].

The same work proved that the optimal Zigzag Code with \(n=m+r\), \(k=m+1\), and \(p=r^m\) is MDS and achieves the optimal rebuilding ratio \(e/r\) for any set of \(e\) erasures, \(1\le e\le r\) [1603.01213]. For \(r=2,3\), the required fields remain \( \mathbb{F}_3 \) and \( \mathbb{F}_4 \), respectively [1603.01213].

## 6. Variants, error correction, and practical trade-offs

A major limitation of the original optimal-update Zigzag Codes is asymmetry between systematic and parity erasures: for \(e=1\), they achieve optimal rebuilding ratio \(1/r\) for a systematic-node erasure, but rebuilding a parity-node erasure requires accessing all remaining information [1603.01213]. To address this, a later construction introduced a systematic MDS array code with \(k=m-1\) systematic nodes, \(r\) parities, and \(p=r^m\) rows, achieving rebuilding ratio \(1/r\) for any single erasure, whether systematic or parity [1603.01213]. The trade-off is update cost: this construction is not optimal update, since each information element appears in \(2r-1\) parity symbols [1603.01213].

Zigzag Codes also admit syndrome-based error-correction procedures. For \((k+2,k)\) two-parity codes, if one systematic column is erased and at most one element error occurs in another systematic column, syndromes
\[
s_{i,0}=\sum_j a_{i,j}-r_i,\qquad
s_{i,1}=\sum_j \beta_{f_{v_j}^{-1}(i),j}\,a_{f_{v_j}^{-1}(i),j}-z_i
\]
identify the error location and support correction [1112.0371]. The expanded formulation gives an algorithm that corrects one node erasure plus one element error—beyond the minimum distance 3 for two parities—by using the MDS condition
\[
\beta_{r,t}\beta_{r',t}\ne \beta_{r,j}\beta_{r',j}
\quad\text{whenever }r'=r+v_i+v_j
\]
to disambiguate candidate error positions [1603.01213]. For general \(r\), a single node error can be corrected by syndromes
\[
S_l=\hat b_l-\sum_{i=0}^{k-1}P_i^{(l)}\hat a_i,\qquad l=0,\dots,r-1,
\]
using the test \(P_j^{(1)}S_0=S_1\) to identify the erroneous systematic column [1603.01213].

There is also a binary-field branch of the Zigzag literature. A two-parity GF\((2)\) construction achieved optimal repair of a failed information node using XOR operations only by sacrificing optimal update [1302.4129]. In that design, the sub-packetization is
\[
\alpha=2^{k-1},
\]
the row parity is
\[
P_i^{(0)}=\bigoplus_{j=0}^{k-1}A_{i,j},
\]
and the zigzag permutation for column \(j\) is
\[
f_j(i)=i\oplus(2^j-1).
\]
To preserve the MDS property over GF\((2)\), the zigzag parity augments the classical one-symbol-per-column pattern with extra terms determined by “dark” positions and right-neighbor sets. The construction still repairs a single systematic failure by reading exactly \(\alpha/2\) symbols from each helper, but the expected number of parity updates per information update becomes \(\tfrac{1}{2}\lfloor k/2\rfloor+2\), and the worst-case number becomes \(\lfloor k/2\rfloor+2\) [1302.4129]. This suggests a broader pattern in the Zigzag family: smaller fields and simpler arithmetic may be obtained by relinquishing the optimal-update property.

## 7. Scaling, modern revisions, and relation to MSR formulations

The core optimal-update construction has a stringent size constraint: for \(r=2\), any orthogonal-permutation code over \(p=2^m\) rows has at most \(m+1\) systematic columns, which is tight for the standard-basis construction [1112.0371]. Thus the number of rows is exponential in the number of columns for exact optimal ratio together with optimal update [1112.0371]. Duplication can enlarge \(k\): duplicating each permutation \(s\) times yields \((sk+2,sk)\) codes with rebuilding ratio
\[
R_{\mathrm{dup}}=R_{\mathrm{orig}}\times\left(1+\frac{s-1}{sk+1}\right).
\]
For the optimal \(r=2\) code, this gives \(R\approx 1/2+1/(2(m+1))\) as \(s\to\infty\) [1112.0371]. The same source notes that alternative constructions using weight-3 vector sets achieve \(O(m^3)\) columns with ratio approximately \(1/2+O(1/m)\) on small constant fields such as GF\((9)\) or GF\((16)\) [1112.0371].

A later revision revisited Zigzag Codes from the perspective of small fields and I/O locality. For row-indexing group \(\mathcal{G}=\mathbb{Z}_2^m\), with field characteristic two, explicit Cauchy-type coefficients
\[
\gamma_{ij}=(\alpha_i-\beta_j)^{-1}
\]
over any field with \(|\mathcal{F}|\ge N\) guarantee the MDS property, thereby decoupling \(p\), \(k\), and \(M\) in a way that differs from classical \(M=p^m\) Zigzag parameterizations [2509.23090]. The same work introduced an ordering-and-subgroup framework yielding repair-by-transfer schemes with bounded skip cost and low repair-fragmentation ratio while preserving optimal access and optimal rebuilding ratio for single-node repair. Its explicit families include zero skip-cost constructions with rates approaching \(2/3\), and bounded skip-cost families with rates approaching \(3/4\) and \(4/5\) [2509.23090]. This indicates that the Zigzag paradigm can be adapted to storage settings where read contiguity and helper-side simplicity are as important as access volume.

Zigzag ideas also appear in minimum-storage regenerating (MSR) formulations. In Zigzag MSR codes, parity-check structure is expressed through block Vandermonde matrices and permutation-shift matrices \(A_i\), and single-node repair attains the MSR point with optimal bandwidth [2502.19909]. A cooperative repair scheme for Zigzag MSR codes was later proposed for any number \(h\) of simultaneous failures, using \(L=d-k+h\) space-shared instances of the original Zigzag MSR code and achieving the cooperative cut-set bound with
\[
\beta=\beta'=\frac{N}{d-k+h},
\qquad
\gamma=\frac{h(d+h-1)N}{d-k+h},
\]
while reducing the field-size requirement to \(q\ge n+1\) [2502.19909]. Although these MSR constructions belong to a regenerating-code rather than a classical array-code formulation, they preserve the central Zigzag feature: highly structured permutation-based interference alignment.

Several limitations remain intrinsic across the literature. Exact optimal ratio in the classical constructions requires \(p=r^m\), hence large sub-packetization; orthogonality of permutations is essential for the exact \(1/r\) single-erasure ratio; and some Zigzag codes exhibit a threshold \(e^\ast\) such that optimal rebuilding holds only for \(e\ge e^\ast\) [1112.0371, 1603.01213]. The 2016 work proves a monotonicity property: if optimal rebuilding holds for \(e\), it also holds for all \(a\ge e\) [1603.01213]. A plausible implication is that the geometry of the vector set \(T\) determines not only repair efficiency but also a phase transition in which erasure patterns admit the coset-stability conditions required for exact \(e/r\) rebuilding.

Taken together, these results establish Zigzag Array Codes as a structurally rich class of MDS array codes in which rebuild efficiency is controlled through algebraic permutations on row indices. Their foundational contribution is the exact attainment of the rebuilding lower bound \(e/r\) under exact repair, first for one erasure with two parities and then for all \(1\le e\le r\) in broader families [1112.0371, 1603.01213]. Later developments show that the same framework can be modified to optimize parity repair, support error correction beyond minimum distance, operate over GF\((2)\), reduce field size, improve I/O locality, and support cooperative repair in MSR settings [1302.4129, 2509.23090, 2502.19909].

Source: https://www.emergentmind.com/topics/zigzag-array-codes