Counting Distinct Patterns in Internal Dictionary Matching

P. Charalampopoulos, T. Kociumaka, Manal Mohamed, J. Radoszewski, W. Rytter, Juliusz Straszy'nski, Tomasz Wale'n, Wiktor Zuba
{"title":"Counting Distinct Patterns in Internal Dictionary Matching","authors":"P. Charalampopoulos, T. Kociumaka, Manal Mohamed, J. Radoszewski, W. Rytter, Juliusz Straszy'nski, Tomasz Wale'n, Wiktor Zuba","doi":"10.4230/LIPIcs.CPM.2020.8","DOIUrl":null,"url":null,"abstract":"We consider the problem of preprocessing a text $T$ of length $n$ and a dictionary $\\mathcal{D}$ in order to be able to efficiently answer queries $CountDistinct(i,j)$, that is, given $i$ and $j$ return the number of patterns from $\\mathcal{D}$ that occur in the fragment $T[i \\mathinner{.\\,.} j]$. The dictionary is internal in the sense that each pattern in $\\mathcal{D}$ is given as a fragment of $T$. This way, the dictionary takes space proportional to the number of patterns $d=|\\mathcal{D}|$ rather than their total length, which could be $\\Theta(n\\cdot d)$. An $\\tilde{\\mathcal{O}}(n+d)$-size data structure that answers $CountDistinct(i,j)$ queries $\\mathcal{O}(\\log n)$-approximately in $\\tilde{\\mathcal{O}}(1)$ time was recently proposed in a work that introduced internal dictionary matching [ISAAC 2019]. Here we present an $\\tilde{\\mathcal{O}}(n+d)$-size data structure that answers $CountDistinct(i,j)$ queries $2$-approximately in $\\tilde{\\mathcal{O}}(1)$ time. Using range queries, for any $m$, we give an $\\tilde{\\mathcal{O}}(\\min(nd/m,n^2/m^2)+d)$-size data structure that answers $CountDistinct(i,j)$ queries exactly in $\\tilde{\\mathcal{O}}(m)$ time. We also consider the special case when the dictionary consists of all square factors of the string. We design an $\\mathcal{O}(n \\log^2 n)$-size data structure that allows us to count distinct squares in a text fragment $T[i \\mathinner{.\\,.} j]$ in $\\mathcal{O}(\\log n)$ time.","PeriodicalId":236737,"journal":{"name":"Annual Symposium on Combinatorial Pattern Matching","volume":"493 1-2 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2020-05-12","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"8","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Annual Symposium on Combinatorial Pattern Matching","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.4230/LIPIcs.CPM.2020.8","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 8

Abstract

We consider the problem of preprocessing a text $T$ of length $n$ and a dictionary $\mathcal{D}$ in order to be able to efficiently answer queries $CountDistinct(i,j)$, that is, given $i$ and $j$ return the number of patterns from $\mathcal{D}$ that occur in the fragment $T[i \mathinner{.\,.} j]$. The dictionary is internal in the sense that each pattern in $\mathcal{D}$ is given as a fragment of $T$. This way, the dictionary takes space proportional to the number of patterns $d=|\mathcal{D}|$ rather than their total length, which could be $\Theta(n\cdot d)$. An $\tilde{\mathcal{O}}(n+d)$-size data structure that answers $CountDistinct(i,j)$ queries $\mathcal{O}(\log n)$-approximately in $\tilde{\mathcal{O}}(1)$ time was recently proposed in a work that introduced internal dictionary matching [ISAAC 2019]. Here we present an $\tilde{\mathcal{O}}(n+d)$-size data structure that answers $CountDistinct(i,j)$ queries $2$-approximately in $\tilde{\mathcal{O}}(1)$ time. Using range queries, for any $m$, we give an $\tilde{\mathcal{O}}(\min(nd/m,n^2/m^2)+d)$-size data structure that answers $CountDistinct(i,j)$ queries exactly in $\tilde{\mathcal{O}}(m)$ time. We also consider the special case when the dictionary consists of all square factors of the string. We design an $\mathcal{O}(n \log^2 n)$-size data structure that allows us to count distinct squares in a text fragment $T[i \mathinner{.\,.} j]$ in $\mathcal{O}(\log n)$ time.
查看原文
分享 分享
微信好友 朋友圈 QQ好友 复制链接
本刊更多论文
计算内部字典匹配中的不同模式
我们考虑预处理长度为$n$的文本$T$和字典$\mathcal{D}$的问题,以便能够有效地回答查询$CountDistinct(i,j)$,也就是说,给定$i$和$j$返回$\mathcal{D}$中出现在片段$T[i \mathinner{.\,.} j]$中的模式的数量。字典是内部的,因为$\mathcal{D}$中的每个模式都是作为$T$的一个片段给出的。这样,字典占用的空间与模式的数量成正比$d=|\mathcal{D}|$,而不是它们的总长度,可能是$\Theta(n\cdot d)$。最近在一项引入内部字典匹配的工作中提出了一个$\tilde{\mathcal{O}}(n+d)$ -大小的数据结构,该结构大约在$\tilde{\mathcal{O}}(1)$时间内回答$CountDistinct(i,j)$查询$\mathcal{O}(\log n)$ -。这里我们给出一个$\tilde{\mathcal{O}}(n+d)$ -大小的数据结构,它回答$CountDistinct(i,j)$查询$2$ -大约在$\tilde{\mathcal{O}}(1)$时间内。使用范围查询,对于任何$m$,我们给出一个$\tilde{\mathcal{O}}(\min(nd/m,n^2/m^2)+d)$大小的数据结构,它在$\tilde{\mathcal{O}}(m)$时间内准确地回答$CountDistinct(i,j)$查询。我们还考虑了字典由字符串的所有平方因子组成的特殊情况。我们设计了一个$\mathcal{O}(n \log^2 n)$ -大小的数据结构,它允许我们在$\mathcal{O}(\log n)$时间内计算文本片段$T[i \mathinner{.\,.} j]$中不同的正方形。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 去求助
来源期刊
自引率
0.00%
发文量
0
期刊最新文献
Optimal LZ-End Parsing is Hard From Bit-Parallelism to Quantum String Matching for Labelled Graphs Order-Preserving Squares in Strings Sliding Window String Indexing in Streams Parameterized Algorithms for String Matching to DAGs: Funnels and Beyond
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
现在去查看 取消
×
提示
确定
0
微信
客服QQ
Book学术公众号 扫码关注我们
反馈
×
意见反馈
请填写您的意见或建议
请填写您的手机或邮箱
已复制链接
已复制链接
快去分享给好友吧!
我知道了
×
扫码分享
扫码分享
Book学术官方微信
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术
文献互助 智能选刊 最新文献 互助须知 联系我们:info@booksci.cn
Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。
Copyright © 2023 Book学术 All rights reserved.
ghs 京公网安备 11010802042870号 京ICP备2023020795号-1