Manuscript Offprint
arXiv:2610.34511Insdel Decoding Algorithms for Maximum Distance Separable Codes
Bencheng Fan
Dept. EE Engineering
The University of Melbourne
Melbourne, Australia
benchengf@student.unimelb.edu.au
Margreta Kuijper
Dept. EE Engineering
The University of Melbourne
Melbourne, Australia
Jingge Zhu
Dept. EE Engineering
The University of Melbourne
Melbourne, Australia
Abstract—In this paper, we focus on decoding MDS linear block codes for insdel errors. Building on our recent work for two-dimensional Reed-Solomon codes, we present a decoding algorithm for bounded distance decoding for the general insertion-and-deletion scenario that can be used for any MDS code of rate at most half. Our algorithm employs a sliding window and has a time complexity smaller than brute-force decoding. In particular, for optimal Reed-Solomon codes, it corrects insdel errors up to the half-Singleton bound, which exceeds the scope of existing methods. Additionally, for the special cases of insertion-only and deletion-only insdel error patterns, we present two different algorithms with a time complexity smaller than our general algorithm.
Index Terms—Reed-Solomon, Insdel error, DNA storage
I. INTRODUCTION
DNA storage is an emerging data storage technology that uses synthetic DNA molecules to encode and store digital information. In a DNA-based storage system, information is encoded into sequences over the DNA alphabet . Because of its high data density, energy efficiency, and longevity, DNA-based storage is a promising approach for meeting the ever-growing demands of data storage [15] [16].
Despite these advantages, DNA-based storage faces several technological challenges, including high costs, slow read and write speeds, and high error rates in the synthesis and sequencing processes. These errors stem from mutations, degradation, and flawed synthesis and sequencing processes. In particular, DNA molecules are susceptible to insertions and deletions (insdel errors) [7] [10] [13].
Levenshtein, Varshamov and Tenengolts pioneered the study of codes that correct insdel errors in the 1960s [12] [11]. In [11], Levenshtein demonstrated the equivalence between insertions and deletions by showing that any code capable of correcting t deletions can correct t insertions and deletions.
It is demonstrated in [3] that the number of insdel errors that an linear code can correct is at most , which is called the half-Singleton bound. Linear codes that reach the half-Singleton bound are said to be optimal. Recent literature has shown that it is possible to construct optimal Reed-Solomon codes. [2] [4] [5]
So far, the problem of constructing optimal Reed-Solomon codes, where has been addressed. Moreover, designing efficient decoding algorithms for Reed-Solomon codes against insdel errors has also gained attention in recent years. While most work so far has focused on decoding Reed-Solomon codes against insdel errors , there are relatively few works addressing the problem of decoding Reed-Solomon codes, where . For optimal Reed-Solomon codes in general where , Banerjee et al. propose a polynomial-time decoding algorithm that can correct up to insdel errors as long as . We observe that a necessary condition for the method proposed in to correct insdel errors is that , which is significantly less than the half-Singleton bound .
B. Organization
The rest of the paper is organised as follows. In Section II, we introduce some key definitions and known results. In Section III, we present the three decoding algorithms for MDS codes and apply the first one to optimal Reed-Solomon codes up to the half-Singleton bound. In Section IV, we briefly summarise the results presented in this paper.
II. PRELIMINARIES
For a sequence with a length of at least and a vector of indices , we denote the subsequence as . Alternatively, we sometimes also denote it as . Moreover, if , we denote as . Throughout, we denote as the finite field. For a matrix , we denote its column vectors as , where . For a vector of indices , we denote the matrix as .
Definition 1. Let x be a sequence. If a sequence y can be obtained by deleting certain symbols from x, then y is called a subsequence of x. If a sequence y is a subsequence of both and , then y is called a common subsequence of and .
Definition 2. For two sequences x, y, the insdel distance is defined as the minimum number of insertions and deletions to transform x into y.
Similar to the minimum Hamming distance in traditional error-correction, we define the minimum insdel distance of a code.
Definition 3. For a code C, its minimum insdel distance d is defined as
It is demonstrated in [3] that there exists a tight upper bound on the minimum insdel distance of an linear code.
Theorem 1. ([3]) For an code, its minimum insdel distance must satisfy .
An code with minimum insdel distance is said to be optimal. In [11], Levenshtein demonstrated that the insdel distance is a metric. He also showed that a code's capability to correct insdel errors is directly decided by its minimum insdel distance.
Lemma 1. ([11]) Let C be a code over F with minimum insdel distance d. The code C can correct t insdel errors if and only if .
Calculating the minimum insdel distance is essential for assessing a code's ability to correct insdel errors. It is well-known (see e.g. [14, Lemma 1]) that the insdel distance between two sequences can be calculated via their longest common subsequence. We recall this result in the following lemma.
Lemma 2. Let and , then we have
where denotes the length of the longest common subsequence of and .
Lemma 2 translates the problem of computing the insdel distance between two sequences to determining the length of their longest common subsequence. In [8], an algorithm that solved the longest common subsequence problem in time was presented.
As a benchmark for comparison, we first present the brute-force method for decoding MDS codes against up to insdel errors and then give an analysis of its time complexity.
Theorem 2. Let C be an MDS code with minimum insdel distance d. Algorithm 1 correctly decodes up to insdel errors in time.
Proof. Let be the true codeword. As we assume that the number of insdel errors is at most , we have that . Furthermore, since the number of deletions is smaller than , by Theorem 1, there are at least symbols from in . Let and . Because the code is MDS, the matrix is full rank, and there exists a unique solution to the linear equation , which we denote as . Suppose that satisfies . We now show by contradiction that must be equal to . Suppose that . By assumption, , and this implies that , which contradicts the fact that is the minimum insdel distance.
Algorithm 1 Brute-Force Decoding Method
Input: Received sequence y of length , generator matrix , minimum insdel distance
Output: Decoded codeword or FALSE
1: if or then
2: return FALSE
3: end if
4: for all such that do
5:
6: for all such that do
7:
8: Solve
9:
10: if then
11:
12: return
13: end if
14: end for
15: end for
16: return FALSE of the code . It follows that . If , the algorithm moves on to the next combination of . If no codeword satisfying is found for all combinations of , then it indicates that the number of insdel errors exceeds the insdel error-correction capability of the code. The algorithm returns FALSE. The time complexity of Algorithm 1 is calculated as follows. For each combination of , the encoding process in step 9 takes time. It takes further time to calculate [8]. Since there are and combinations for and , respectively, the time complexity of the brute-force method can be calculated as .
III. MAIN RESULTS
In this section, we first present an insdel decoding algorithm for MDS codes. Then, we derive decoding algorithms for optimal Reed-Solomon codes for decoding insdel errors up to the half-Singleton bound, i.e., the number of insdel errors must be less than or equal to . We denote the number of insertions and deletions as r and s, respectively. Note that, upon receiving the sequence y, we do not know the values of r and s, but we do know the length of y.
A. Decoding MDS Codes Against Insdel Errors
We now present the main result of the paper, which is an algorithm for decoding MDS codes for up to insdel errors, allowing for both deletions and insertions. Our algorithm generalises the method for presented in [6] to MDS codes with by introducing a sliding window decoder.
To facilitate the proof of Algorithm 2's correctness, we introduce the following Lemmas.
Lemma 3. Consider a binary sequence whose terms satisfy
For , define its corresponding sum sequence as
Let m be a positive integer. If:
then for all :
Proof. First, we examine the scenarios where . As , we have that . Second, assume that , we have .
We now use induction to prove that holds for all . Assume that there exists a positive integer such that for all . Since , we have that . In other words, for all . As is previously shown, for all . By induction, we conclude that , for all .
Based on Lemma 3, we derive the following Lemma, which is the foundation for the key idea of Algorithm 2.
Lemma 4. Let be a sequence sent by the transmitter. Let be the received sequence of length obtained by deleting symbols from and inserting symbols into , where . Then, there exists such that the subsequence contains at least symbols from .
Proof. Let be a positive integer. We denote the number of symbols from in as . Our proof is by contradiction as follows: assume that such an does not exist; then for all , we have that . Then, by Lemma 3, it follows that
On the other hand, , which indicates that . Therefore, we have that . This contradicts (3) and therefore proves the Lemma.
We now provide a proof for Algorithm 2 and give an analysis of its time complexity.
Theorem 3. Let C be an MDS code with minimum insdel distance d. Algorithm 2 correctly decodes up to insdel errors in time.
Algorithm 2 Algorithm for Decoding MDS Codes Against Insdel Errors
Input: Received sequence y of length , generator matrix , minimum insdel distance
Output: Decoded codeword or FALSE
1: if or then
2: return FALSE
3: end if
4: for do
5:
6: for and do
7:
8: for do
9:
10: Solve
11:
12: if then
13:
14: return
15: end if
16: end for
17: end for
18: end for
19: return FALSE
Proof. Let be the true codeword. By Lemma 4, there exists such that the subsequence contains at least symbols from . For each possible value of , denote . Let , where and . Let , where . Denote the unique solution of the linear equation as . Suppose that satisfies . We now show by contradiction that must be equal to . Suppose that . By assumption, , and this implies that , which contradicts the fact that is the minimum insdel distance of the code . It follows that . If , the algorithm moves on to the next combination of . If no codeword satisfying is found for all combinations of , then it indicates that the number of insdel errors exceeds the error correction capability of the code. The algorithm returns FALSE. The time complexity of Algorithm 2 is calculated as follows. As takes values from the set , a time complexity of is introduced. For each value of , there are exactly possible combinations for and combinations for . As we assume that is a fixed integer, the combinations for introduce a time complexity of . The combinations for , on the other hand, introduce a time complexity of . For each combination of , it takes time for the encoding process in step 11. It takes further time to calculate [8]. Therefore, the total time complexity is .
To establish connections with the recent literature on optimal Reed-Solomon codes, we now present Algorithm 3 as a special case of Algorithm 2, where the MDS code is optimal, i.e. . By Theorem 3, our method corrects up to the half-Singleton bound, which exceeds the scope of [1].
B. Decoding MDS Codes for Deletions
For the deletion-only scenario, the received sequence y is a subsequence of the transmitted sequence . The algorithm we present below is a straightforward generalisation of the method from our recent paper [6].
Theorem 4. Let C be an MDS code with minimum insdel distance d. Algorithm 4 correctly decodes up to deletions in time. If the number of deletions exceeds , then Algorithm 4 returns FALSE.
Proof. Let be the true codeword. In a deletion-only scenario, must be a subsequence of , say . As we assume that the number of deletions is at most , we have that . Therefore, satisfy . Let and . Denote the unique solution of the linear equation by . Suppose that is a subsequence of . We now show that must be equal to . Since is a common subsequence of and , it follows from Lemma 2 that , which implies that . The time complexity of Algorithm 4 is calculated as follows. For each , the encoding process in step 8 takes time. To determine if is a subsequence of , we utilize a standard greedy two-pointer approach, which runs in linear time [9]. Since there are combinations of , the total time complexity is . If all
Algorithm 3 Algorithm for Optimal MDS Codes
Input: Received sequence y of length , generator matrix
Output: Decoded codeword or FALSE
1: if or then
2: return FALSE
3: end if
4: for do
5:
6: for and do
7:
8: for do
9:
10: Solve
11:
12: if then
13:
14: return
15: end if
16: end for
17: end for
18: end for
19: return FALSE
Algorithm 4 Algorithm for the Deletion-Only Scenario
Input: Received sequence y of length , generator matrix , minimum insdel distance
Output: Decoded codeword or FALSE
1: if then
2: return FALSE
3: end if
4:
5: for all such that do
6:
7: Solve
8:
9: if is a subsequence of then
10:
11: return
12: end if
13: end for
14: return FALSE possible combinations of fail, then either the number of insertions is not zero or the number of deletions exceeds . The algorithm returns FALSE.
C. Decoding MDS Codes for Insertions
For the insertion-only scenario, the transmitted sequence is a subsequence of the received sequence y. The algorithm we present below is a straightforward generalisation of the method from our recent paper [6].
Theorem 5. Let C be an MDS code with minimum insdel distance d. Algorithm 5 correctly decodes up to insertions in time. If the number of insertions exceeds , then Algorithm 5 returns FALSE.
Proof. Let be the true codeword. In an insertion-only scenario, must be a subsequence of , say . As we assume that the number of insertions is at most , we have that . Therefore, satisfy . Let and . Denote the unique solution of the linear equation by . Suppose is a subsequence of . We now show that must be equal to . Since both and are subsequences of , we have . Therefore, by the triangle inequality, , which implies that . The time complexity of Algorithm 5 is calculated as follows. For each , the encoding process in step 8 takes time. To determine if is a subsequence of , we utilize a standard greedy two-pointer approach, which runs in linear time [9]. Since there are combinations of , the total time complexity is . If all possible combinations of fail, then either the
Algorithm 5 Algorithm for the Insertion-Only Scenario
Input: Received sequence y of length , generator matrix , minimum insdel distance d
Output: Decoded codeword or FALSE
1: if then
2: return FALSE
3: end if
4:
5: for all such that do
6:
7: Solve
8:
9: if c is a subsequence of y then
10:
11: return
12: end if
13: end for
14: return FALSE
number of deletions is not zero or the number of insertions exceeds . The algorithm returns FALSE.
IV. Conclusions
In this paper, we focus on efficient insdel decoding algorithms for MDS codes. Our main result is a bounded distance decoding algorithm for decoding insdel errors in general with a time complexity of . It improves on the brute-force method with a time complexity of . Additionally, we presented two algorithms with a time complexity of for the simpler deletion-only and insertion-only scenarios, respectively. Our methods utilise only the MDS property and do not require the codes to be optimal in the insdel setting. A possible avenue for future research is to develop more efficient insdel bounded distance decoding algorithms for Reed-Solomon codes exploiting their special algebraic properties.
REFERENCES
[1] Anisha Banerjee, Roni Con, Antonia Wachter-Zeh, and Eitan Yaakobi. Decoding insertions/deletions via list recovery. In 2025 IEEE International Symposium on Information Theory (ISIT), pages 1–6. IEEE, 2025.
[2] Bocong Chen and Guanghui Zhang. Improved Singleton bound on insertion-deletion codes and optimal constructions. IEEE Transactions on Information Theory, 68(5):3028–3033, 2022.
[3] Kuan Cheng, Venkatesan Guruswami, Bernhard Haeupler, and Xin Li. Efficient linear and affine codes for correcting insertions/deletions. SIAM Journal on Discrete Mathematics, 37(2):748–778, 2023.
[4] Roni Con, Amir Shpilka, and Itzhak Tamo. Reed-Solomon codes against adversarial insertions and deletions. IEEE Transactions on Information Theory, 69(5):2991–3000, 2023.
[5] Roni Con, Amir Shpilka, and Itzhak Tamo. Optimal two-dimensional Reed-Solomon codes correcting insertions and deletions. IEEE Transactions on Information Theory, 70(7):5012–5016, 2024.
[6] Bencheng Fan, Margreta Kuijper, and Jingge Zhu. Insdel Reed-Solomon decoding algorithms up to the half-Singleton bound. In 2026 International Symposium on Information Theory and its Applications (ISITA), pages 1–6, 2026. available on ArXiv.
[7] Reinhard Heckel, Gediminas Mikutis, and Robert N Grass. A characterization of the DNA data storage channel. Scientific reports, 9(1):9663, 2019.
[8] Daniel S Hirschberg. Algorithms for the longest common subsequence problem. Journal of the ACM (JACM), 24(4):664–675, 1977.
[9] Antti Laaksonen. Guide to Competitive Programming: Learning and Improving Algorithms Through Contests. Springer, 2nd edition, 2020.
[10] Andreas Lenz, Paul H. Siegel, Antonia Wachter-Zeh, and Eitan Yaakobi. Coding over sets for DNA storage. IEEE Transactions on Information Theory, 66(4):2331–2351, 2020.
[11] Vladimir I Levenshtein. Binary codes capable of correcting deletions, insertions, and reversals. In Soviet physics doklady, volume 10, pages 707–710, 1966.
[12] Vladimir I Levenshtein. Asymptotically optimum binary code with correction for losses of one or two adjacent bits. Problemy Kibernetiki, 19:293–298, 1967.
[13] Ilan Shomorony and Reinhard Heckel. Information-theoretic foundations of DNA data storage. Foundations and Trends® in Communications and Information Theory, 19(1):1–106, 2022.
[14] Shubhransh Singhvi. Optimally decoding two-dimensional Reed-Solomon codes against deletion errors. IEEE Transactions on Information Theory, pages 1646–1653, 2026.
[15] Eliza Strickland. The quest for a DNA data drive. https://spectrum.ieee.org/dna-data-storage, 2024. IEEE Spectrum.
[16] Jianjun Wu, Shufang Zhang, Tao Zhang, and Yuhong Liu. HD-code: End-to-End high density code for DNA storage. IEEE Transactions on NanoBioscience, 20(4):455–463, 2021.
AI STATEMENT
Artificial intelligence tools have not been used to produce any parts of this manuscript, including but not limited to text and code. The planning, analysis, and writing of this research were executed entirely by the human authors.