Searcharxiv⌕ Search

arXiv subjects

Pawel Gawrychowski

Publications and source records attributed to Pawel Gawrychowski.

27 records · Page 2Linked to original sources

Beating O(nm) in approximate LZW-compressed pattern matching

Given an LZW/LZ78 compressed text, we want to find an approximate occurrence of a given pattern of length m. The goal is to achieve time complexity depending on the size n of the compressed representation of the text instead of its length. We consider two specific definitions of approximate matching, namely the Hamming distance and the edit distance, and show how to achieve O(nm^0.5k^2) and O(nm^0.5k^3) running time, respectively, where k is the bound on the distance. Both algorithms use just linear space. Even for very small values of k, the best previously known solutions required O(nm) time. Our main contribution is applying a periodicity-based argument in a way that is computationally effective even if we need to operate on a compressed representation of a string, while the previous solutions were either based on a dynamic programming, or a black-box application of tools developed for uncompressed strings.

cs.DS↗

Alphabet-Dependent String Searching with Wexponential Search Trees

It is widely assumed that $O(m+\lg σ)$ is the best one can do for finding a pattern of length $m$ in a compacted trie storing strings over an alphabet of size $σ$, if one insists on linear-size data structures and deterministic worst-case running times [Cole et al., ICALP'06]. In this article, we first show that a rather straightforward combination of well-known ideas yields $O(m+\lg\lg σ)$ deterministic worst-case searching time for static tries. Then we move on to dynamic tries, where we achieve a worst-case bound of $O(m+\frac{\lg^{2}\lgσ}{\lg\lg\lgσ})$ per query or update, which should again be compared to the previously known $O(m+\lgσ)$ deterministic worst-case bounds [Cole et al., ICALP'06], and to the alphabet \emph{in}dependent $O(m+\sqrt{\lg n/\lg\lg n})$ deterministic worst-case bounds [Andersson and Thorup, SODA'01], where $n$ is the number of nodes in the trie. The basis of our update procedure is a weighted variant of exponential search trees which, while simple, might be of independent interest. As one particular application, the above bounds (static and dynamic) apply to suffix trees. There, an update corresponds to pre- or appending a letter to the text, and an additional goal is to do the updates quicker than rematching entire suffixes. We show how to do this in $O(\lg\lg n + \frac{\lg^{2}\lgσ}{\lg\lg\lgσ})$ time, which improves the previously known $O(\lg n)$ bound [Amir et al., SPIRE'05].

cs.DS↗

(Really) Tight bounds for dispatching binary methods

We consider binary dispatching problem originating from object oriented programming. We want to preprocess a hierarchy of classes and collection of methods so that given a function call in the run-time we are able to retrieve the most specialized implementation which can be invoked with the actual types of the arguments. For the binary dispatching, where the methods take exactly two arguments, logarithmic query time is possible, even if the structure is allowed to take linear space. Unfortunately, known solutions achieving such complexity require superlinear time for constructing the structure. Using a different idea we are able to construct in (deterministic) linear time and space a structure allowing dispatching binary methods in the same logarithmic time. Then we show how to improve the query time to slightly sublogarithmic, which is easily seen to be optimal as a consequence of some already known lower bounds if we want to keep the size of the resulting structure close to linear.

cs.DS↗

Tying up the loose ends in fully LZW-compressed pattern matching

We consider a natural generalization of the classical pattern matching problem: given compressed representations of a pattern p[1..M] and a text t[1..N] of sizes m and n, respectively, does p occur in t? We develop an optimal linear time solution for the case when both p and t are compressed using the LZW method. This improves the previously known O((n+m)log(n+m)) time solution of Gasieniec and Rytter, and essentially closes the line of research devoted to studying LZW-compressed exact pattern matching.

cs.DS↗

Pattern matching in Lempel-Ziv compressed strings: fast, simple, and deterministic

Countless variants of the Lempel-Ziv compression are widely used in many real-life applications. This paper is concerned with a natural modification of the classical pattern matching problem inspired by the popularity of such compression methods: given an uncompressed pattern s[1..m] and a Lempel-Ziv representation of a string t[1..N], does s occur in t? Farach and Thorup gave a randomized O(nlog^2(N/n)+m) time solution for this problem, where n is the size of the compressed representation of t. We improve their result by developing a faster and fully deterministic O(nlog(N/n)+m) time algorithm with the same space complexity. Note that for highly compressible texts, log(N/n) might be of order n, so for such inputs the improvement is very significant. A (tiny) fragment of our method can be used to give an asymptotically optimal solution for the substring hashing problem considered by Farach and Muthukrishnan.

cs.DS↗

Grammar-Based Compression in a Streaming Model

We show that, given a string $s$ of length $n$, with constant memory and logarithmic passes over a constant number of streams we can build a context-free grammar that generates $s$ and only $s$ and whose size is within an $\Oh{\min (g \log g, \sqrt{n \log g})}$-factor of the minimum $g$. This stands in contrast to our previous result that, with polylogarithmic memory and polylogarithmic passes over a single stream, we cannot build such a grammar whose size is within any polynomial of $g$.

cs.DS↗

Online validation of the pi and pi' failure functions

Let pi_w denote the failure function of the Morris-Pratt algorithm for a word w. In this paper we study the following problem: given an integer array A[1..n], is there a word w over arbitrary alphabet such that A[i]=pi_w[i] for all i? Moreover, what is the minimum required cardinality of the alphabet? We give a real time linear algorithm for this problem in the unit-cost RAM model with Θ(log n) bits word size. Our algorithm returns a word w over minimal alphabet such that pi_w = A as well and uses just o(n) words of memory. Then we consider function pi' instead of pi and give an online O(n log n) algorithm for this case. This is the first polynomial algorithm for online version of this problem.

cs.DS↗

Minimax Trees in Linear Time

A minimax tree is similar to a Huffman tree except that, instead of minimizing the weighted average of the leaves' depths, it minimizes the maximum of any leaf's weight plus its depth. Golumbic (1976) introduced minimax trees and gave a Huffman-like, $\Oh{n \log n}$-time algorithm for building them. Drmota and Szpankowski (2002) gave another $\Oh{n \log n}$-time algorithm, which checks the Kraft Inequality in each step of a binary search. In this paper we show how Drmota and Szpankowski's algorithm can be made to run in linear time on a word RAM with (Ω(\log n))-bit words. We also discuss how our solution applies to problems in data compression, group testing and circuit design.

cs.DS↗

Worst-case optimal approximation algorithms for maximizing triplet consistency within phylogenetic networks

This article concerns the following question arising in computational evolutionary biology. For a given subclass of phylogenetic networks, what is the maximum value of 0 <= p <= 1 such that for every input set T of rooted triplets, there exists some network N(T) from the subclass such that at least p|T| of the triplets are consistent with N(T)? Here we prove that the set containing all triplets (the full triplet set) in some sense defines p, and moreover that any network N achieving fraction p' for the full triplet set can be converted in polynomial time into an isomorphic network N'(T) achieving >= p' for an arbitrary triplet set T. We demonstrate the power of this result for the field of phylogenetics by giving worst-case optimal algorithms for level-1 phylogenetic networks (a much-studied extension of phylogenetic trees), improving considerably upon the 5/12 fraction obtained recently by Jansson, Nguyen and Sung. For level-2 phylogenetic networks we show that p >= 0.61. We note that all the results in this article also apply to weighted triplet sets.

q-bio.PE↗