The parameterized matching problem is a variant of string matching, which is to search for all parameterized occurrences of a pattern $P$ in a text $T$. In considering matching algorithms, the combinatorial natures of strings, especially periodicity, play an important role. In this paper, we analyze the properties of periods of parameterized strings and propose a generalization of Galil and Seiferas's exact matching algorithm (1980) into parameterized matching, which runs in $O(\pi|T|+|P|)$ time and $O(\log{|P|}+|{\rm\Pi}|)$ space in addition to the input space, where ${\rm\Pi}$ is the parameter alphabet and $\pi$ is the number of parameter characters appearing in $P$ plus one.
翻译:参数化匹配问题是字符串匹配的一种变体,旨在搜索文本$T$中模式$P$的所有参数化出现。在考虑匹配算法时,字符串的组合性质(尤其是周期性)起着重要作用。本文分析了参数化字符串周期的特性,并将Galil和Seiferas的精确匹配算法(1980)推广至参数化匹配场景。该算法的时间复杂度为$O(\pi|T|+|P|)$,除输入空间外,空间复杂度为$O(\log{|P|}+|{\rm\Pi}|)$,其中${\rm\Pi}$为参数字母表,$\pi$为模式$P$中出现的参数字符数加一。