Faster and simpler online computation of string net frequency

IF 0.6 4区 计算机科学 Q4 COMPUTER SCIENCE, INFORMATION SYSTEMS
Information Processing Letters Pub Date : 2026-04-01 Epub Date: 2026-01-15 DOI:10.1016/j.ipl.2026.106620
Shunsuke Inenaga
{"title":"Faster and simpler online computation of string net frequency","authors":"Shunsuke Inenaga","doi":"10.1016/j.ipl.2026.106620","DOIUrl":null,"url":null,"abstract":"<div><div>An occurrence of a repeated substring <em>u</em> in a string <em>S</em> is called a <em>net occurrence</em> if extending the occurrence to the left or to the right decreases the number of occurrences to 1. The <em>net frequency</em> (<em>NF</em>) of a repeated substring <em>u</em> in a string <em>S</em> is the number of net occurrences of <em>u</em> in <em>S</em>. Very recently, Guo et al. [SPIRE 2024] proposed an online <em>O</em>(<em>n</em>log <em>σ</em>)-time algorithm that maintains a data structure of <em>O</em>(<em>n</em>) space which answers <span>Single-NF</span> queries in <span><math><mrow><mi>O</mi><mo>(</mo><mi>m</mi><mi>log</mi><mi>σ</mi><mo>+</mo><msup><mi>σ</mi><mn>2</mn></msup><mo>)</mo></mrow></math></span> time and reports all answers of the <span>All-NF</span> problem in <em>O</em>(<em>nσ</em><sup>2</sup>) time. Here, <em>n</em> is the length of the input string <em>S, m</em> is the query pattern length, and <em>σ</em> is the alphabet size. The <em>σ</em><sup>2</sup> term is a major drawback of their method since computing string net frequencies is originally motivated for Chinese language text processing where <em>σ</em> can be thousands large. This paper presents an improved online <em>O</em>(<em>n</em>log <em>σ</em>)-time algorithm, which answers <span>Single-NF</span> queries in <em>O</em>(<em>m</em>log <em>σ</em>) time and reports all answers to the <span>All-NF</span> problem in output-optimal <span><math><mrow><mi>O</mi><mo>(</mo><mo>|</mo><msup><mi>NF</mi><mo>+</mo></msup><mrow><mo>(</mo><mi>S</mi><mo>)</mo></mrow><mo>|</mo><mo>)</mo></mrow></math></span> time, where <span><math><mrow><msup><mi>NF</mi><mo>+</mo></msup><mrow><mo>(</mo><mi>S</mi><mo>)</mo></mrow></mrow></math></span> is the set of substrings of <em>S</em> paired with their positive NF values. We note that <span><math><mrow><mrow><mo>|</mo></mrow><msup><mi>NF</mi><mo>+</mo></msup><mrow><mrow><mo>(</mo><mi>S</mi><mo>)</mo></mrow><mo>|</mo><mo>=</mo><mi>O</mi><mrow><mo>(</mo><mi>n</mi><mo>)</mo></mrow></mrow></mrow></math></span> always holds. In contrast to Guo et al.’s algorithm that is based on Ukkonen’s suffix tree construction, our algorithm is based on Weiner’s suffix tree construction.</div></div>","PeriodicalId":56290,"journal":{"name":"Information Processing Letters","volume":"193 ","pages":"Article 106620"},"PeriodicalIF":0.6000,"publicationDate":"2026-04-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Information Processing Letters","FirstCategoryId":"94","ListUrlMain":"https://www.sciencedirect.com/science/article/pii/S0020019026000013","RegionNum":4,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"2026/1/15 0:00:00","PubModel":"Epub","JCR":"Q4","JCRName":"COMPUTER SCIENCE, INFORMATION SYSTEMS","Score":null,"Total":0}
引用次数: 0

Abstract

An occurrence of a repeated substring u in a string S is called a net occurrence if extending the occurrence to the left or to the right decreases the number of occurrences to 1. The net frequency (NF) of a repeated substring u in a string S is the number of net occurrences of u in S. Very recently, Guo et al. [SPIRE 2024] proposed an online O(nlog σ)-time algorithm that maintains a data structure of O(n) space which answers Single-NF queries in O(mlogσ+σ2) time and reports all answers of the All-NF problem in O(nσ2) time. Here, n is the length of the input string S, m is the query pattern length, and σ is the alphabet size. The σ2 term is a major drawback of their method since computing string net frequencies is originally motivated for Chinese language text processing where σ can be thousands large. This paper presents an improved online O(nlog σ)-time algorithm, which answers Single-NF queries in O(mlog σ) time and reports all answers to the All-NF problem in output-optimal O(|NF+(S)|) time, where NF+(S) is the set of substrings of S paired with their positive NF values. We note that |NF+(S)|=O(n) always holds. In contrast to Guo et al.’s algorithm that is based on Ukkonen’s suffix tree construction, our algorithm is based on Weiner’s suffix tree construction.
更快更简单的在线计算弦网频率
如果将重复子字符串u在字符串S中出现的次数向左或向右扩展会使出现次数减少到1,则称为净出现。字符串S中重复子串u的净频率(NF)是u在S中净出现的次数。最近,Guo等人[SPIRE 2024]提出了一种在线O(nlog σ)时间算法,该算法维护O(n)空间的数据结构,该数据结构在O(mlogσ+σ2)时间内回答单NF查询,并在O(nσ2)时间内报告所有所有NF问题的答案。这里,n是输入字符串S的长度,m是查询模式的长度,σ是字母表的大小。σ2项是他们的方法的一个主要缺点,因为计算字符串网络频率最初是为了中文文本处理而设计的,其中σ可以是几千。本文提出了一种改进的在线O(nlog σ)时间算法,该算法在O(mlog σ)时间内回答单NF查询,并在输出最优的O(|) NF+(S)|)时间内报告全NF问题的所有答案,其中NF+(S)是S的子串与其正NF值配对的集合。我们注意到|NF+(S)|=O(n)总是成立的。与Guo等人基于Ukkonen后缀树构造的算法不同,我们的算法是基于Weiner后缀树构造的。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
Information Processing Letters
Information Processing Letters 工程技术-计算机:信息系统
CiteScore
1.80
自引率
0.00%
发文量
70
审稿时长
7.3 months
期刊介绍: Information Processing Letters invites submission of original research articles that focus on fundamental aspects of information processing and computing. This naturally includes work in the broadly understood field of theoretical computer science; although papers in all areas of scientific inquiry will be given consideration, provided that they describe research contributions credibly motivated by applications to computing and involve rigorous methodology. High quality experimental papers that address topics of sufficiently broad interest may also be considered. Since its inception in 1971, Information Processing Letters has served as a forum for timely dissemination of short, concise and focused research contributions. Continuing with this tradition, and to expedite the reviewing process, manuscripts are generally limited in length to nine pages when they appear in print.
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术官方微信
小红书