Pattern Masking for Dictionary Matching
In the Pattern Masking for Dictionary Matching (PMDM) problem, we are given a dictionary π of d strings, each of length β, a query string q of length β, and a positive integer z, and we are asked to compute a smallest set Kβ{1,β¦,β}, so that if q[i], for all iβ K, is replaced by a wildcard, then q matches at least z strings from π. The PMDM problem lies at the heart of two important applications featured in large-scale real-world systems: record linkage of databases that contain sensitive information, and query term dropping. In both applications, solving PMDM allows for providing data utility guarantees as opposed to existing approaches. We first show, through a reduction from the well-known k-Clique problem, that a decision version of the PMDM problem is NP-complete, even for strings over a binary alphabet. We present a data structure for PMDM that answers queries over π in time πͺ(2^β/2(2^β/2+Ο)β) and requires space πͺ(2^βd^2/Ο^2+2^β/2d), for any parameter Οβ[1,d]. We also approach the problem from a more practical perspective. We show an πͺ((dβ)^k/3+dβ)-time and πͺ(dβ)-space algorithm for PMDM if k=|K|=πͺ(1). We generalize our exact algorithm to mask multiple query strings simultaneously. We complement our results by showing a two-way polynomial-time reduction between PMDM and the Minimum Union problem [ChlamtΓ‘Δ et al., SODA 2017]. This gives a polynomial-time πͺ(d^1/4+Ο΅)-approximation algorithm for PMDM, which is tight under plausible complexity conjectures.
READ FULL TEXT