在线计算在Trie上的回文和后缀树
Online Computation of Palindromes and Suffix Trees on Tries
AI总结:
本文提出亚二次算法在线计算动态Trie中的回文和后缀树,支持叶节点的增删操作。
摘要:
我们考虑在Trie中计算最大回文和不同回文的问题。Trie是字符串的自然推广,可以看作是一个单路径树。存在一个线性时间的离线算法,用于计算给定(静态)Trie中的最大回文和不同回文,其边标签来自可线性排序的字母表[Mieno等,ISAAC 2022]。在本文中,我们处理支持叶节点添加和删除的动态Trie上的回文枚举问题。我们提出了第一个亚二次算法来枚举动态Trie中的回文。对于最大回文,我们提出了一种运行时间为O(N min(log h, σ))且使用O(N)空间的算法,其中N是Trie中的最大边数,σ是字母表的大小,h是Trie的高度。对于不同的回文,我们开发了几种基于不同算法框架的在线算法,包括使用EERTREE(即回文树)和Trie的后缀树的方法。这些算法支持在Trie中插入和删除叶节点,并实现了不同的时间和空间权衡。此外,作为副产品,我们提出了构建输入Trie的后缀树和EERTREE的在线算法,这具有独立的兴趣。
英文摘要:
We consider the problems of computing maximal palindromes and distinct palindromes in a trie. A trie is a natural generalization of a string, which can be seen as a single-path tree. There is a linear-time offline algorithm to compute maximal palindromes and distinct palindromes in a given (static) trie whose edge-labels are drawn from a linearly-sortable alphabet [Mieno et al., ISAAC 2022]. In this paper, we tackle problems of palindrome enumeration on dynamic tries which support leaf additions and leaf deletions. We propose the first sub-quadratic algorithms to enumerate palindromes in a dynamic trie. For maximal palindromes, we propose an algorithm that runs in $O(N \min(\log h, σ))$ time and uses $O(N)$ space, where $N$ is the maximum number of edges in the trie, $σ$ is the size of the alphabet, and $h$ is the height of the trie. For distinct palindromes, we develop several online algorithms based on different algorithmic frameworks, including approaches using the EERTREE (a.k.a. palindromic tree) and the suffix tree of a trie. These algorithms support leaf insertions and deletions in the trie and achieve different time and space trade-offs. Furthermore, as a by-product, we present online algorithms to construct the suffix tree and the EERTREE of the input trie, which is of independent interest.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。