betaFeedback

WorksComputer Science

Substring Edit Correcting Codes and Optimal Single Burst-Deletion Correcting Codes

Abstract

A kk-substring edit in a sequence first deletes a substring of length at most kk, and then inserts a sequence of length at most kk at the same position. A code that can correct a kk-substring edit is called a kk-substring edit code. In this paper, we develop a new localization method and use it to construct a qq-ary kk-substring edit correcting code with log⁡n+8log⁡log⁡n+o(log⁡log⁡n)\log n+8\log\log n+o(\log\log n) bits of redundancy for any fixed q≥2q\ge2 and k≥1k\ge1, where nn is the code length. For the binary alphabet, this improves upon the redundancy log⁡n+16klog⁡log⁡n+o(log⁡log⁡n)\log n+16k\log\log n+o(\log\log n) obtained by Li et al. When the deleted substring and the inserted sequence have different lengths, we further construct codes with redundancy log⁡n+Oq,k(1)\log n+O_{q,k}(1), which is optimal up to an additive constant. As corollaries, for all fixed q≥2q\ge2 and 1≤t≤T1\le t\le T, we obtain qq-ary (≤t)(\le t)-burst-deletion correcting codes and (t,T)(t,T)-localized deletion correcting codes with redundancies log⁡n+Oq,t(1)\log n+O_{q,t}(1) and log⁡n+Oq,T(1)\log n+O_{q,T}(1), respectively. To the best of our knowledge, these are the first constructions attaining optimal redundancy up to an additive constant for these two deletion models over the full range of fixed parameters. For (≤t)(\le t)-burst-deletion correction with t≥2t\ge2, such redundancy had previously been achieved only for q=t=2q=t=2 by Levenshtein in 1967.

Introduction

A kk-substring edit replaces a substring of length at most kk by another sequence of length at most kk. More precisely, over the alphabet Σq={0,1,…,q−1}\Sigma_q = \{0,1,\ldots,q-1\}, it transforms a sequence x=usvx = usv into y=utvy = utv, where uu, ss, tt, and vv are sequences over Σq\Sigma_q, with the lengths of ss, tt being at most kk. This operation encompasses insertions, deletions, substitutions, and combinations of these errors within one short region. A kk-substring edit correcting code must uniquely recover the original codeword xx from yy without knowing the location of the edit or the lengths of ss and tt.

Tang et al. introduced the kk-substring edit model in [1]. Their analysis of source-code revisions and simulated nanopore sequencing reads provides empirical evidence that edits tend to occur in clusters. In file synchronization, for example, updating an expression in a source-code file may replace a block of characters while leaving the rest unchanged. Similarly, a cluster of insertion, deletion, and substitution errors in a stored or transmitted sequence can be represented by a substring replacement. From a coding perspective, the main feature of a kk-substring edit is that all changes are confined to one short region, even though the symbols after that region may shift. Using this restriction can substantially reduce the redundancy compared with protecting against the same number of edits at arbitrary positions.

For the binary alphabet and fixed kk, Tang et al. [1] constructed codes correcting one kk-substring edit with redundancy 2log⁡n+o(log⁡n)2\log n+o(\log n), where nn is the code length. Li et al. [2] subsequently improved the redundancy bound to log⁡n+16klog⁡log⁡n+o(log⁡log⁡n)\log n+16k\log\log n+o(\log\log n). As shown later in the current paper, for fixed qq and kk, any qq-ary code of length nn correcting one kk-substring edit requires at least log⁡n−Oq,k(1)\log n-O_{q,k}(1) bits of redundancy. Thus, Li’s construction achieves the optimal leading term log⁡n\log n in the binary case, with an additive Ok(log⁡log⁡n)O_k(\log\log n) gap between their redundancy bound and the lower bound.

We review some error models which are special cases of the kk-substring edit model.

Burst/Localized Deletions

