English

All-Pairs Suffix-Prefix on Fully Dynamic Set of Strings

Data Structures and Algorithms 2025-03-04 v2

Abstract

The all-pairs suffix-prefix (APSP) problem is a classical problem in string processing which has important applications in bioinformatics. Given a set S={S1,,Sk}\mathcal{S} = \{S_1, \ldots, S_k\} of kk strings, the APSP problem asks one to compute the longest suffix of SiS_i that is a prefix of SjS_j for all k2k^2 ordered pairs Si,Sj\langle S_i, S_j \rangle of strings in S\mathcal{S}. In this paper, we consider the dynamic version of the APSP problem that allows for insertions of new strings to the set of strings. Our objective is, each time a new string SiS_i arrives to the current set Si1={S1,,Si1}\mathcal{S}_{i-1} = \{S_1, \ldots, S_{i-1}\} of i1i-1 strings, to compute (1) the longest suffix of SiS_i that is a prefix of SjS_j and (2) the longest prefix of SiS_i that is a suffix of SjS_j for all 1ji1 \leq j \leq i. We propose an O(n)O(n)-space data structure which computes (1) and (2) in O(Silogσ+i)O(|S_i| \log \sigma + i) time for each new given string SiS_i, where nn is the total length of the strings. Further, we show how to extend our methods to the fully dynamic version of the APSP problem allowing for both insertions and deletions of strings.

Keywords

Cite

@article{arxiv.2407.17814,
  title  = {All-Pairs Suffix-Prefix on Fully Dynamic Set of Strings},
  author = {Masaru Kikuchi and Shunsuke Inenaga},
  journal= {arXiv preprint arXiv:2407.17814},
  year   = {2025}
}

Comments

Preliminary version appeared in SPIRE 2024

R2 v1 2026-06-28T17:53:09.723Z