The classic string indexing problem is to preprocess a string S into a compact data structure that supports efficient pattern matching queries. Typical queries include existential queries (decide if the pattern occurs in S), reporting queries (return all positions where the pattern occurs), and counting queries (return the number of occurrences of the pattern). In this paper we consider a variant of string indexing, where the goal is to compactly represent the string such that given two patterns P1 and P2 and a gap range [\alpha,\beta] we can quickly find the consecutive occurrences of P1 and P2 with distance in [\alpha,\beta], i.e., pairs of occurrences immediately following each other and with distance within the range. We present data structures that use \~O(n) space and query time \~O(|P1|+|P2|+n^(2/3)) for existence and counting and \~O(|P1|+|P2|+n^(2/3)*occ^(1/3)) for reporting. We complement this with a conditional lower bound based on the set intersection problem showing that any solution using \~O(n) space must use \tilde{\Omega}}(|P1|+|P2|+\sqrt{n}) query time. To obtain our results we develop new techniques and ideas of independent interest including a new suffix tree decomposition and hardness of a variant of the set intersection problem.
翻译:经典的字符串索引问题在于将字符串 S 预处理成一个支持高效模式匹配查询的紧凑数据结构。 典型的查询包括存在查询( 确定模式是否发生在 S ) 、 报告查询( 返回模式发生的所有位置 ) 和计数查询( 返回模式发生的次数 ) 。 在本文中, 我们考虑一个字符串索引的变式, 其目标在于缩略地代表字符串, 以便根据两种模式 P1 和 P2 以及差距范围[\ alpha,\beta], 我们很快发现P1 和 P2 连续出现的连续发生, 距离在[\ alpha,\beta], 也就是说, 相继发生事件的对齐, 距离在范围以内。 我们展示数据结构, \\O( n) 空间和查询时间 {O( \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\