We study the problem of finding maximal exact matches (MEMs) between a query string $Q$ and a labeled directed acyclic graph (DAG) $G=(V,E,\ell)$ and subsequently co-linearly chaining these matches. We show that it suffices to compute MEMs between node labels and $Q$ (node MEMs) to encode full MEMs. Node MEMs can be computed in linear time and we show how to co-linearly chain them to solve the Longest Common Subsequence (LCS) problem between $Q$ and $G$. Our chaining algorithm is the first to consider a symmetric formulation of the chaining problem in graphs and runs in $O(k^2|V| + |E| + kN\log N)$ time, where $k$ is the width (minimum number of paths covering the nodes) of $G$, and $N$ is the number of node MEMs. We then consider the problem of finding MEMs when the input graph is an indexable elastic founder graph (subclass of labeled DAGs studied by Equi et al., Algorithmica 2022). For arbitrary input graphs, the problem cannot be solved in truly sub-quadratic time under SETH (Equi et al., ICALP 2019). We show that we can report all MEMs between $Q$ and an indexable elastic founder graph in time $O(nH^2 + m + M_\kappa)$, where $n$ is the total length of node labels, $H$ is the maximum number of nodes in a block of the graph, $m = |Q|$, and $M_\kappa$ is the number of MEMs of length at least $\kappa$.
翻译:我们研究了在查询字符串$Q$与标记有向无环图(DAG)$G=(V,E,\ell)$之间寻找最大精确匹配(MEMs)并随后将这些匹配共线性链接的问题。我们证明,只需计算节点标签与$Q$之间的MEMs(节点MEMs)即可编码完整的MEMs。节点MEMs可在线性时间内计算,并展示了如何通过共线性链接这些匹配来解决$Q$与$G$之间的最长公共子序列(LCS)问题。我们的链接算法首次考虑了图中链接问题的对称形式,时间复杂度为$O(k^2|V| + |E| + kN\log N)$,其中$k$是$G$的宽度(覆盖所有节点的最少路径数),$N$是节点MEMs的数量。接着,我们研究了当输入图为可索引弹性创始者图(Equi等人于Algorithmica 2022研究的标记DAG子类)时寻找MEMs的问题。对于任意输入图,该问题在SETH假设下无法在真正次二次时间内解决(Equi等人,ICALP 2019)。我们证明,可以在$O(nH^2 + m + M_\kappa)$时间内报告$Q$与可索引弹性创始者图之间的所有MEMs,其中$n$是节点标签的总长度,$H$是图中一个块内的最大节点数,$m = |Q|$,$M_\kappa$是长度至少为$\kappa$的MEMs数量。