arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2010.07076cs.DS
收藏

上下文模式匹配

Contextual Pattern Matching

University of Chile(智利大学)

Gonzalo Navarro

AI总结:

本文针对重复字符串集合索引场景提出上下文模式匹配新查询,给出首个利用集合重复性相关空间的解决方案,实现了不同空间时间权衡,可高效查找指定上下文长度下的模式出现情况。

摘要:

针对重复字符串集合的索引研究,一直聚焦于常规字符串集合所用的相同搜索问题,但这类问题在重复集合场景下可能意义不大。例如,基础模式匹配查询“列出模式P出现的所有位置”,当P出现在多个文档共享的区域时会产生海量输出,而这些出现本质上是相同的。本文提出一种更适配这类集合的新查询,称为“上下文模式匹配”。这类查询的基础形式除模式P外,还指定上下文长度ℓ,要求报告所有满足|X|=|Y|=ℓ的不同字符串XPY的出现情况。该查询虽可在最优时间和线性空间内轻松解决,但本文聚焦于利用与文本集合重复性相关的空间,提出首个此类解决方案。设$\tilde{r}$为文本T[1..n]的BWT的游程数与其反转文本的游程数的最大值,本文提出的结构使用$O(\tilde{r}\text{log}(n/\tilde{r}))$的空间,可在$O(|P| + c\text{log}n)$时间内找到(P,ℓ)的c个上下文出现XPY。本文还证明,在$O(\tilde{r})$的空间内,该问题可在$O((m+\text{λ}\text{·}\text{occ})\text{log}\text{log}n)$时间内解决,同时针对压缩和未压缩索引,本文还给出了其他空间/时间权衡方案。

英文摘要:

The research on indexing repetitive string collections has focused on the same search problems used for regular string collections, though they can make little sense in this scenario. For example, the basic pattern matching query "list all the positions where pattern $P$ appears" can produce huge outputs when $P$ appears in an area shared by many documents. All those occurrences are essentially the same. In this paper we propose a new query that can be more appropriate in these collections, which we call {\em contextual pattern matching}. The basic query of this type gives, in addition to $P$, a context length $\ell$, and asks to report the occurrences of all {\em distinct} strings $XPY$, with $|X|=|Y|=\ell$. While this query is easily solved in optimal time and linear space, we focus on using space related to the repetitiveness of the text collection and present the first solution of this kind. Letting $\ovr$ be the maximum of the number of runs in the BWT of the text $T[1..n]$ and of its reverse, our structure uses $O(\ovr\log(n/\ovr))$ space and finds the $c$ contextual occurrences $XPY$ of $(P,\ell)$ in time $O(|P| + c \log n)$. We also show how, within space $O(\ovr)$, the problem can be solved in time $O((m+λ\cdot occ)\log\log n)$. We give other space/time tradeoffs as well, for compressed and uncompressed indexes.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