The problem of String Matching to Labeled Graphs (SMLG) asks to find all the paths in a labeled graph $G = (V, E)$ whose spellings match that of an input string $S \in \Sigma^m$. SMLG can be solved in quadratic $O(m|E|)$ time [Amir et al., JALG], which was proven to be optimal by a recent lower bound conditioned on SETH [Equi et al., ICALP 2019]. The lower bound states that no strongly subquadratic time algorithm exists, even if restricted to directed acyclic graphs (DAGs). In this work we present the first parameterized algorithms for SMLG in DAGs. Our parameters capture the topological structure of $G$. All our results are derived from a generalization of the Knuth-Morris-Pratt algorithm [Park and Kim, CPM 1995] optimized to work in time proportional to the number of prefix-incomparable matches. To obtain the parameterization in the topological structure of $G$, we first study a special class of DAGs called funnels [Millani et al., JCO] and generalize them to $k$-funnels and the class $ST_k$. We present several novel characterizations and algorithmic contributions on both funnels and their generalizations.
翻译:字符串匹配标签图( SMLG) 的问题要求在一个标签的图形 $G = (V, E) $( V, E) $( V) $( V, E) $, 其拼法与输入字符串的拼法匹配 $S\\ sigma=m美元。 SMLG 可以用四角值$O( m ⁇ E) 美元时间[Amir et al., JALG] 找到所有路径。 事实证明,最近根据SETH [Equi et al., ICLP 2019] 设定的较低约束条件,这证明是最佳的。 下限表示不存在强烈的次赤道时间算法, 即使它局限于导出周期图( DAGs ) 的拼图 。 在 DAGs 中,我们提出了第一个参数用于 SMLG 的参数 $G 。 我们的所有结果来自Knuth- Morriss- Pratt 算法的概化[Park 和 IM 1995] 优化工作与前十六比较可比较值的算数 匹配。 。 在上, 我们SQQalalalal- 的分类中, 的分类的参数化为 Gal-, 的普通的常规结构中, 被称作为 。