Panagiotis Charalampopoulos, Huiping Chen, Peter Christen, Grigorios Loukides, Nadia Pisanti, Solon P. Pissis, Jakub Radoszewski
{"title":"用于字典匹配的模式屏蔽:理论与实践","authors":"Panagiotis Charalampopoulos, Huiping Chen, Peter Christen, Grigorios Loukides, Nadia Pisanti, Solon P. Pissis, Jakub Radoszewski","doi":"10.1007/s00453-024-01213-8","DOIUrl":null,"url":null,"abstract":"<div><p>Data masking is a common technique for sanitizing sensitive data maintained in database systems which is becoming increasingly important in various application areas, such as in record linkage of personal data. This work formalizes the Pattern Masking for Dictionary Matching (<span>PMDM</span>) problem: given a dictionary <span>\\(\\mathscr {D}\\)</span> of <i>d</i> strings, each of length <span>\\(\\ell \\)</span>, a query string <i>q</i> of length <span>\\(\\ell \\)</span>, and a positive integer <i>z</i>, we are asked to compute a smallest set <span>\\(K\\subseteq \\{1,\\ldots ,\\ell \\}\\)</span>, so that if <i>q</i>[<i>i</i>] is replaced by a wildcard for all <span>\\(i\\in K\\)</span>, then <i>q</i> matches at least <i>z</i> strings from <span>\\(\\mathscr {D}\\)</span>. Solving <span>PMDM</span> allows providing data utility guarantees as opposed to existing approaches. We first show, through a reduction from the well-known <i>k</i>-Clique problem, that a decision version of the <span>PMDM</span> problem is NP-complete, even for binary strings. We thus approach the problem from a more practical perspective. We show a combinatorial <span>\\(\\mathscr {O}((d\\ell )^{|K|/3}+d\\ell )\\)</span>-time and <span>\\(\\mathscr {O}(d\\ell )\\)</span>-space algorithm for <span>PMDM</span> for <span>\\(|K|=\\mathscr {O}(1)\\)</span>. In fact, we show that we cannot hope for a faster combinatorial algorithm, unless the combinatorial <i>k</i>-Clique hypothesis fails (Abboud et al. in SIAM J Comput 47:2527–2555, 2018; Lincoln et al., in: 29th ACM-SIAM Symposium on Discrete Algorithms (SODA), 2018). Our combinatorial algorithm, executed with small |<i>K</i>|, is the backbone of a greedy heuristic that we propose. Our experiments on real-world and synthetic datasets show that our heuristic finds nearly-optimal solutions in practice and is also very efficient. We also generalize this algorithm for the problem of masking multiple query strings simultaneously so that every string has at least <i>z</i> matches in <span>\\(\\mathscr {D}\\)</span>. <span>PMDM</span> can be viewed as a generalization of the decision version of the dictionary matching with mismatches problem: by querying a <span>PMDM</span> data structure with string <i>q</i> and <span>\\(z=1\\)</span>, one obtains the minimal number of mismatches of <i>q</i> with any string from <span>\\(\\mathscr {D}\\)</span>. The query time or space of all known data structures for the <i>more restricted</i> problem of dictionary matching with at most <i>k</i> mismatches incurs some exponential factor with respect to <i>k</i>. A simple exact algorithm for <span>PMDM</span> runs in time <span>\\(\\mathscr {O}(2^\\ell d)\\)</span>. We present a data structure for <span>PMDM</span> that answers queries over <span>\\(\\mathscr {D}\\)</span> in time <span>\\(\\mathscr {O}(2^{\\ell /2}(2^{\\ell /2}+\\tau )\\ell )\\)</span> and requires space <span>\\(\\mathscr {O}(2^{\\ell }d^2/\\tau ^2+2^{\\ell /2}d)\\)</span>, for any parameter <span>\\(\\tau \\in [1,d]\\)</span>. We complement our results by showing a two-way polynomial-time reduction between <span>PMDM</span> and the Minimum Union problem [Chlamtáč et al., ACM-SIAM Symposium on Discrete Algorithms (SODA) 2017]. This gives a polynomial-time <span>\\(\\mathscr {O}(d^{1/4+\\epsilon })\\)</span>-approximation algorithm for <span>PMDM</span>, which is tight under a plausible complexity conjecture. This is an extended version of a paper that was presented at International Symposium on Algorithms and Computation (ISAAC) 2021.\n</p></div>","PeriodicalId":50824,"journal":{"name":"Algorithmica","volume":"86 6","pages":"1948 - 1978"},"PeriodicalIF":0.9000,"publicationDate":"2024-03-06","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"https://link.springer.com/content/pdf/10.1007/s00453-024-01213-8.pdf","citationCount":"0","resultStr":"{\"title\":\"Pattern Masking for Dictionary Matching: Theory and Practice\",\"authors\":\"Panagiotis Charalampopoulos, Huiping Chen, Peter Christen, Grigorios Loukides, Nadia Pisanti, Solon P. Pissis, Jakub Radoszewski\",\"doi\":\"10.1007/s00453-024-01213-8\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"<div><p>Data masking is a common technique for sanitizing sensitive data maintained in database systems which is becoming increasingly important in various application areas, such as in record linkage of personal data. This work formalizes the Pattern Masking for Dictionary Matching (<span>PMDM</span>) problem: given a dictionary <span>\\\\(\\\\mathscr {D}\\\\)</span> of <i>d</i> strings, each of length <span>\\\\(\\\\ell \\\\)</span>, a query string <i>q</i> of length <span>\\\\(\\\\ell \\\\)</span>, and a positive integer <i>z</i>, we are asked to compute a smallest set <span>\\\\(K\\\\subseteq \\\\{1,\\\\ldots ,\\\\ell \\\\}\\\\)</span>, so that if <i>q</i>[<i>i</i>] is replaced by a wildcard for all <span>\\\\(i\\\\in K\\\\)</span>, then <i>q</i> matches at least <i>z</i> strings from <span>\\\\(\\\\mathscr {D}\\\\)</span>. Solving <span>PMDM</span> allows providing data utility guarantees as opposed to existing approaches. We first show, through a reduction from the well-known <i>k</i>-Clique problem, that a decision version of the <span>PMDM</span> problem is NP-complete, even for binary strings. We thus approach the problem from a more practical perspective. We show a combinatorial <span>\\\\(\\\\mathscr {O}((d\\\\ell )^{|K|/3}+d\\\\ell )\\\\)</span>-time and <span>\\\\(\\\\mathscr {O}(d\\\\ell )\\\\)</span>-space algorithm for <span>PMDM</span> for <span>\\\\(|K|=\\\\mathscr {O}(1)\\\\)</span>. In fact, we show that we cannot hope for a faster combinatorial algorithm, unless the combinatorial <i>k</i>-Clique hypothesis fails (Abboud et al. in SIAM J Comput 47:2527–2555, 2018; Lincoln et al., in: 29th ACM-SIAM Symposium on Discrete Algorithms (SODA), 2018). Our combinatorial algorithm, executed with small |<i>K</i>|, is the backbone of a greedy heuristic that we propose. Our experiments on real-world and synthetic datasets show that our heuristic finds nearly-optimal solutions in practice and is also very efficient. We also generalize this algorithm for the problem of masking multiple query strings simultaneously so that every string has at least <i>z</i> matches in <span>\\\\(\\\\mathscr {D}\\\\)</span>. <span>PMDM</span> can be viewed as a generalization of the decision version of the dictionary matching with mismatches problem: by querying a <span>PMDM</span> data structure with string <i>q</i> and <span>\\\\(z=1\\\\)</span>, one obtains the minimal number of mismatches of <i>q</i> with any string from <span>\\\\(\\\\mathscr {D}\\\\)</span>. The query time or space of all known data structures for the <i>more restricted</i> problem of dictionary matching with at most <i>k</i> mismatches incurs some exponential factor with respect to <i>k</i>. A simple exact algorithm for <span>PMDM</span> runs in time <span>\\\\(\\\\mathscr {O}(2^\\\\ell d)\\\\)</span>. We present a data structure for <span>PMDM</span> that answers queries over <span>\\\\(\\\\mathscr {D}\\\\)</span> in time <span>\\\\(\\\\mathscr {O}(2^{\\\\ell /2}(2^{\\\\ell /2}+\\\\tau )\\\\ell )\\\\)</span> and requires space <span>\\\\(\\\\mathscr {O}(2^{\\\\ell }d^2/\\\\tau ^2+2^{\\\\ell /2}d)\\\\)</span>, for any parameter <span>\\\\(\\\\tau \\\\in [1,d]\\\\)</span>. We complement our results by showing a two-way polynomial-time reduction between <span>PMDM</span> and the Minimum Union problem [Chlamtáč et al., ACM-SIAM Symposium on Discrete Algorithms (SODA) 2017]. This gives a polynomial-time <span>\\\\(\\\\mathscr {O}(d^{1/4+\\\\epsilon })\\\\)</span>-approximation algorithm for <span>PMDM</span>, which is tight under a plausible complexity conjecture. This is an extended version of a paper that was presented at International Symposium on Algorithms and Computation (ISAAC) 2021.\\n</p></div>\",\"PeriodicalId\":50824,\"journal\":{\"name\":\"Algorithmica\",\"volume\":\"86 6\",\"pages\":\"1948 - 1978\"},\"PeriodicalIF\":0.9000,\"publicationDate\":\"2024-03-06\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"https://link.springer.com/content/pdf/10.1007/s00453-024-01213-8.pdf\",\"citationCount\":\"0\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"Algorithmica\",\"FirstCategoryId\":\"94\",\"ListUrlMain\":\"https://link.springer.com/article/10.1007/s00453-024-01213-8\",\"RegionNum\":4,\"RegionCategory\":\"计算机科学\",\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"Q4\",\"JCRName\":\"COMPUTER SCIENCE, SOFTWARE ENGINEERING\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"Algorithmica","FirstCategoryId":"94","ListUrlMain":"https://link.springer.com/article/10.1007/s00453-024-01213-8","RegionNum":4,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q4","JCRName":"COMPUTER SCIENCE, SOFTWARE ENGINEERING","Score":null,"Total":0}
Pattern Masking for Dictionary Matching: Theory and Practice
Data masking is a common technique for sanitizing sensitive data maintained in database systems which is becoming increasingly important in various application areas, such as in record linkage of personal data. This work formalizes the Pattern Masking for Dictionary Matching (PMDM) problem: given a dictionary \(\mathscr {D}\) of d strings, each of length \(\ell \), a query string q of length \(\ell \), and a positive integer z, we are asked to compute a smallest set \(K\subseteq \{1,\ldots ,\ell \}\), so that if q[i] is replaced by a wildcard for all \(i\in K\), then q matches at least z strings from \(\mathscr {D}\). Solving PMDM allows 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 binary strings. We thus approach the problem from a more practical perspective. We show a combinatorial \(\mathscr {O}((d\ell )^{|K|/3}+d\ell )\)-time and \(\mathscr {O}(d\ell )\)-space algorithm for PMDM for \(|K|=\mathscr {O}(1)\). In fact, we show that we cannot hope for a faster combinatorial algorithm, unless the combinatorial k-Clique hypothesis fails (Abboud et al. in SIAM J Comput 47:2527–2555, 2018; Lincoln et al., in: 29th ACM-SIAM Symposium on Discrete Algorithms (SODA), 2018). Our combinatorial algorithm, executed with small |K|, is the backbone of a greedy heuristic that we propose. Our experiments on real-world and synthetic datasets show that our heuristic finds nearly-optimal solutions in practice and is also very efficient. We also generalize this algorithm for the problem of masking multiple query strings simultaneously so that every string has at least z matches in \(\mathscr {D}\). PMDM can be viewed as a generalization of the decision version of the dictionary matching with mismatches problem: by querying a PMDM data structure with string q and \(z=1\), one obtains the minimal number of mismatches of q with any string from \(\mathscr {D}\). The query time or space of all known data structures for the more restricted problem of dictionary matching with at most k mismatches incurs some exponential factor with respect to k. A simple exact algorithm for PMDM runs in time \(\mathscr {O}(2^\ell d)\). We present a data structure for PMDM that answers queries over \(\mathscr {D}\) in time \(\mathscr {O}(2^{\ell /2}(2^{\ell /2}+\tau )\ell )\) and requires space \(\mathscr {O}(2^{\ell }d^2/\tau ^2+2^{\ell /2}d)\), for any parameter \(\tau \in [1,d]\). We complement our results by showing a two-way polynomial-time reduction between PMDM and the Minimum Union problem [Chlamtáč et al., ACM-SIAM Symposium on Discrete Algorithms (SODA) 2017]. This gives a polynomial-time \(\mathscr {O}(d^{1/4+\epsilon })\)-approximation algorithm for PMDM, which is tight under a plausible complexity conjecture. This is an extended version of a paper that was presented at International Symposium on Algorithms and Computation (ISAAC) 2021.
期刊介绍:
Algorithmica is an international journal which publishes theoretical papers on algorithms that address problems arising in practical areas, and experimental papers of general appeal for practical importance or techniques. The development of algorithms is an integral part of computer science. The increasing complexity and scope of computer applications makes the design of efficient algorithms essential.
Algorithmica covers algorithms in applied areas such as: VLSI, distributed computing, parallel processing, automated design, robotics, graphics, data base design, software tools, as well as algorithms in fundamental areas such as sorting, searching, data structures, computational geometry, and linear programming.
In addition, the journal features two special sections: Application Experience, presenting findings obtained from applications of theoretical results to practical situations, and Problems, offering short papers presenting problems on selected topics of computer science.