Skip to main content
QUICK REVIEW

[论文解读] Dynamic Palindrome Detection

Amihood Amir, Itai Boneh|arXiv (Cornell University)|Jan 1, 2019
Algorithms and Data Compression参考文献 23被引用 6
一句话总结

本文提出了一种确定性动态算法,可在每次字符替换更新时以复杂度为 Õ(1) 的时间维护文本中最长回文子串,该复杂度基于动态最长公共前缀(LCP)数据结构的创新应用,以及回文与周期性运行的组合性质。关键贡献在于提出一种高效方法,通过周期性种子计算与聚类分析,在动态环境下检测并维护最长回文因子。

ABSTRACT

A string UU for a non-empty string U is called a square. Squares have been well-studied both from a combinatorial and an algorithmic perspective. In this paper, we are the first to consider the problem of maintaining a representation of the squares in a dynamic string S of length at most n. We present an algorithm that updates this representation in n^o(1) time. This representation allows us to report a longest square-substring of S in O(1) time and all square-substrings of S in O(output) time. We achieve this by introducing a novel tool - maintaining prefix-suffix matches of two dynamic strings. We extend the above result to address the problem of maintaining a representation of all runs (maximal repetitions) of the string. Runs are known to capture the periodic structure of a string, and, as an application, we show that our representation of runs allows us to efficiently answer periodicity queries for substrings of a dynamic string. These queries have proven useful in static pattern matching problems and our techniques have the potential of offering solutions to these problems in a dynamic text setting.

研究动机与目标

  • 解决在经历字符替换的文本中,缺乏高效动态算法来寻找最长回文的问题。
  • 设计一种支持高效更新与查询的动态字符串中最长回文子串的数据结构与算法。
  • 利用动态LCP与回文的新组合性质,实现亚对数时间复杂度的更新。
  • 证明最长回文可在每次编辑操作中以 Õ(1) 时间维护,显著优于每次修改后重新计算。

提出的方法

  • 为每个大小类别 s 维护一个优先队列(Q),存储该大小下的最长回文因子(LMPs)。
  • 使用动态最长公共前缀(LCP)查询比较子串,并检测回文运行中的周期性结构。
  • 应用子程序 FindCppPeriod,通过分析最大周期性回文(CPP)的前缀或后缀的LMP,计算聚类的周期性种子。
  • 在优先队列上使用后继与前驱查询,定位可能构成聚类内最大扩展(P*)的候选LMP。
  • 利用定理1,通过聚类起点与包含的LMP起点之间的距离计算聚类的周期 p,结合组合约束确保正确性。
  • 结合LCP查询与聚类分析,在每次字符编辑后高效检测并更新周期性回文结构。

实验结果

研究问题

  • RQ1在动态字符串中,能否以亚对数时间复杂度维护最长回文?
  • RQ2回文与周期性运行的哪些组合性质可实现高效的动态维护?
  • RQ3如何利用动态LCP数据结构高效检测与更新回文因子?
  • RQ4每次更新中,为确保正确性,需要检查的候选LMP的最小数量是多少?
  • RQ5能否仅使用局部信息,在亚对数时间内计算出回文聚类的周期性种子?

主要发现

  • 最长回文子串可在每次字符替换时以 Õ(1) 时间维护,实现亚对数时间复杂度的更新。
  • 该算法依赖于支持亚对数时间查询的动态LCP数据结构,从而实现子串的高效比较。
  • 每次更新中候选LMP的数量被限制在 O(log²n) 以内,确保可扩展性。
  • 通过定理1计算回文聚类的周期性种子,该定理将聚类与LMP起点之间的距离与最小周期关联起来。
  • 通过检查每个大小类别中最多四个候选聚类,并利用前驱与后继查询,正确识别出最大回文因子。
  • 总时间复杂度为 O(max(log⁴n, λ(n)·log²n)),其中 λ(n) 为动态LCP的耗时,当LCP以亚对数时间维护时,λ(n) 为 Õ(1)。

更好的研究,从现在开始

从论文设计到论文写作,大幅缩短您的研究时间。

无需绑定信用卡

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