English

Parameterized DAWGs: efficient constructions and bidirectional pattern searches

Data Structures and Algorithms 2022-09-19 v4

Abstract

Two strings xx and yy over ΣΠ\Sigma \cup \Pi of equal length are said to \emph{parameterized match} (\emph{p-match}) if there is a renaming bijection f:ΣΠΣΠf:\Sigma \cup \Pi \rightarrow \Sigma \cup \Pi that is identity on Σ\Sigma and transforms xx to yy (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 Θ(n2)\Theta(n^2) nodes and edges but PDAWGs have only O(n)O(n) nodes and edges, where nn is the length of an input string. We also give an O(nΠlog(Π+Σ))O(n |\Pi| \log (|\Pi| + |\Sigma|))-time O(n)O(n)-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 TT, one can build the PDAWG of TT in O(n)O(n) time in an offline manner; One can perform \emph{bidirectional} p-matching in O(mlog(Π+Σ)+occ)O(m \log (|\Pi|+|\Sigma|) + \mathit{occ}) time using O(n)O(n) space, where mm denotes the pattern length and occ\mathit{occ} is the number of pattern occurrences in the text TT.

Keywords

Cite

@article{arxiv.2002.06786,
  title  = {Parameterized DAWGs: efficient constructions and bidirectional pattern searches},
  author = {Katsuhito Nakashima and Noriki Fujisato and Diptarama Hendrian and Yuto Nakashima and Ryo Yoshinaka and Shunsuke Inenaga and Hideo Bannai and Ayumi Shinohara and Masayuki Takeda},
  journal= {arXiv preprint arXiv:2002.06786},
  year   = {2022}
}

Comments

28 pages, 7 figures

R2 v1 2026-06-23T13:43:33.676Z