一种保序匹配编码
An Encoding for Order-Preserving Matching
摘要:
编码数据结构存储了足够的信息来回答它们应该支持的查询,但不足以恢复它们的底层数据集。在本文中,我们给出了第一个编码数据结构的保序模式匹配的挑战性问题。这个问题仅仅在几年前才被引入,但由于其在数据分析中的应用,已经引起了极大的关注。如果两个字符串的字符的{ \em相对顺序}相同,则称这两个字符串是保序匹配:例如,$4, 1, 3, 2$和$10, 3, 7, 5$是保序匹配。我们展示了如何,给定一个字符串$S [1..n]$在一个任意的字母表和一个常数$c \geq 1$,我们可以建立一个$O (n \log \log n)$位编码,这样以后,给定一个模式$P [1..m]$与$m \leq \lg^c n$,我们可以返回的顺序保持$P$在$O (m)$时间$S$出现的次数。在相同的时间范围内,我们还可以返回$S$中$P$的某个保序匹配的起始位置(如果存在这样的匹配)。我们证明,我们的空间范围是在一个恒定的因素最优,我们的查询时间是最优的,如果$\log σ= Ω(\log n)$。我们的空间界限与在最坏的情况下存储$S$本身所需的$Ω(n \log n)$位形成对比,该位是对模式长度没有限制的保序模式匹配的索引,或者是对模式长度有限制的标准模式匹配的索引。此外,我们可以只知道每个字符与$O (\lg^c n)$相邻字符的比较情况来构建编码。
英文摘要:
Encoding data structures store enough information to answer the queries they are meant to support but not enough to recover their underlying datasets. In this paper we give the first encoding data structure for the challenging problem of order-preserving pattern matching. This problem was introduced only a few years ago but has already attracted significant attention because of its applications in data analysis. Two strings are said to be an order-preserving match if the {\em relative order} of their characters is the same: e.g., $4, 1, 3, 2$ and $10, 3, 7, 5$ are an order-preserving match. We show how, given a string $S [1..n]$ over an arbitrary alphabet and a constant $c \geq 1$, we can build an $O (n \log \log n)$-bit encoding such that later, given a pattern $P [1..m]$ with $m \leq \lg^c n$, we can return the number of order-preserving occurrences of $P$ in $S$ in $O (m)$ time. Within the same time bound we can also return the starting position of some order-preserving match for $P$ in $S$ (if such a match exists). We prove that our space bound is within a constant factor of optimal; our query time is optimal if $\log σ= Ω(\log n)$. Our space bound contrasts with the $Ω(n \log n)$ bits needed in the worst case to store $S$ itself, an index for order-preserving pattern matching with no restrictions on the pattern length, or an index for standard pattern matching even with restrictions on the pattern length. Moreover, we can build our encoding knowing only how each character compares to $O (\lg^c n)$ neighbouring characters.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。