Permuted scaled matching
The authors show how, given a text \(T\) of length \(n\) over an alphabet \(\Sigma\) and a multiset \(P\) of \(m\) characters from the same alphabet, for all positive integers \(k\) simultaneously we can find all the substrings (called permuted \(k\)-scaled occurrences of \(P\)) of \(T\) that contain exactly \(k\) times as many copies of each distinct character as there are in \(P\). Specifically, they give an \(O (n \log |\Sigma|)\)-time deterministic algorithm and an \(O (n)\)-time Monte Carlo algorithm that return, for each distinct position \(i\), the smallest \(k\) (if one exists) such that \(T [i, i + k m - 1]\) is a permuted \(k\)-scaled occurrence of \(P\). This restricts the size of the possible output to \(O (n)\) without sacrificing any information since, if \(T [i, j]\) and \(T [j + 1, h]\) are permuted scaled occurrences of \(P\), then \(T [i, h]\) is as well.NEWLINENEWLINEThe first main idea behind the authors' algorithms is that \(T [i, j]\) is a permuted scaled occurrence of \(P\) if and only if the following conditions hold:NEWLINENEWLINE1) for each character \(\sigma \in \Sigma\), \(\#_\sigma (T [0, i - 1]) \equiv \#_\sigma (T [0, j]) \bmod \#_\sigma (P)\), where \(\#_\sigma\) returns the number of copies of \(\sigma\) in its argument;NEWLINENEWLINE2) for each consecutive pair of characters \(\sigma_\ell, \sigma_{\ell + 1} \in \Sigma\), NEWLINE\[NEWLINE\left\lfloor \frac{\#_{\sigma_\ell} (T [0, i - 1])}{\#_{\sigma_\ell (P)}} \right\rfloor - \left\lfloor \frac{\#_{\sigma_{\ell + 1}} (T [0, i - 1])}{\#_{\sigma_{\ell + 1} (P)}} \right\rfloor = \left\lfloor \frac{\#_{\sigma_\ell} (T [0, j])}{\#_{\sigma_\ell (P)}} \right\rfloor - \left\lfloor \frac{\#_{\sigma_{\ell + 1}} (T [0, j])}{\#_{\sigma_{\ell + 1} (P)}} \right\rfloor\;.NEWLINE\]NEWLINENEWLINENEWLINEThe second main idea is to compute for each position \(i\) in \(T\) a vector of length \(2 |\Sigma|\) whose components are, to start with, \(\#_\sigma (T [0, i - 1])\) for each character \(\sigma \in \Sigma\); next, \(\left\lfloor \frac{\#_{\sigma_\ell} (T [0, i - 1])}{\#_{\sigma_\ell (P)}} \right\rfloor - \left\lfloor \frac{\#_{\sigma_{\ell + 1}} (T [0, i - 1])}{\#_{\sigma_{\ell + 1} (P)}} \right\rfloor\) for each consecutive pair of characters \(\sigma_\ell, \sigma_{\ell + 1} \in \Sigma\); and, finally, \(i\). The vectors for positions \(i\) and \(j\) with \(i < j\) agree on their prefixes of length \(2 |\Sigma| - 1\) if and only if \(T [i, j]\) is a permuted scaled occurrence of \(P\). This immediately yields an \(O (n |\Sigma|)\)-time algorithm based on computing the vectors naïvely and radix-sorting them. The third main idea is to speed up the computation of the vectors using deterministic renaming or randomized hashing and the fact that vectors for consecutive positions differ on \(O (1)\) components. Applying a result by \textit{T. Kociumaka} et al. [J. Comput. Syst. Sci. 84, 205--218 (2017; Zbl 1353.68225)] to group the vectors on the basis of their first \(2 |\Sigma| - 1\) components, then yields the deterministic and Monte Carlo time bounds stated above.
- A fast string searching algorithm
- Algorithms for jumbled pattern matching in strings
- Alphabet-Independent and Scaled Dictionary Matching
- Clustered Integer 3SUM via Additive Combinatorics
- Deterministic Sampling–A New Technique for Fast Pattern Matching
- Efficient indexes for jumbled pattern matching with constant-sized alphabet
- Efficient one-dimensional real scaled matching
- Efficient pattern matching with scaling
- Efficient randomized pattern-matching algorithms
- Efficient text fingerprinting via Parikh mapping
- Fast algorithms for abelian periods in words and greatest common divisor queries
- Fast Pattern Matching in Strings
- Faster two dimensional scaled matching
- scientific article; zbMATH DE number 3471577 (Why is no real title available?)
- scientific article; zbMATH DE number 3551946 (Why is no real title available?)
- Near Linear Time Construction of an Approximate Index for All Maximum Consecutive Sub-sums of a Sequence
- On approximate jumbled pattern matching in strings
- On hardness of jumbled indexing
- Permuted scaled matching
- Real scaled matching
- Real two dimensional scaled matching
- Scaled and permuted string matching
- Sub-quadratic time and linear space data structures for permutation matching in binary strings
- Time-space-optimal string matching
This page was built for publication: Permuted scaled matching
Report a bug (only for logged in users!)Click here to report a bug for this page (MaRDI item Q294926)