A burst of exactly tt deletions removes tt consecutive symbols, whereas a burst of at most tt deletions removes a substring of length at most tt. Codes correcting these errors are called tt-burst-deletion correcting codes and (≤t)(\le t)-burst-deletion correcting codes, respectively. The study of these codes goes back to Levenshtein’s work in 1967 [3], where a binary (≤2)(\le2)-burst-deletion correcting code was constructed. Applications in DNA storage and file synchronization have motivated further studies of these codes in the past two decades [4, 5, 6, 7, 8, 9, 10, 11]. A central objective is to construct qq-ary codes whose redundancy matches the lower bound log⁡n−Oq,t(1)\log n-O_{q,t}(1) [4, 7] up to an additive constant, for fixed q≥2q \ge2 and t≥1t \ge1.

For a prescribed burst length tt, Sun et al. [10] constructed qq-ary tt-burst-deletion correcting codes with redundancy log⁡n+Oq,t(1)\log n+O_{q,t}(1), attaining this objective. For (≤t)(\le t)-burst-deletion correcting codes, several redundancy upper bounds are available in different parameter ranges [6, 9, 10, 11]. For arbitrary fixed q,t≥2q,t \ge2, Song, Cai, and Quek [9] obtained redundancy log⁡n+\log n+

This research is supported by the National Key Research and Development Program of China under Grant 2025YFC3409900, the National Natural Science Foundation of China under Grant 12231014 and Grant 12501466, Beijing Scholars Program, and Xiaomi Young Scholars Program. 8log⁡log⁡n+o(log⁡log⁡n)8 \log\log n + o(\log\log n). For even qq, Sun et al. [10, Theorem 10] obtained redundancy log⁡n+tlog⁡log⁡n+Oq,t(1)\log n + t \log\log n + O_{q,t}(1). Very recently, Ye, Sun, and Ge [11, Theorem 17] reduced the redundancy to log⁡n+(t−1)log⁡log⁡n+Oq,t(1)\log n + (t-1) \log\log n + O_{q,t}(1) when t<qt < q, or when qq is even and t<2qt < 2q. Sharper bounds are available in some special cases. For t=1t = 1, optimal qq-ary single-deletion codes have redundancy log⁡n+Oq(1)\log n + O_q(1) [8, 12]. For q=2q = 2, Levenshtein’s code achieves redundancy log⁡n+O(1)\log n + O(1) when t=2t = 2 [3], and [11 Remark 18] gives redundancy log⁡n+log⁡log⁡n+O(1)\log n + \log\log n + O(1) when t=3t = 3.

A tt-localized deletion removes at most tt symbols from an unknown window of tt consecutive symbols, without requiring the deleted positions to be consecutive. Schoeny et al. introduced and studied this model under the name “bursts of non-consecutive deletions” [4]. Bitar et al. [13] constructed binary codes with redundancy log⁡n+O(tlog⁡2(tlog⁡n))\log n + O(t \log^2(t \log n)), which becomes log⁡n+Ot((log⁡log⁡n)2)\log n + O_t((\log\log n)^2) for fixed tt. For even qq, Sun et al. [10, Theorem 11] obtained qq-ary codes with redundancy log⁡n+2tlog⁡log⁡n+Oq,t(1)\log n + 2t \log\log n + O_{q,t}(1).

More generally, a (t,T)(t,T)-localized deletion removes at most tt symbols from an unknown window of TT consecutive symbols, where the window length T≥tT \ge t is specified separately from tt. The tt-localized-deletion model is the special case T=tT = t. For fixed qq, tt and TT, Ye, Sun, and Ge [11, Theorem 20] constructed qq-ary codes correcting (t,T)(t,T)-localized deletions with redundancy log⁡n+(t−1)log⁡log⁡n+Oq,t,T(1)\log n + (t - 1) \log\log n + O_{q,t,T}(1) when t<qt < q, or when qq is even and t<2qt < 2q.

Clearly, the (t,T)(t,T)-localized-deletion model includes both the tt-burst-deletion and (≤t)(\le t)-burst-deletion models. Its connection with substring edits can be seen directly. Let ss be the affected length-TT window, and let tt be the subsequence remaining after dd deletions, where 1≤d≤t1 \le d \le t. Replacing ss by tt is a TT-substring edit.

The (t,s)(t,s)-Burst Error

For prescribed nonnegative integers tt and ss with t+s>0t+s > 0, a (t,s)(t,s)-burst error replaces a length-tt substring by a length-ss sequence. The special case (t,s)=(2,1)(t,s) = (2,1) was introduced by Schoeny et al. in [4] as a component of their constructions for correcting localized deletions. Lu and Zhang subsequently formulated the general model in [14]. This model also generalizes the tt-deletion-burst error model.

