1,742 research outputs found
Binary Jumbled String Matching for Highly Run-Length Compressible Texts
The Binary Jumbled String Matching problem is defined as: Given a string
over of length and a query , with non-negative
integers, decide whether has a substring with exactly 's and
's. Previous solutions created an index of size O(n) in a pre-processing
step, which was then used to answer queries in constant time. The fastest
algorithms for construction of this index have running time
[Burcsi et al., FUN 2010; Moosa and Rahman, IPL 2010], or in
the word-RAM model [Moosa and Rahman, JDA 2012]. We propose an index
constructed directly from the run-length encoding of . The construction time
of our index is , where O(n) is the time for computing
the run-length encoding of and is the length of this encoding---this
is no worse than previous solutions if and better if . Our index can be queried in time. While
in the worst case, preliminary investigations have
indicated that may often be close to . Furthermore, the algorithm
for constructing the index is conceptually simple and easy to implement. In an
attempt to shed light on the structure and size of our index, we characterize
it in terms of the prefix normal forms of introduced in [Fici and Lipt\'ak,
DLT 2011].Comment: v2: only small cosmetic changes; v3: new title, weakened conjectures
on size of Corner Index (we no longer conjecture it to be always linear in
size of RLE); removed experimental part on random strings (these are valid
but limited in their predictive power w.r.t. general strings); v3 published
in IP
Normal, Abby Normal, Prefix Normal
A prefix normal word is a binary word with the property that no substring has
more 1s than the prefix of the same length. This class of words is important in
the context of binary jumbled pattern matching. In this paper we present
results about the number of prefix normal words of length , showing
that for some and
. We introduce efficient
algorithms for testing the prefix normal property and a "mechanical algorithm"
for computing prefix normal forms. We also include games which can be played
with prefix normal words. In these games Alice wishes to stay normal but Bob
wants to drive her "abnormal" -- we discuss which parameter settings allow
Alice to succeed.Comment: Accepted at FUN '1
Algorithms for Computing Abelian Periods of Words
Constantinescu and Ilie (Bulletin EATCS 89, 167--170, 2006) introduced the
notion of an \emph{Abelian period} of a word. A word of length over an
alphabet of size can have distinct Abelian periods.
The Brute-Force algorithm computes all the Abelian periods of a word in time
using space. We present an off-line
algorithm based on a \sel function having the same worst-case theoretical
complexity as the Brute-Force one, but outperforming it in practice. We then
present on-line algorithms that also enable to compute all the Abelian periods
of all the prefixes of .Comment: Accepted for publication in Discrete Applied Mathematic
Algorithms for Jumbled Pattern Matching in Strings
The Parikh vector p(s) of a string s is defined as the vector of
multiplicities of the characters. Parikh vector q occurs in s if s has a
substring t with p(t)=q. We present two novel algorithms for searching for a
query q in a text s. One solves the decision problem over a binary text in
constant time, using a linear size index of the text. The second algorithm, for
a general finite alphabet, finds all occurrences of a given Parikh vector q and
has sub-linear expected time complexity; we present two variants, which both
use a linear size index of the text.Comment: 18 pages, 9 figures; article accepted for publication in the
International Journal of Foundations of Computer Scienc
Identifying all abelian periods of a string in quadratic time and relevant problems
Abelian periodicity of strings has been studied extensively over the last
years. In 2006 Constantinescu and Ilie defined the abelian period of a string
and several algorithms for the computation of all abelian periods of a string
were given. In contrast to the classical period of a word, its abelian version
is more flexible, factors of the word are considered the same under any
internal permutation of their letters. We show two O(|y|^2) algorithms for the
computation of all abelian periods of a string y. The first one maps each
letter to a suitable number such that each factor of the string can be
identified by the unique sum of the numbers corresponding to its letters and
hence abelian periods can be identified easily. The other one maps each letter
to a prime number such that each factor of the string can be identified by the
unique product of the numbers corresponding to its letters and so abelian
periods can be identified easily. We also define weak abelian periods on
strings and give an O(|y|log(|y|)) algorithm for their computation, together
with some other algorithms for more basic problems.Comment: Accepted in the "International Journal of foundations of Computer
Science
- …