Suffix trees are an important data structure at the core of optimal solutions to many fundamental string problems, such as exact pattern matching, longest common substring, matching statistics, and longest repeated substring. Recent lines of research focused on extending some of these problems to vertex-labeled graphs, although using ad-hoc approaches which in some cases do not generalize to all input graphs. In the absence of a ubiquitous tool like the suffix tree for labeled graphs, we introduce the labeled direct product of two graphs as a general tool for obtaining optimal algorithms: we obtain conceptually simpler algorithms for the quadratic problems of string matching (SMLG) and longest common substring (LCSP) in labeled graphs. Our algorithms are also more efficient, since they run in time linear in the size of the labeled product graph, which may be smaller than quadratic for some inputs, and their run-time is predictable, because the size of the labeled direct product graph can be precomputed efficiently. We also solve LCSP on graphs containing cycles, which was left as an open problem by Shimohira et al. in 2011. To show the power of the labeled product graph, we also apply it to solve the matching statistics (MSP) and the longest repeated string (LRSP) problems in labeled graphs. Moreover, we show that our (worst-case quadratic) algorithms are also optimal, conditioned on the Orthogonal Vectors Hypothesis. Finally, we complete the complexity picture around LRSP by studying it on undirected graphs.
Automated Pattern Detection--An Algorithm for Constructing Optimally Synchronizing Multi-Regular Language Filters
在一维元胞自动机的计算力学结构分析中,出现了以下来自时间序列分析的\emph{change-point problem}的自动机理论模拟:\emph{Given a string $σ$ and a collection $\{\mc{D}_i\}$ of finite automata, identify the regions of $σ$ that belong to each $\mc{D}_i$ and, in particular, the boundaries separating them.}我们提出了两种求解此\emph{multi-regular language filtering problem}的方法。第一种方法虽然提供了理想的解决方案,但需要堆栈,最坏情况下的计算时间以$σ$的长度二次增长,并在任意长的未来输入窗口上的任何点上调节其输出。第二种方法是在算法上构造近似于第一算法的换能器。然而,与基于堆栈的算法相比,传感器只需要有限的内存,在线性时间内运行,并为每个字母读取提供即时输出;此外,它是具有这三个特征的最佳有限状态近似。