Sun et al. [10] later constructed qq-ary (t,s)(t,s)-burst correcting codes with redundancy log⁡n+Oq,t,s(1)\log n + O_{q,t,s}(1) for every fixed q≥2q \ge2 and every fixed pair (t,s)(t,s) with t+s>0t + s > 0. Their redundancy is optimal up to an additive constant depending only on q,t,sq,t,s.

Every (t,s)(t,s)-burst error with max⁡{t,s}≤k\max\{t,s\} \le k is a kk-substring edit. A (t,s)(t,s)-burst correcting code is required to correct errors for one prescribed pair (t,s)(t,s), whereas a kk-substring edit correcting code must handle all such pairs simultaneously. For a codeword of length nn, the received sequence has length n−t+sn-t+s, which determines s−ts-t but generally does not determine tt and ss individually. Consequently, the optimal redundancy result for each fixed pair does not by itself give a single code with the same redundancy for the more general substring edit model.

The tt-Burst-Edit

A tt-burst-edit, as defined in [15], is one of three operations: deleting exactly tt consecutive symbols, inserting a sequence of length tt at one position, or replacing a length-tt substring by another length-tt substring. When t=1t = 1, this reduces to the single-edit model, whose binary case was studied by Levenshtein [16]. Sun, Xi, and Ge [17] considered the burst-edit channel in the sequence reconstruction setting. Sun and Ge [15] subsequently studied codes correcting these errors. The objective is to construct a single code that protects against both synchronization errors and length-preserving substitutions.

For a single binary edit, redundancy log⁡n+O(1)\log n + O(1) is achievable [16]. For arbitrary fixed alphabet size q≥2q \ge2, Gabrys et al. [18] obtained single-edit correcting codes with redundancy log⁡n+Oq(log⁡log⁡n)\log n + O_q(\log\log n). For fixed t≥1t \ge1 and fixed q≥2q \ge2, this is a power of two, Sun and Ge [15, Theorem 12] constructed qq-ary tt-burst-edit correcting codes with redundancy log⁡n+log⁡log⁡n+Oq,t(1)\log n + \log\log n + O_{q,t}(1). This redundancy is within an additive log⁡log⁡n+Oq,t(1)\log\log n + O_{q,t}(1) term of the log⁡n−Oq,t(1)\log n - O_{q,t}(1) lower bound inherited from tt-burst-deletion correcting codes.

Writing (a,b)(a,b) for the lengths of the removed and replacement substrings, the three operations above correspond to (t,0)(t,0), (0,t)(0,t), and (t,t)(t,t). Thus, every tt-substring edit correcting code also corrects a tt-burst-edit. The two error models coincide when t=1t = 1. For t≥2t \ge2, however, the substring edit model also allows pairs (a,b)(a,b) with 1≤a,b≤t1 \le a,b \le t and a≠ba \ne b, as well as bursts of fewer than tt deletions or insertions. Correcting a tt-burst-edit alone therefore does not guarantee correction of all these additional errors.

Single Deletion or Single Adjacent Transposition

An adjacent transposition exchanges two neighboring symbols, replacing abab by baba, where a,b∈Σqa,b \in\Sigma_q and a≠ba \ne b. Motivated by DNA-based storage, Gabrys, Yaakobi, and Milenkovic [19] initiated the study of codes correcting deletions and adjacent transpositions. A basic case requires a single code to correct either one deletion or one adjacent transposition, thereby providing protection against both symbol loss and a local change in symbol order.

For the binary alphabet, Gabrys et al. [18, Theorem 2] constructed codes correcting either one deletion or one adjacent transposition with redundancy log⁡n+O(log⁡log⁡n)\log n + O(\log\log n), which is within an additive O(log⁡log⁡n)O(\log\log n) of the lower bound log⁡n−O(1)\log n - O(1). For arbitrary fixed q≥2q \ge2, Khuat and Kim [20] constructed qq-ary codes for the stronger model allowing one insertion, deletion, substitution, or adjacent transposition, with redundancy 2log⁡n+Oq(1)2 \log n + O_q(1) bits.

