Skip to main content
QUICK REVIEW

[论文解读] Optimal Time and Space Construction of Suffix Arrays and LCP Arrays for Integer Alphabets

Keisuke Goto|arXiv (Cornell University)|Mar 3, 2017
Algorithms and Data Compression参考文献 22被引用 11
一句话总结

本论文提出了首个针对整数字母表的原地线性时间后缀数组(SA)与最长公共前缀(LCP)数组构造算法,仅使用输入和输出空间之外的 O(1) 额外字词。通过将类型数组和辅助数据结构紧凑地存储在输出空间内,该方法在 SA 和 LCP 构造中均实现了最优的时间与空间复杂度,解决了字符串算法中的一个开放问题。

ABSTRACT

Suffix arrays and LCP arrays are one of the most fundamental data structures widely used for various kinds of string processing. We consider two problems for a read-only string of length $N$ over an integer alphabet $[1, \dots, σ]$ for $1 \leq σ\leq N$, the string contains $σ$ distinct characters, the construction of the suffix array, and a simultaneous construction of both the suffix array and LCP array. For the word RAM model, we propose algorithms to solve both of the problems in $O(N)$ time by using $O(1)$ extra words, which are optimal in time and space. Extra words means the required space except for the space of the input string and output suffix array and LCP array. Our contribution improves the previous most efficient algorithms, $O(N)$ time using $σ+O(1)$ extra words by [Nong, TOIS 2013] and $O(N \log N)$ time using $O(1)$ extra words by [Franceschini and Muthukrishnan, ICALP 2007], for constructing suffix arrays, and it improves the previous most efficient solution that runs in $O(N)$ time using $σ+ O(1)$ extra words for constructing both suffix arrays and LCP arrays through a combination of [Nong, TOIS 2013] and [Manzini, SWAT 2004].

研究动机与目标

  • 解决整数字母表后缀数组原地线性时间构造的开放问题。
  • 在最优时间与空间内同时构造后缀数组与 LCP 数组。
  • 将现有线性时间算法的空间复杂度从 O(σ) 降低至 O(1) 额外字词。
  • 通过 ψ 数组的原地变换,实现 LCP 数组的高效原地计算。
  • 为需要增强后缀数组的字符串处理工作负载,提供实用且空间高效的解决方案。

提出的方法

  • 该算法使用诱导排序框架,将类型数组和 LCP 辅助数组存储在输出后缀数组空间中,以实现 O(1) 额外字词。
  • 通过利用输出数组的最高有效位(MSBs)作为类型数组的存储空间,对后缀和 LE 数组元素采用紧凑表示。
  • 该方法利用两个关键性质:(1) 后缀的第一个字符对应其存储索引;(2) 对于 L-后缀和 LMS-后缀,前一个字符与当前字符不同。
  • 通过在逆后缀数组(ISA)上进行从左到右扫描,原地计算 ψ 数组(排名后继数组),然后将其原地转换为 LCP 数组。
  • 该算法通过复用 LMS-后缀排序过程的结构,避免了稳定归并,从而降低空间与时间开销。
  • 采用简化的原地方法存储递归子数组边界,实现 O(1) 访问时间,而非 O(log N)。

实验结果

研究问题

  • RQ1能否在 O(N) 时间和 O(1) 额外空间内,为整数字母表构造后缀数组?
  • RQ2能否在最优时间与空间内同时构造后缀数组与 LCP 数组?
  • RQ3是否可能在不增加额外内存的前提下,将类型数组与辅助数据结构存储在输出空间内?
  • RQ4能否仅使用 O(1) 额外字词,从后缀数组原地计算 LCP 数组?
  • RQ5所提出的方法在时间与空间效率上是否优于先前的原地算法?

主要发现

  • 本论文首次提出一种算法,可在 O(N) 时间和 O(1) 额外字词内为整数字母表构造后缀数组,实现最优的时间与空间复杂度。
  • 通过利用未使用的位,将类型数组和辅助数据结构(如 LE 数组)存储在输出后缀数组空间中,实现原地操作。
  • 该算法通过在逆后缀数组上进行从左到右扫描,将 ψ 数组原地转换为 LCP 数组,无需额外空间。
  • 该方法优于先前工作:Nong(TOIS 2013)需要 σ + O(1) 额外字词,Franceschini 与 Muthukrishnan(ICALP 2007)需要 O(N log N) 时间。
  • 该方法在 SA 与 LCP 构造中均实现了最优时间与空间复杂度,解决了字符串算法中的一个开放问题。
  • 提出一种简化的原地技术用于存储递归子数组边界,实现 O(1) 访问时间,而非 O(log N)。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。