arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2502.17199cs.DS
收藏

半动态字符串中的最小化子(Minimizers)

Minimizers in Semi-Dynamic Strings

Wiktor Zuba, Oded Lachish, Solon P. Pissis

AI总结:

该研究针对半动态字符串的最小化子计算问题,提出了支持摊销O(1)时间更新与O(1)查询的数据结构,并进一步优化为O(√w)强次线性工作空间,同时保持O(n)时间复杂度,还通过应用与实验验证了理论结果。

摘要:

最小化子采样是应用最广泛的字符串采样机制之一。设$S=S[0]\ldots S[n-1]$是字母表$\Sigma$上的一个字符串,另外设$w\geq 2$和$k\geq 1$为两个整数,$\rho=(\Sigma^k,\leq)$是$\Sigma^k$上的一个全序。窗口$X=S[i\mathinner{.\\,.} i+w+k-2]$的最小化子是区间$[i,i+w-1]$中满足以下条件的最小位置:基于$\rho$的$S[i\mathinner{.\\,.} i+w+k-2]$的最短长度为$k$的子串起始于该位置。所有$i\in[0,n-w-k+1]$对应的最小化子构成的集合就是$S$的最小化子集合$\mathcal{M}_{w,k,\rho}(S)$,该集合可在$\mathcal{O}(n)$时间内计算得到。用于该计算的经典算法使用$\mathcal{O}(w)$的工作空间,以摊销$\mathcal{O}(1)$的时间计算每个窗口的最小化子。因此自然会提出以下两个问题:问题1:我们能否高效支持窗口上的其他动态更新?问题2:我们能否优化$\mathcal{O}(w)$的工作空间?我们对这两个问题均给出了肯定的答案:1. 我们将允许在任意一端插入或删除字符的字符串$X$称为半动态字符串。我们提出了一种数据结构,可维护半动态字符串$X$,支持$X$中的最小化子查询,查询时间为$\mathcal{O}(1)$,每次更新操作的摊销时间为$\mathcal{O}(1)$。2. 我们证明可以修改该数据结构,使其占用强次线性空间,同时不增加其操作的渐近复杂度。据我们所知,这是首个使用$\mathcal{O}(\sqrt{w})$工作空间、在$\mathcal{O}(n)$时间内计算$\mathcal{M}_{w,k,\rho}(S)$的算法。我们还通过一个具体应用和实验评估补充了我们的理论结果。

英文摘要:

Minimizers sampling is one of the most widely-used mechanisms for sampling strings. Let $S=S[0]\ldots S[n-1]$ be a string over an alphabet $Σ$. In addition, let $w\geq 2$ and $k\geq 1$ be two integers and $ρ=(Σ^k,\leq)$ be a total order on $Σ^k$. The minimizer of window $X=S[i\mathinner{.\,.} i+w+k-2]$ is the smallest position in $[i,i+w-1]$ where the smallest length-$k$ substring of $S[i\mathinner{.\,.} i+w+k-2]$ based on $ρ$ starts. The set of minimizers for all $i\in[0,n-w-k+1]$ is the set $\mathcal{M}_{w,k,ρ}(S)$ of the minimizers of $S$. The set $\mathcal{M}_{w,k,ρ}(S)$ can be computed in $\mathcal{O}(n)$ time. The folklore algorithm for this computation computes the minimizer of every window in $\mathcal{O}(1)$ amortized time using $\mathcal{O}(w)$ working space. It is thus natural to pose the following two questions: Question 1: Can we efficiently support other dynamic updates on the window? Question 2: Can we improve on the $\mathcal{O}(w)$ working space? We answer both questions in the affirmative: 1. We term a string $X$ semi-dynamic when one is allowed to insert or delete a letter at any of its ends. We show a data structure that maintains a semi-dynamic string $X$ and supports minimizer queries in $X$ in $\mathcal{O}(1)$ time with amortized $\mathcal{O}(1)$ time per update operation. 2. We show that this data structure can be modified to occupy strongly sublinear space without increasing the asymptotic complexity of its operations. To the best of our knowledge, this yields the first algorithm for computing $\mathcal{M}_{w,k,ρ}(S)$ in $\mathcal{O}(n)$ time using $\mathcal{O}(\sqrt{w})$ working space. We complement our theoretical results with a concrete application and an experimental evaluation.

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

↑