A single deletion replaces a length-one substring by the empty sequence, whereas an adjacent transposition replaces a length-two substring by another sequence of length two. Both are 2-substring edits. Consequently, taking k=2k = 2 in our first construction gives qq-ary codes for this model, and also for the stronger one-edit-or-transposition model.

Our Contributions and Main Ideas

This paper continues the study of kk-substring edit correcting codes. For fixed q≥2q \ge2 and k≥1k \ge1 and sufficiently large code length nn, we obtain the following two constructions.

  • We construct qq-ary kk-substring edit correcting codes with redundancy at most log⁡n+8log⁡log⁡n+8log⁡log⁡log⁡n+Oq,k(1)\log n + 8\log\log n + 8\log\log\log n + O_{q,k}(1). This extends the leading redundancy term log⁡n\log n achieved by the binary construction in [2] to arbitrary fixed alphabets. Moreover, the coefficient of log⁡log⁡n\log\log n is reduced from 16k16k to 88 and is independent of both qq and kk.

  • When the removed substring and its replacement have different lengths, we construct qq-ary codes correcting one such edit with redundancy log⁡n+Oq,k(1)\log n + O_{q,k}(1).

References

  1. [1]Y. Tang, S. Motamen, H. Lou, K. Whitenour, S. Wang, R. Gabrys, and F. H. Farnoud, “Correcting a Substring Edit Error of Bounded Length,” IEEE Trans. Commun., vol. 73, no. 1, pp. 12–21, Jan. 2025.
  2. [2]Y. Li, Y. Tang, H. Lou, R. Gabrys, and F. H. Farnoud, “Optimal Codes Correcting a Substring Edit,” IEEE Trans. Inf. Theory, vol. 71, no. 7, pp. 5178–5191, Jul. 2025.DOI
  3. [3]V. I. Levenshtein, “Asymptotically optimum binary code with correction for losses of one or two adjacent bits,” Problemy Kibernetiki, vol. 19, pp. 293–298, 1967, in Russian; English translation in Systems Theory Research, vol. 19, pp. 298–304, 1970.
  4. [4]C. Schoeny, A. Wachter-Zeh, R. Gabrys, and E. Yaakobi, “Codes Correcting a Burst of Deletions or Insertions,” IEEE Trans. Inf. Theory, vol. 63, no. 4, pp. 1971–1985, Jan. 2017.arxiv.org/abs/1602.06820
  5. [5]A. Lenz and N. Polyanskiy, “Optimal Codes Correcting a Burst of Deletions of Variable Length,” in Proc. Int. Symp. Inf. Theory (ISIT), Los Angeles, CA, USA, Jun. 2020, pp. 757–762.arxiv.org/abs/2001.06641
  6. [6]W. Song and K. Cai, “Non-binary Two-Deletion Correcting Codes and Burst-Deletion Correcting Codes,” IEEE Trans. Inf. Theory, vol. 69, no. 10, pp. 6470–6484, Oct. 2023.arxiv.org/abs/2210.14006
  7. [7]S. Wang, Y. Tang, J. Sima, R. Gabrys, and F. Farnoud, “Non-binary Codes for Correcting a Burst of at Most t Deletions,” IEEE Trans. Inf. Theory, vol. 70, no. 2, pp. 964–979, Feb. 2024.arxiv.org/abs/2210.11818
  8. [8]T. Thanh Nguyen, K. Cai, and P. H. Siegel, “A New Version of q-Ary Varshamov-Tenengolts Codes With More Efficient Encoders: The Differential VT Codes and The Differential Shifted VT Codes,” IEEE Trans. Inf. Theory, vol. 70, no. 10, pp. 6989–7004, Oct. 2024.arxiv.org/abs/2311.04578
  9. [9]W. Song, K. Cai, and T. Q. S. Quek, “Some New Constructions of q-ary Codes for Correcting a Burst of at Most t Deletions,” Entropy, vol. 27, no. 1, p. 85, Jan. 2025.DOI
  10. [10]Y. Sun, Z. Lu, Y. Zhang, and G. Ge, “Asymptotically Optimal Codes for (t, s)-Burst Error,” IEEE Trans. Inf. Theory, vol. 71, no. 3, pp. 1570–1584, Mar. 2025.arxiv.org/abs/2403.11750
  11. [11]Z. Ye, Y. Sun, and G. Ge, “Correcting Bursty/Localized Deletions: A New Error-Position-Estimation Code,” IEEE Trans. Inf. Theory, vol. 72, no. 3, pp. 1667–1682, Mar. 2026.arxiv.org/abs/2507.04797
  12. [12]G. Tenengolts, “Nonbinary codes, correcting single deletion or insertion,” IEEE Trans. Inf. Theory, vol. 30, no. 5, pp. 766–769, Sep. 1984.DOI
  13. [13]R. Bitar, S. K. Hanna, N. Polyanskii, and I. Vorobyev, “Optimal Codes Correcting Localized Deletions,” in Proc. Int. Symp. Inf. Theory (ISIT), Melbourne, Australia, Jul. 2021, pp. 1991–1996.arxiv.org/abs/2105.02298
  14. [14]Z. Lu and Y. Zhang, “t-Deletion-s-Insertion-Burst Correcting Codes,” IEEE Trans. Inf. Theory, vol. 69, no. 10, pp. 6401–6413, Oct. 2023.arxiv.org/abs/2201.10259
  15. [15]Y. Sun and G. Ge, “Codes for Correcting a Burst of Edits Using Weighted-Summation VT Sketch,” IEEE Trans. Inf. Theory, vol. 71, no. 3, pp. 1631–1646, Mar. 2025.DOI
  16. [16]V. I. Levenshtein, “Binary Codes Capable of Correcting Deletions, Insertions, and Reversals,” Soviet Physics Doklady, vol. 10, pp. 707–710, 1966.
  17. [17]Y. Sun, Y. Xi, and G. Ge, “Sequence Reconstruction Under Single-Burst-Insertion/Deletion/Edit Channel,” IEEE Trans. Inf. Theory, vol. 69, no. 7, pp. 4466–4483, Jul. 2023.DOI
  18. [18]R. Gabrys, V. Gruswami, J. Ribeiro, and K. Wu, “Beyond Single-Deletion Correcting Codes: Substitutions and Transpositions,” IEEE Trans. Inf. Theory, vol. 69, no. 1, pp. 169–186, Jan. 2023.arxiv.org/abs/2112.09971
  19. [19]R. Gabrys, E. Yaakobi, and O. Milenkovic, “Codes in the Damerau Distance for Deletion and Adjacent Transposition Correction,” IEEE Trans. Inf. Theory, vol. 64, no. 4, pp. 2550–2570, Apr. 2018.DOI
  20. [20]T.-H. Khuat and S. Kim, “Novel q-ary Code Design for One Edit or Adjacent Transposition Error,” IEEE Open J. Commun. Soc., vol. 4, pp. 2830–2837, 2023.DOI
  21. [21]Y. Li, R. Gabrys, and F. Farnoud, “Constructing Low-Redundancy Codes via Distributed Graph Coloring,” IEEE Trans. Inf. Theory, vol. 72, no. 10, pp. 7344–7358, Oct. 2026.arxiv.org/abs/2512.04197
  22. [22]V. Shoup, A Computational Introduction to Number Theory and Algebra, 2nd ed. Cambridge University Press, 2008. [Online]. Available: https://www.shoup.net/ntb/
  23. [23]M. Agrawal, N. Kayal, and N. Saxena, “PRIMES is in P,” Ann. Math., vol. 160, no. 2, pp. 781–793, Sept. 2004.DOI
  24. [24]———, “Errata: PRIMES is in P,” Ann. Math., vol. 189, no. 1, pp. 317–318, Jan. 2019.DOI
  25. [25]N. J. Higham, Accuracy and Stability of Numerical Algorithms, 2nd ed. Philadelphia, PA, USA: Society for Industrial and Applied Mathematics, 2002.
  26. [26]J. B. Rosser and L. Schoenfeld, “Approximate formulas for some functions of prime numbers,” Ill. J. Math., vol. 6, no. 1, pp. 64–94, Mar. 1962.

Paper details

vlnc:W_z47ka8wa
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 0

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

Not recorded for this paper

View statement
Looking for related papers…
Contents