Online algorithms for finding distinct substrings with length and multiple prefix and suffix conditions

07/09/2022
by   Laurentius Leonard, et al.
0

Let two static sequences of strings P and S, representing prefix and suffix conditions respectively, be given as input for preprocessing. For the query, let two positive integers k_1 and k_2 be given, as well as a string T given in an online manner, such that T_i represents the length-i prefix of T for 1 ≤ i ≤ |T|. In this paper we are interested in computing the set 𝑎𝑛𝑠_𝑖 of distinct substrings w of T_i such that k_1 ≤ |w| ≤ k_2, and w contains some p ∈ P as a prefix and some s ∈ S as a suffix. More specifically, the counting problem is to output |𝑎𝑛𝑠_𝑖|, whereas the reporting problem is to output all elements of 𝑎𝑛𝑠_𝑖, for each iteration i. Let σ denote the alphabet size, and for a sequence of strings A, ‖ A‖=∑_u∈ A|u|. Then, we show that after O((‖ P‖ +‖ S‖)logσ)-time preprocessing, the solutions for the counting and reporting problems for each iteration up to i can be output in O(|T_i| logσ) and O(|T_i| logσ + |𝑎𝑛𝑠_𝑖|) total time. The preprocessing time can be reduced to O(‖ P‖ +‖ S‖) for integer alphabets of size polynomial with regard to ‖ P‖ +‖ S‖. Our algorithms have possible applications to network traffic classification.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
03/01/2022

Quantum jumbled pattern matching

Let S_1, S_2 ∈Σ^* strings, we say that S_1 jumble match S_2 if they are ...
research
03/31/2022

Suffix tree-based linear algorithms for multiple prefixes, single suffix counting and listing problems

Given two strings T and S and a set of strings P, for each string p ∈ P,...
research
05/25/2022

Substring Complexities on Run-length Compressed Strings

Let S_T(k) denote the set of distinct substrings of length k in a string...
research
11/08/2022

Computing palindromes on a trie in linear time

A trie 𝒯 is a rooted tree such that each edge is labeled by a single cha...
research
09/25/2019

Internal Dictionary Matching

We introduce data structures answering queries concerning the occurrence...
research
02/15/2021

On Ray Shooting for Triangles in 3-Space and Related Problems

We consider several problems that involve lines in three dimensions, and...
research
03/19/2019

Preprocessing Ambiguous Imprecise Points

Let R = {R_1, R_2, ..., R_n} be a set of regions and let X = {x_1, x_2,...

Please sign up or login with your details

Forgot password? Click here to reset