paper-with-me

홈 › Papers

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

2026-01-14 · MD Nazmul Alam Shanto, Md. Tanzeem Rahat, Md. Manzurul Hasan arxiv

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.

📄 PDF Abstract BibTeX arXiv:2601.09577

Code (0)

등록된 구현이 없습니다.

Similar Papers 제목 키워드 기반

Gromov-Monge Flow Matching for Equivariant Graph Generation

2026-08-27 · Moritz Piening, Christian Wald arxiv

Graphs are invariant under node permutations, motivating the use of permutation-equivariant architectures in generative models. In flow matching, however, symmetry may also enter the source--target coupling: once graph p…

Graph Generation

Learning Unbiased Permutations via Flow Matching

2026-05-16 · Yimeng Min, Carla P. Gomes arxiv

Learning permutations is fundamental to sorting, ranking, and matching, but existing differentiable methods based on entropy-regularized Sinkhorn produce a single softened solution and collapse under ambiguity. We presen…

Analysis of Linear Mode Connectivity via Permutation-Based Weight Matching

2024-02-06 · Akira Ito, Masanori Yamada, Atsutoshi Kumagai

Recently, Ainsworth et al. showed that using weight matching (WM) to minimize the $L_2$ distance in a permutation search of model parameters effectively identifies permutations that satisfy linear mode connectivity (LMC)…

Linear Mode Connectivity

Single-Rooted DAGs in Regular DAG Languages: Parikh Image and Path Languages

2017-09-01 · WS 2017 9 · Martin Berglund, Henrik Bj{\"o}rklund, Frank Drewes

Kissing to Find a Match: Efficient Low-Rank Permutation Representation

2023-08-25 · NeurIPS 2023 11

Permutation matrices play a key role in matching and assignment problems across the fields, especially in computer vision and robotics. However, memory for explicitly representing permutation matrices grows quadratically…