Pattern matching queries on strings can be solved in linear time by Knuth-Morris-Pratt (KMP) algorithm. In 1973, Weiner introduced the suffix tree of a string [FOCS 1973] and showed that the seemingly more difficult problem of computing matching statistics can also be solved in liner time. Pattern matching queries on graphs are inherently more difficult: under the Orthogonal Vector hypothesis, the graph pattern matching problem cannot be solved in subquadratic time [TALG 2023]. The complexity of graph pattern matching can be parameterized by the topological complexity of the considered graph, which is captured by a parameter $ p $ [JACM 2023]. In this paper, we show that, as in the string setting, computing matching statistics on graph is as difficult as solving standard pattern matching queries. To this end, we introduce a notion of longest common prefix (LCP) array for arbitrary graphs.
翻译:字符串上的模式匹配查询可通过Knuth-Morris-Pratt(KMP)算法在线性时间内求解。1973年,Weiner引入了字符串的后缀树[FOCS 1973],并指出看似更困难的匹配统计量计算问题同样可在线性时间内解决。图上的模式匹配查询本质更具挑战性:在正交向量假设下,图模式匹配问题无法在次二次时间内求解[TALG 2023]。该问题的复杂度可通过所考虑图的拓扑复杂度进行参数化,该复杂度由参数$ p $刻画[JACM 2023]。本文证明,与字符串场景类似,图上的匹配统计量计算与标准模式匹配查询求解难度相当。为此,我们针对任意图引入了最长公共前缀(LCP)数组的概念。