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.


翻译:我们研究一般字母表$Σ$上的置换(乱序/阿贝尔)模式匹配问题。给定长度为$m$的模式$P$和长度为$n$的文本$T$,经典任务是判断$T$是否包含一个长度为$m$的子串,其帕里赫向量与$P$相等。虽然该存在性问题可通过线性时间滑动窗口算法求解,但许多实际应用需要超越单纯检测的优化与打包变体。我们提出一种基于维护$P$与$T$当前窗口间帕里赫向量差的统一滑动窗口框架,可在$O(n + σ)$时间和$O(σ)$空间内实现置换匹配,其中$σ = |Σ|$。在此基础上,我们引入一种组合优化变体——模式供给下的最大可行子串问题:寻找$T$中最长的子串$S$,其符号计数在分量意义上不超过$P$的对应计数。我们证明MFSP问题同样可通过双指针可行性维护算法在$O(n + σ)$时间内求解,为$P$提供了作为资源预算的精确打包解释。最后,我们通过将每个置换匹配建模为等长区间,并证明贪心最早结束策略可得到最大基数的不相交匹配集合,从而解决非重叠出现选择问题,该集合可在枚举所有匹配后线性时间内计算。我们的结果提供了具有紧致界限的简洁可证明正确算法,并将基于频率的字符串匹配与打包式优化原语联系起来。

0
下载
关闭预览

相关内容

NeurIPS 2021 | 微观特征混合进行宏观时间序列预测
专知会员服务
42+阅读 · 2021年11月12日
【WWW2021】基于图层次相关性匹配信号的Ad-hoc 检索
专知会员服务
14+阅读 · 2021年2月25日
【AAAI2021】基于图神经网络的文本语义匹配算法
专知会员服务
50+阅读 · 2021年1月30日
重磅发布:基于 PyTorch 的深度文本匹配工具 MatchZoo-py
中国科学院网络数据重点实验室
16+阅读 · 2019年8月26日
利用动态深度学习预测金融时间序列基于Python
量化投资与机器学习
18+阅读 · 2018年10月30日
基于 Keras 用深度学习预测时间序列
R语言中文社区
23+阅读 · 2018年7月27日
用PyTorch实现各种GANs(附论文和代码地址)
推荐算法:Match与Rank模型的交织配合
从0到1
15+阅读 · 2017年12月18日
国家自然科学基金
0+阅读 · 2017年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
Arxiv
0+阅读 · 2月14日
Arxiv
0+阅读 · 2月4日
Arxiv
0+阅读 · 1月14日
VIP会员
相关VIP内容
NeurIPS 2021 | 微观特征混合进行宏观时间序列预测
专知会员服务
42+阅读 · 2021年11月12日
【WWW2021】基于图层次相关性匹配信号的Ad-hoc 检索
专知会员服务
14+阅读 · 2021年2月25日
【AAAI2021】基于图神经网络的文本语义匹配算法
专知会员服务
50+阅读 · 2021年1月30日
相关资讯
重磅发布:基于 PyTorch 的深度文本匹配工具 MatchZoo-py
中国科学院网络数据重点实验室
16+阅读 · 2019年8月26日
利用动态深度学习预测金融时间序列基于Python
量化投资与机器学习
18+阅读 · 2018年10月30日
基于 Keras 用深度学习预测时间序列
R语言中文社区
23+阅读 · 2018年7月27日
用PyTorch实现各种GANs(附论文和代码地址)
推荐算法:Match与Rank模型的交织配合
从0到1
15+阅读 · 2017年12月18日
相关基金
国家自然科学基金
0+阅读 · 2017年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员