arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2601.09577cs.DScs.CL
收藏

在Parikh预算下进行排列匹配:线性时间的检测、打包和不相交选择

Permutation Matching Under Parikh Budgets: Linear-Time Detection, Packing, and Disjoint Selection

Department of Computer Science, American International University-Bangladesh, Dhaka, Bangladesh(计算机科学系,美国国际大学-孟加拉国,达卡,孟加拉国)

MD Nazmul Alam Shanto, Md. Tanzeem Rahat, Md. Manzurul Hasan

AI总结:

本文提出了一种在Parikh预算下进行排列匹配的线性时间算法,解决检测、打包和不相交选择问题。

摘要:

我们研究了在一般字母表Σ上的一般排列(混乱/阿贝尔)模式匹配问题。给定一个长度为m的模式P和一个长度为n的文本T,经典任务是决定T中是否存在一个长度为m的子字符串,其Parikh向量等于P的Parikh向量。虽然这个存在性问题可以采用线性时间的滑动窗口方案解决,但许多实际应用需要优化和打包变种,而不仅仅是检测。我们提出了一种基于维护P与当前T窗口的Parikh向量差的统一滑动窗口框架,使排列匹配可以在O(n + σ)时间内完成,空间复杂度为O(σ),其中σ = |Σ|。在此基础上,我们引入了一个组合优化变种,称为在模式供应下的最长可行子字符串(MFSP):找到T中最长的子字符串S,其符号计数在每个组件上都小于等于P的符号计数。我们证明MFSP也可以通过双指针可行性维护算法在O(n + σ)时间内解决,为P作为资源预算提供了精确的打包解释。最后,我们通过将每个排列匹配建模为一个等长区间,证明了贪心最早完成策略可以得到一个最大基数的不相交匹配集,一旦所有匹配都被枚举,该集合可以在线性时间内计算出来。我们的结果提供了简洁且可证明正确的算法,具有紧致的界限,并将基于频率的字符串匹配与打包式优化原语联系起来。

英文摘要:

We study permutation (jumbled/Abelian) pattern matching over a general alphabet $Σ$. Given a pattern P of length m and a text T of length n, the classical task is to decide whether T contains a length-m substring whose Parikh vector equals that of P . While this existence problem admits a linear-time sliding-window solution, many practical applications require optimization and packing variants beyond mere detection. We present a unified sliding-window framework based on maintaining the Parikh-vector difference between P and the current window of T , enabling permutation matching in O(n + σ) time and O(σ) space, where σ = |Σ|. Building on this foundation, we introduce a combinatorial-optimization variant that we call Maximum Feasible Substring under Pattern Supply (MFSP): find the longest substring S of T whose symbol counts are component-wise bounded by those of P . We show that MFSP can also be solved in O(n + σ) time via a two-pointer feasibility maintenance algorithm, providing an exact packing interpretation of P as a resource budget. Finally, we address non-overlapping occurrence selection by modeling each permutation match as an equal-length interval and proving that a greedy earliest-finishing strategy yields a maximum-cardinality set of disjoint matches, computable in linear time once all matches are enumerated. Our results provide concise, provably correct algorithms with tight bounds, and connect frequency-based string matching to packing-style optimization primitives.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