English

Space-Efficient Online Computation of String Net Occurrences

Data Structures and Algorithms 2024-11-20 v1

Abstract

A substring uu of a string TT is said to be a repeat if uu occurs at least twice in TT. An occurrence [i..j][i..j] of a repeat uu in TT is said to be a net occurrence if each of the substrings aub=T[i1..j+1]aub = T[i-1..j+1], au=T[i1..j+1]au = T[i-1..j+1], and ub=T[i..j+1]ub = T[i..j+1] occurs exactly once in TT. The occurrence [i1..j+1][i-1..j+1] of aubaub is said to be an extended net occurrence of uu. Let TT be an input string of length nn over an alphabet of size σ\sigma, and let ENO(T)\mathsf{ENO}(T) denote the set of extended net occurrences of repeats in TT. Guo et al. [SPIRE 2024] presented an online algorithm which can report ENO(T[1..i])\mathsf{ENO}(T[1..i]) in T[1..i]T[1..i] in O(nσ2)O(n\sigma^2) time, for each prefix T[1..i]T[1..i] of TT. Very recently, Inenaga [arXiv 2024] gave a faster online algorithm that can report ENO(T[1..i])\mathsf{ENO}(T[1..i]) in optimal O(#ENO(T[1..i]))O(\#\mathsf{ENO}(T[1..i])) time for each prefix T[1..i]T[1..i] of TT, where #S\#S denotes the cardinality of a set SS. Both of the aforementioned data structures can be maintained in O(nlogσ)O(n \log \sigma) time and occupy O(n)O(n) space, where the O(n)O(n)-space requirement comes from the suffix tree data structure. In this paper, we propose the two following space-efficient alternatives: (1) A sliding-window algorithm of O(d)O(d) working space that can report ENO(T[id+1..i])\mathsf{ENO}(T[i-d+1..i]) in optimal O(#ENO(T[id+1..i]))O(\#\mathsf{ENO}(T[i-d+1..i])) time for each sliding window T[id+1..i]T[i-d+1..i] of size dd in TT. (2) A CDAWG-based online algorithm of O(e)O(e) working space that can report ENO(T[1..i])\mathsf{ENO}(T[1..i]) in optimal O(#ENO(T[1..i]))O(\#\mathsf{ENO}(T[1..i])) time for each prefix T[1..i]T[1..i] of TT, where e<2ne < 2n is the number of edges in the CDAWG for TT. All of our proposed data structures can be maintained in O(nlogσ)O(n \log \sigma) time for the input online string TT. We also discuss that the extended net occurrences of repeats in TT can be fully characterized in terms of the minimal unique substrings (MUSs) in TT.

Keywords

Cite

@article{arxiv.2411.12160,
  title  = {Space-Efficient Online Computation of String Net Occurrences},
  author = {Takuya Mieno and Shunsuke Inenaga},
  journal= {arXiv preprint arXiv:2411.12160},
  year   = {2024}
}
R2 v1 2026-06-28T20:04:27.235Z