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

字符串中最长单臂间隔回文的高效计算

Efficient computation of longest single-arm-gapped palindromes in a string

Shintaro Narisada, Diptarama Hendrian, Kazuyuki Narisawa, Shunsuke Inenaga, Ayumi Shinohara

摘要:

在本文中,我们介绍了新类型的近似回文称为单臂缺口回文(简称SAGPs)。SAGP在其左臂或右臂中包含间隙,其形式为$wguc u^R w^R$或$wuc u^Rgw^R$,其中$w$和$u$是非空字符串,$w^R$和$u^R$分别是$w$和$u$的反向字符串,$g$是称为间隙的字符串,$c$是单个字符或空字符串。在这里,我们称$wu$和$u^R w^R$为SAGP的臂,$|uv|$为臂的长度。我们将SAGP分为两组:以$ucu^R$为最大回文的SAGP(1型)和其他SAGP(2型)。我们提出了几种算法来计算类型-1 SAGP与最长的武器发生在一个给定的字符串,基于后缀数组。然后,我们提出了一个线性时间算法来计算所有类型1的SAGP与最长的武器,基于后缀树。此外,我们展示了如何计算2型SAGP与最长的武器在线性时间。我们还进行了一些初步的实验,以显示所提出的方法的实际性能。

英文摘要:

In this paper, we introduce new types of approximate palindromes called single-arm-gapped palindromes (shortly SAGPs). A SAGP contains a gap in either its left or right arm, which is in the form of either $wguc u^R w^R$ or $wuc u^Rgw^R$, where $w$ and $u$ are non-empty strings, $w^R$ and $u^R$ are respectively the reversed strings of $w$ and $u$, $g$ is a string called a gap, and $c$ is either a single character or the empty string. Here we call $wu$ and $u^R w^R$ the arm of the SAGP, and $|uv|$ the length of the arm. We classify SAGPs into two groups: those which have $ucu^R$ as a maximal palindrome (type-1), and the others (type-2). We propose several algorithms to compute type-1 SAGPs with longest arms occurring in a given string, based on suffix arrays. Then, we propose a linear-time algorithm to compute all type-1 SAGPs with longest arms, based on suffix trees. Also, we show how to compute type-2 SAGPs with longest arms in linear time. We also perform some preliminary experiments to show practical performances of the proposed methods.

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

↑