Table of Contents
Fetching ...

Efficiently Finding All Minimal and Shortest Absent Subsequences in a String

Florin Manea, Tina Ringleb, Stefan Siemer, Maximilian Winkler

TL;DR

This work tackles the problem of finding and enumerating absent subsequences of a string, focusing on the shortest absent subsequences (SAS) and minimal absent subsequences (MAS). It develops a unified DAG-based framework using skeleton DAGs to model SAS and MAS as $s-f$ paths, enabling linear-time preprocessing and output-efficient enumeration, including incremental variants with constant per-output overhead. The authors also present an $O(n\log\sigma)$ algorithm to compute a longest MAS, combining dynamic programming with a 1D range-tree to support fast range-max queries. Collectively, these results significantly advance the state-of-the-art by providing optimal-time preprocessing and tight per-output guarantees for both SAS and MAS, with practical implications for stringology and related applications.

Abstract

Given a string $w$, another string $v$ is said to be a subsequence of $w$ if $v$ can be obtained from $w$ by removing some of its letters; on the other hand, $v$ is called an absent subsequence of $w$ if $v$ is not a subsequence of $w$. The existing literature on absent subsequences focused on understanding, for a string $w$, the set of its shortest absent subsequences (i.e., the shortest strings which are absent subsequences of $w$) and that of its minimal absent subsequences (i.e., those strings which are absent subsequences of $w$ but whose every proper subsequence occurs in $w$). Our contributions to this area of research are the following. Firstly, we present optimal algorithms (with linear time preprocessing and output-linear delay) for the enumeration of the shortest and, respectively, minimal absent subsequences. Secondly, we present optimal algorithms for the incremental enumeration of these strings with linear time preprocessing and constant delay; in this setting, we only output short edit-scripts showing how the currently enumerated string differs from the previous one. Finally, we provide an efficient algorithm for identifying a longest minimal absent subsequence of a string. All our algorithms improve the state-of-the-art results for the aforementioned problems.

Efficiently Finding All Minimal and Shortest Absent Subsequences in a String

TL;DR

This work tackles the problem of finding and enumerating absent subsequences of a string, focusing on the shortest absent subsequences (SAS) and minimal absent subsequences (MAS). It develops a unified DAG-based framework using skeleton DAGs to model SAS and MAS as paths, enabling linear-time preprocessing and output-efficient enumeration, including incremental variants with constant per-output overhead. The authors also present an algorithm to compute a longest MAS, combining dynamic programming with a 1D range-tree to support fast range-max queries. Collectively, these results significantly advance the state-of-the-art by providing optimal-time preprocessing and tight per-output guarantees for both SAS and MAS, with practical implications for stringology and related applications.

Abstract

Given a string , another string is said to be a subsequence of if can be obtained from by removing some of its letters; on the other hand, is called an absent subsequence of if is not a subsequence of . The existing literature on absent subsequences focused on understanding, for a string , the set of its shortest absent subsequences (i.e., the shortest strings which are absent subsequences of ) and that of its minimal absent subsequences (i.e., those strings which are absent subsequences of but whose every proper subsequence occurs in ). Our contributions to this area of research are the following. Firstly, we present optimal algorithms (with linear time preprocessing and output-linear delay) for the enumeration of the shortest and, respectively, minimal absent subsequences. Secondly, we present optimal algorithms for the incremental enumeration of these strings with linear time preprocessing and constant delay; in this setting, we only output short edit-scripts showing how the currently enumerated string differs from the previous one. Finally, we provide an efficient algorithm for identifying a longest minimal absent subsequence of a string. All our algorithms improve the state-of-the-art results for the aforementioned problems.
Paper Structure (7 sections, 15 theorems, 3 figures, 3 algorithms)

This paper contains 7 sections, 15 theorems, 3 figures, 3 algorithms.

Key Result

Theorem 3

Let $v,w\in \Sigma^\ast,~|v|=m+1$ and $|w|=n$, then $v$ is an $\mathop{\mathrm{MAS}}\nolimits$ of $w$ if and only if there exist positions $0=i_0<i_1<\ldots <i_m <i_{m+1}= n+1$ such that the following conditions are satisfied:

Figures (3)

  • Figure 1: $4$-Skeleton DAG $G$ (a) and its encoded DAG $D(G)$ (b), where the dashed arrows in (a) represent, respectively, the orders $\rightarrow_{\ell}$, for each level $\ell\in [3]$.
  • Figure 2: MAS-Skeleton (a) and SAS-Skeleton (b) of the word $11213\cdot3221\cdot132\cdot2$, of length $13$ (the $\cdot$ symbols separate the arches). For better readability, the MAS-Skeleton (a) does not show nodes that can not be reached from $s$.
  • Figure 3: MAS-Skeleton (a) and SAS-Skeleton (b) of the word $1223\cdot 313$, of length $7$ (the $\cdot$ symbols separate the arches). Nodes, that can not be reached from $s$ in (a) have been removed for better readability. There is exactly one SAS.

Theorems & Definitions (19)

  • Definition 1
  • Definition 2: KoscheKMS22
  • Theorem 3
  • Lemma 3
  • Lemma 3
  • Definition 4
  • Definition 5
  • Theorem 6
  • Corollary 6
  • Theorem 7
  • ...and 9 more