Parameterized DAWGs: efficient constructions and bidirectional pattern searches
arXiv:2002.06786 · doi:10.1016/j.tcs.2022.09.008
Abstract
Two strings and over of equal length are said to \emph{parameterized match} (\emph{p-match}) if there is a renaming bijection that is identity on and transforms to (or vice versa). The \emph{p-matching} problem is to look for substrings in a text that p-match a given pattern. In this paper, we propose \emph{parameterized suffix automata} (\emph{p-suffix automata}) and \emph{parameterized directed acyclic word graphs} (\emph{PDAWGs}) which are the p-matching versions of suffix automata and DAWGs. While suffix automata and DAWGs are equivalent for standard strings, we show that p-suffix automata can have nodes and edges but PDAWGs have only nodes and edges, where is the length of an input string. We also give an -time -space algorithm that builds the PDAWG in a left-to-right online manner. As a byproduct, it is shown that the \emph{parameterized suffix tree} for the reversed string can also be built in the same time and space, in a right-to-left online manner. This duality also leads us to two further efficient algorithms for p-matching: Given the parameterized suffix tree for the reversal of the input string , one can build the PDAWG of in time in an offline manner; One can perform \emph{bidirectional} p-matching in time using space, where denotes the pattern length and is the number of pattern occurrences in the text .
28 pages, 7 figures