Arrow Research search

Author name cluster

Wojciech Rytter

Possible papers associated with this exact author name in Arrow. This page groups case-insensitive exact name matches and is not a full identity disambiguation profile.

74 papers
2 author rows

Possible papers

74

TCS Journal 2026 Journal Article

Internal quasiperiod queries

  • Maxime Crochemore
  • Costas S. Iliopoulos
  • Jakub Radoszewski
  • Wojciech Rytter
  • Juliusz Straszyński
  • Tomasz Waleń
  • Wiktor Zuba

Internal pattern matching requires one to answer queries about factors of a given string. Many results are known on answering internal period queries, asking for the periods of a given factor. In this paper we investigate internal queries asking for covers (also known as quasiperiods) of a given factor. Let n denote the length of the string and m denote the length of the factor in question. We propose a data structure that answers such queries in O ( log m ) time for the shortest cover and in O ( log m log log m ) time for a representation of all the covers, after O ( n log n ) time and space preprocessing. This is a full version of a conference paper at SPIRE 2020 with query complexities improved by a log log n-factor and additional applications.

TCS Journal 2026 Journal Article

Quasi-linear-time algorithm for a longest common circular factor

  • Mai Alzamel
  • Maxime Crochemore
  • Costas S. Iliopoulos
  • Tomasz Kociumaka
  • Jakub Radoszewski
  • Wojciech Rytter
  • Juliusz Straszyński
  • Tomasz Waleń

We consider the Longest Common Circular Factor (LCCF) problem in which, given strings S and T of length at most n, we are to compute the longest factor of S whose cyclic shift is a factor of T. This new similarity measure is an extension of the classic Longest Common Factor. We show an algorithm solving the LCCF problem in O ( n log 3 n log ( r + 2 ) ) time, where r ≤ n is the length of the output, using O ( n ) space. A naive algorithm works in Ω(n 2) time, and no O ( n polylog n ) -time solution was known prior to our work. Our result constitutes yet another application of string synchronizing sets of Kempa and Kociumaka (STOC 2019). Compared to the preliminary version published at CPM 2019, we significantly simplified the algorithm and improved the space complexity from O ( n log 2 n ) to O ( n ). We achieved that with new algorithmic insights into a certain geometric intersection problem, solved by suitably decomposing intervals.

MFCS Conference 2025 Conference Paper

Counting Distinct Square Substrings in Sublinear Time

  • Panagiotis Charalampopoulos
  • Manal Mohamed 0001
  • Jakub Radoszewski
  • Wojciech Rytter
  • Tomasz Walen
  • Wiktor Zuba

We show that the number of distinct squares in a packed string of length n over an alphabet of size σ can be computed in 𝒪(n/log_{σ}n) time in the word-RAM model of computation. This paper is the first to introduce a sublinear time algorithm for the packed version of squares counting. The packed representation of a string of length n over an alphabet of size σ is given as a sequence of 𝒪(n/ log_{σ} n) machine words in the word-RAM model (a machine word consists of ω ≥ log₂ n bits). Previously it was known how to count distinct squares in 𝒪(n) time [Gusfield and Stoye, JCSS 2004], even for a string over an integer alphabet, see [Crochemore et al. , TCS 2014; Bannai et al. , CPM 2017; Charalampopoulos et al. , SPIRE 2020]. We use techniques of squares extraction from runs described by Crochemore et al. [TCS 2014]. However, the packed model requires novel approaches. In particular, we need an 𝒪(n/log_{σ}n) sized representation of all long-period runs (runs with periods that are Ω(log_{σ}n)) which guarantees sublinear time counting of potentially linearly-many implied squares. The long-period runs with a string period that is periodic itself (called layer runs) are an obstacle, since their number can be Ω(n). Fortunately, the number of all other long-period runs is 𝒪(n/log_{σ}n) and we can construct an implicit representation of all long-period runs in 𝒪(n/log_{σ}n) time by adopting the insights of Amir et al. [ESA 2019], combined with sublinear time tools provided by the PILLAR model of computations in case of packed strings. We count squares in layer runs in sublinear time by exploiting combinatorial properties of types of pyramidally-shaped groups of layer runs. As a by-product, we discover several new structural properties of runs. Another difficulty is to compute, in sublinear time, locations of Lyndon roots of runs in packed strings, which is needed for grouping of runs that can generate equal squares. To overcome this difficulty, we introduce sparse-Lyndon roots which are based on the notion of string synchronizers proposed by Kempa and Kociumaka [STOC 2019].

TCS Journal 2025 Journal Article

Subsequence covers of words

  • Panagiotis Charalampopoulos
  • Solon P. Pissis
  • Jakub Radoszewski
  • Wojciech Rytter
  • Tomasz Waleń
  • Wiktor Zuba

We introduce subsequence covers (s-covers, in short), a new type of covers of a word. A word C is an s-cover of a word S if the occurrences of C in S as subsequences cover all the positions in S. The s-covers seem to be computationally much harder than standard covers of words (cf. Apostolico et al. (1991) [1]), but, on the other hand, much easier than the related shuffle powers (Warmuth and Haussler (1984) [6]). We give a linear-time algorithm for testing if a candidate word C is an s-cover of a word S over a polynomially-bounded integer alphabet. We also give an algorithm for finding a shortest s-cover of a word S, which in the case of a constant-sized alphabet, also runs in linear time. The words without proper s-cover are called s-primitive. We complement our algorithmic results with explicit lower and an upper bound on the length of a longest s-primitive word. Both bounds are exponential in the size of the alphabet. The upper bound presented here improves the bound given in the conference version of this paper [SPIRE 2022].

I&C Journal 2022 Journal Article

A periodicity lemma for partial words

  • Tomasz Kociumaka
  • Jakub Radoszewski
  • Wojciech Rytter
  • Tomasz Waleń

We investigate the function L ( h, p, q ), called here the length function, such that L ( h, p, q ) is the minimum length which guarantees that a natural extension of the periodicity lemma is valid for partial words with h holes and (so-called strong) periods p, q. In a series of papers, the formulae for the length function, in terms of p and q, were provided for each fixed h ≤ 7. We demystify the generic structure of such formulae and give a complete characterization of the length function for any parameter h expressed in terms of a piecewise-linear function with O ( h ) pieces. We also show how to evaluate the length function in O ( log ⁡ p + log ⁡ q ) time, which is an improvement upon the best previously known O ( p + q ) -time algorithm.

I&C Journal 2022 Journal Article

Efficient representation and counting of antipower factors in words

  • Tomasz Kociumaka
  • Jakub Radoszewski
  • Wojciech Rytter
  • Juliusz Straszyński
  • Tomasz Waleń
  • Wiktor Zuba

A k-antipower (for k ≥ 2 ) is a concatenation of k distinct words of the same length. Fici et al. (ICALP 2016) initiated the study of antipowers occurring as fragments of a word, whereas Badkobeh et al. (Inf. Process. Lett. , 2018) presented first algorithms computing such fragments. We address two open problems originating from the latter work and propose efficient algorithms for counting and reporting fragments being k-antipowers. For a length-n word, our algorithms cost O ( n k log ⁡ k ) and O ( n k log ⁡ k + C ) time, respectively, where C is the number of reported fragments. We also show that the number of different k-antipower factors of a length-n word can be computed in O ( n k 4 log ⁡ k log ⁡ n ) time. Finally, we present an improved data structure that checks whether a given fragment is a k-antipower for a given integer k ≥ 2. Our main algorithmic tools are runs and maximal gapped repeats.

TCS Journal 2021 Journal Article

Gossiping by energy-constrained mobile agents in tree networks

  • Jurek Czyzowicz
  • Dariusz Dereniowski
  • Robert Ostrowski
  • Wojciech Rytter

Every node of an edge-weighted tree network contains a data packet. At some nodes are placed mobile agents, each one possessing an amount of energy (not necessarily the same for all agents). While walking along the network, the agents spend the energy proportionally to the distance traveled and collect copies of the data packets present at the visited network nodes. An agent visiting a node deposits there copies of all currently possessed data packets and collects a copy of every data packet present at this node. Two agents meeting at a node may exchange any amount of currently possessed energy. The gossiping problem asks whether it is possible to achieve that a copy of the original data packet of each node may reach every other node of the network. We prove that the gossiping problem can be solved in time O ( k 2 n 2 ) for an n-node tree network T, where k is the number of agents. Moreover, we prove that in order to compute a gossiping strategy, it is enough to start with a minimum-cost convergecast that ends with all data packets and all remaining energy being present at some node of T, and then finish with a minimum-cost broadcast from this configuration. Thus, we obtain two structural properties of the gossiping problem. First, if a gossiping is feasible and r is the first node receiving all information, then there is one that is a concatenation of a convergecast to r and a broadcast from r. Secondly, it is sufficient to consider only optimal convergecast strategies. This is natural to expect but hard to prove, as locations of agents after a convergecast (moved in this stage) are essential. Hence, the convergecast has to be optimal with regards to both spent energy as well as the resulting configuration of agents, which matters in the next stage.

TCS Journal 2021 Journal Article

Shortest covers of all cyclic shifts of a string

  • Maxime Crochemore
  • Costas S. Iliopoulos
  • Jakub Radoszewski
  • Wojciech Rytter
  • Juliusz Straszyński
  • Tomasz Waleń
  • Wiktor Zuba

A factor C of a string S is called a cover of S, if each position of S is contained in an occurrence of C. Breslauer (1992) [3] proposed a well-known O ( n ) -time algorithm that computes the shortest cover of every prefix of a string of length n. We show an O ( n log ⁡ n ) -time and O ( n ) -space algorithm that computes the shortest cover of every cyclic shift of a string of length n and an O ( n ) -time algorithm that computes the shortest among these covers. We also provide a combinatorial characterization of shortest covers of cyclic shifts of Fibonacci strings that leads to efficient algorithms for computing these covers. We further consider the bound on the number of different lengths of shortest covers of cyclic shifts of the same string of length n. We show that this number is Θ ( log ⁡ n ) for Fibonacci strings.

TCS Journal 2021 Journal Article

Syntactic view of sigma-tau generation of permutations

  • Wojciech Rytter
  • Wiktor Zuba

We give a syntactic view of the Sawada-Williams ( σ, τ ) -generation of permutations. The corresponding sequence Seq n of στ-operations of length n! − 1 is shown to have a compact description of size Θ ( n 2 ) in terms of straight-line programs. Using the compact description, we design almost linear time ranking and unranking algorithms.

I&C Journal 2020 Journal Article

String periods in the order-preserving model

  • Garance Gourdel
  • Tomasz Kociumaka
  • Jakub Radoszewski
  • Wojciech Rytter
  • Arseny Shur
  • Tomasz Waleń

In the order-preserving model, two strings match if they share the same relative order between the characters at the corresponding positions. This model is quite recent, but it has already attracted significant attention because of its applications in data analysis. We introduce several types of periods in this setting (op-periods). Then we give algorithms to compute these periods in time O ( n ), O ( n log ⁡ log ⁡ n ), O ( n log 2 ⁡ log ⁡ n / log ⁡ log ⁡ log ⁡ n ), O ( n log ⁡ n ) depending on the type of periodicity. In the most general variant, the number of different op-periods can be as big as Ω ( n 2 ), and a compact representation is needed. Our algorithms require novel combinatorial insight into the properties of op-periods. In particular, we characterize the Fine–Wilf property for coprime op-periods.

TCS Journal 2020 Journal Article

Universal reconstruction of a string

  • Paweł Gawrychowski
  • Tomasz Kociumaka
  • Jakub Radoszewski
  • Wojciech Rytter
  • Tomasz Waleń

Many properties of a string can be viewed as sets of dependencies between substrings of the string expressed in terms of substring equality. We design a linear-time algorithm which finds a solution to an arbitrary system of such constraints: a generic string satisfying a system of substring equations. This provides a general tool for reconstructing a string from different kinds of repetitions or symmetries present in the string, in particular, from runs or from maximal palindromes. The recursive structure of our algorithm in some aspects resembles the suffix array construction by Kärkkäinen et al. (2006) [23]. This is a full version of a paper presented at WADS 2015 [18].

TCS Journal 2019 Journal Article

Energy-optimal broadcast and exploration in a tree using mobile agents

  • Jurek Czyzowicz
  • Krzysztof Diks
  • Jean Moussi
  • Wojciech Rytter

A set of k mobile agents is deployed at the root r of a weighted, n-node tree T. The weight of each tree edge represents the distance between the corresponding nodes along the edge. One node of the tree, the source s, possesses a piece of information which has to be communicated (broadcasted) to all other nodes using mobile agents. An agent visiting a node, which already possesses the information, automatically acquires it and communicates it to all nodes subsequently visited by this agent. The process finishes when the information is transferred to all nodes of the tree. The agents spend energy proportionally to the distance traversed. The problem considered in this paper consists in finding the minimal total energy, used by all agents, needed to complete the broadcasting. We give an O ( n log ⁡ n ) time algorithm solving the problem. If the number of agents is sufficiently large (at least equal to the number of leaves of T), then our approach results in an O ( n ) time algorithm. When the source of information s is initially at the root r, our algorithm solves the problem of searching the tree (exploring it) by a set of agents using minimal total energy.

TCS Journal 2018 Journal Article

Efficient algorithms for shortest partial seeds in words

  • Tomasz Kociumaka
  • Solon P. Pissis
  • Jakub Radoszewski
  • Wojciech Rytter
  • Tomasz Waleń

A factor u of a word w is a cover of w if every position in w lies within some occurrence of u in w. A factor u is a seed of w if it is a cover of a superstring of w. Covers and seeds extend the classical notions of periodicity. We introduce a new notion of α-partial seed, that is, a factor covering as a seed at least α positions in a given word. We use the Cover Suffix Tree, recently introduced in the context of α-partial covers (Kociumaka et al. , 2015, [13]); an O ( n log ⁡ n ) -time algorithm constructing such a tree is known. However, it appears that partial seeds are more complicated than partial covers—our algorithms require algebraic manipulations of special functions related to edges of the modified Cover Suffix Tree and the border array. We present a procedure for computing shortest α-partial seeds that works in O ( n ) time if the Cover Suffix Tree is already given. This is a full version, which includes all the proofs, of a paper that appeared at CPM 2014 [1].

TCS Journal 2018 Journal Article

On semi-perfect de Bruijn words

  • Damian Repke
  • Wojciech Rytter

We show an application of Lempel's recursive construction of De Bruijn words to the generation of binary words having many factor-rich prefixes. A binary word is said to be factor-rich iff it has the largest number of distinct factors among binary words with the same length. A linear de Bruijn word of rank n is a shortest word containing (as a factor) exactly once each binary word of length n. It is factor-rich and its length equals Δ n = 2 n + n − 1. We construct for each n a binary linear de Bruijn word of rank n which is semi-perfect in the following sense: each of its prefixes of length m > Δ n − 1 is factor-rich. The number Δ n − 1 is the best possible (for n > 2 there is no linear binary de Bruijn word with factor-rich prefix of length m = Δ n − 1 ). We show an efficient algorithm constructing compact description of binary semi-perfect de Bruijn words.

TCS Journal 2018 Journal Article

On the string consensus problem and the Manhattan sequence consensus problem

  • Tomasz Kociumaka
  • Jakub W. Pachocki
  • Jakub Radoszewski
  • Wojciech Rytter
  • Tomasz Waleń

We study the Manhattan Sequence Consensus problem (MSC problem) in which we are given k integer sequences, each of length ℓ, and we are to find an integer sequence x of length ℓ (called a consensus sequence) such that the maximum Manhattan distance of x from each of the input sequences is minimized. A related problem, with Hamming distance instead of Manhattan distance, is called Hamming String Consensus (HSC), also known under the names of string center problem or closest string problem. For binary sequences Manhattan distance coincides with Hamming distance, hence in this case HSC is a special case of MSC. We design a practically efficient O ( ℓ ) -time algorithm solving MSC for k ≤ 5 sequences. It improves upon the quadratic algorithm by Amir et al. (2012) [1] for HSC for k = 5 binary strings. Similarly as in the algorithm of Amir et al. , we use a column-based framework. We replace the implied general integer linear programming by its easy special cases due to combinatorial properties of MSC for k ≤ 5. Practicality of our algorithms has been verified experimentally. We also show that for a general parameter k any instance can be reduced in linear time to a kernel of size k! , so the problem is fixed-parameter tractable. Nevertheless, for k ≥ 4 this is still too large for any naive solution to be feasible in practice. This is a full version of an article published at SPIRE 2014 [15].

TCS Journal 2017 Journal Article

Covering problems for partial words and for indeterminate strings

  • Maxime Crochemore
  • Costas S. Iliopoulos
  • Tomasz Kociumaka
  • Jakub Radoszewski
  • Wojciech Rytter
  • Tomasz Waleń

Indeterminate strings are a subclass of non-standard words having non-deterministic nature. In a classic string every position contains exactly one symbol—we say it is a solid symbol—while in an indeterminate string a position may contain a set of symbols (possible at this position); such sets are called non-solid symbols. The most important subclass of indeterminate strings are partial words, where each non-solid symbol is the whole alphabet; in this case non-solid symbols are also called don't care symbols. We consider the problem of finding a shortest cover of an indeterminate string, i. e. , finding a shortest solid string whose occurrences cover the whole indeterminate string. We show that this classical problem becomes NP-complete for indeterminate strings and even for partial words. The proof of this fact is one of the main results of this paper. Our other main results focus on design of algorithms efficient with respect to certain parameters of the input (so called FPT algorithms) for the shortest cover problem. For the indeterminate string covering problem we obtain an O ( n k 2 + 2 k k 3 ) -time algorithm, where k is the number of non-solid symbols, while for the partial word covering problem we obtain a running time of O ( n k 2 + 2 O ( k log ⁡ k ) ). Additionally, we prove that, unless the Exponential Time Hypothesis is false, no 2 o ( k ) n O ( 1 ) -time solution exists for either problem, which shows that our algorithm for partial words is close to optimal. We also present an algorithm for both problems parameterized both by k and the alphabet size with a simple implementation. A preliminary version of this article was presented at the 25th International Symposium on Algorithms and Computation (ISAAC 2014), LNCS, vol. 8889, pp. 220–232, Springer (2014) [12].

TCS Journal 2016 Journal Article

Maximum number of distinct and nonequivalent nonstandard squares in a word

  • Tomasz Kociumaka
  • Jakub Radoszewski
  • Wojciech Rytter
  • Tomasz Waleń

The combinatorics of nonstandard squares in a word depends on how the equivalence of halves of the square is defined. We consider Abelian squares, parameterized squares, and order-preserving squares. The word uv is an Abelian (parameterized, order-preserving) square if u and v are equivalent in the Abelian (parameterized, order-preserving) sense. The maximum number of ordinary squares in a word is known to be asymptotically linear, but the exact bound is still investigated. We present several results on the maximum number of distinct squares for nonstandard factor equivalence relations. Let SQ Abel ( n, σ ) and SQ Abel ′ ( n, σ ) denote the maximum number of Abelian squares in a word of length n over an alphabet of size σ which are distinct as words and which are nonequivalent in the Abelian sense, respectively. For σ ≥ 2 we prove that SQ Abel ( n, σ ) = Θ ( n 2 ), SQ Abel ′ ( n, σ ) = Ω ( n 3 / 2 ) and SQ Abel ′ ( n, σ ) = O ( n 11 / 6 ). We also give linear bounds for parameterized and order-preserving squares for alphabets of constant size: SQ param ( n, O ( 1 ) ) = Θ ( n ), SQ op ( n, O ( 1 ) ) = Θ ( n ). The upper bounds have quadratic dependence on the alphabet size for order-preserving squares and exponential dependence for parameterized squares. As a side result we construct infinite words over the smallest alphabet which avoid nontrivial order-preserving squares and nontrivial parameterized cubes (nontrivial parameterized squares cannot be avoided in an infinite word). A preliminary version of this paper was published at DLT 2014 [24]. In this full version we improve or extend the bounds on all three kinds of squares.

TCS Journal 2016 Journal Article

Order-preserving indexing

  • Maxime Crochemore
  • Costas S. Iliopoulos
  • Tomasz Kociumaka
  • Marcin Kubica
  • Alessio Langiu
  • Solon P. Pissis
  • Jakub Radoszewski
  • Wojciech Rytter

Kubica et al. [33] and Kim et al. [29] introduced order-preserving pattern matching: for a given text the goal is to find its factors having the same ‘shape’ as a given pattern. Known results include a linear-time algorithm for this problem (in case of polynomially-bounded alphabet) and a generalization to multiple patterns. We propose an index that enables order-preserving pattern matching queries in time proportional to pattern length. The index can be constructed in O ( n log ⁡ log ⁡ n ) expected time or in O ( n log 2 ⁡ log ⁡ n / log ⁡ log ⁡ log ⁡ n ) worst-case time. It is an incomplete order-preserving suffix tree which may miss a single edge label at each branching node. For most applications such incomplete suffix trees provide the same functional power as the complete ones. We show a number of their applications, including computation of longest common factors, longest previously occurring factors and squares in a string in the order-preserving setting. We also give an O ( n log ⁡ n ) -time algorithm constructing complete order-preserving suffix trees.

TCS Journal 2016 Journal Article

Two fast constructions of compact representations of binary words with given set of periods

  • Wojciech Rytter

Assume we are given a sorted set P of size n of all periods of an unknown string of size N. Our main result is an algorithm generating in O ( n ) time and O ( 1 ) space a compressed representation of size O ( n ) of the lexicographically-first binary string having P as the set of its periods. The input is read-only and the output is write-only. We also present a very simple preliminary algorithm generating some binary string (not necessarily lexicographically-first one) with the same set of periods. The explicit size N of the produced string can be exponential with respect to n. We assume that a given set of periods is valid: there exists some unknown string realizing this set.

SODA Conference 2015 Conference Paper

Internal Pattern Matching Queries in a Text and Applications

  • Tomasz Kociumaka
  • Jakub Radoszewski
  • Wojciech Rytter
  • Tomasz Walen

We consider several types of internal queries: questions about subwords of a text. As the main tool we develop an optimal data structure for the problem called here internal pattern matching. This data structure provides constant-time answers to queries about occurrences of one subword x in another subword y given text, assuming that, which allows for a constant-space representation of all occurrences. This problem can be viewed as a natural extension of the well-studied pattern matching problem. The data structure has linear size and admits a linear-time construction algorithm. Using the solution to the internal pattern matching problem, we obtain very efficient data structures answering queries about: primitivity of subwords, periods of subwords, general substring compression, and cyclic equivalence of two subwords. All these results improve upon the best previously known counterparts. The linear construction time of our data structure also allows to improve the algorithm for finding δ-subrepetitions in a text (a more general version of maximal repetitions, also called runs). For any fixed δ we obtain the first linear-time algorithm, which matches the linear time complexity of the algorithm computing runs. Our data structure has already been used as a part of the efficient solutions for subword suffix rank & selection, as well as substring compression using Burrows-Wheeler transform composed with run-length encoding. The model of internal queries in texts is connected to the well-studied problem of text indexing. Both models have their origins in the introduction of suffix trees. However, there is an important difference: in our model the size of the representation of a query is constant and therefore enables faster query time. Our results can be viewed as efficient solutions to “internal” equivalents of several basic problems of regular pattern matching and make an improvement in a majority of already published results related to internal queries.

TCS Journal 2015 Journal Article

Searching for Zimin patterns

  • Wojciech Rytter
  • Arseny M. Shur

In the area of pattern avoidability the central role is played by special words called Zimin patterns. The symbols of these patterns are treated as variables and the rank of the pattern is its number of variables. Zimin type of a word x is introduced here as the maximum rank of a Zimin pattern matching x. We show how to compute Zimin type of a word on-line in linear time. Consequently we get a quadratic time, linear-space algorithm for searching Zimin patterns in words. Then we demonstrate how the Zimin type of the length n prefix of the infinite Fibonacci word is related to the representation of n in the Fibonacci numeration system. Using this relation, we prove that Zimin types of such prefixes and Zimin patterns inside them can be found in logarithmic time. Finally, we give some upper bounds on the function f ( n, k ) such that every k-ary word of length at least f ( n, k ) has a factor that matches the rank n Zimin pattern.

TCS Journal 2014 Journal Article

Efficient counting of square substrings in a tree

  • Tomasz Kociumaka
  • Jakub Pachocki
  • Jakub Radoszewski
  • Wojciech Rytter
  • Tomasz Waleń

We give an algorithm which in O ( n log 2 n ) time counts all distinct squares in a labeled tree. There are two main obstacles to overcome. The first one is that the number of distinct squares in a tree is Ω ( n 4 / 3 ) (see Crochemore et al. , 2012 [7]), which differs substantially from the case of classical strings for which there are only linearly many distinct squares. We overcome this obstacle by using a compact representation of all squares (based on maximal cyclic shifts) which requires only O ( n log n ) space. The second obstacle is lack of adequate algorithmic tools for labeled trees, consequently we design several novel tools, this is the most complex part of the paper. In particular we extend to trees Imre Simon's compact representations of the failure table in pattern matching machines.

SODA Conference 2012 Conference Paper

A linear time algorithm for seeds computation

  • Tomasz Kociumaka
  • Marcin Kubica 0001
  • Jakub Radoszewski
  • Wojciech Rytter
  • Tomasz Walen

A seed in a word is a relaxed version of a period. We show a linear time algorithm computing a compact representation of all the seeds of a word, in particular, the shortest seed. Thus, we solve an open problem stated in the survey by Smyth (2000) and improve upon a previous over 15-year old O ( n log n ) algorithm by Iliopoulos, Moore and Park (1996). Our approach is based on combinatorial relations between seeds and a variant of the LZ-factorization (used here for the first time in context of seeds).

TCS Journal 2009 Journal Article

Compressed string-matching in standard Sturmian words

  • Paweł Baturo
  • Wojciech Rytter

We present a simple algorithm which for an explicitly given input string p a t (a pattern) and a standard Sturmian word x described by the recurrences of size n computes, in time O ( | p a t | + n ), the set of all occurrences of p a t in x as a single arithmetic progression (modulo the length of x ). The algorithm can be extended to the case when some letters of the pattern are replaced by a don’t care symbol. In this case the set of all occurrences does not need to be a single arithmetic progression and our algorithm produces linearly many (with respect to the size of p a t ) arithmetic progressions. It is an example of fast computations for the input given in a compressed form. In our special case the length of the standard Sturmian word x is usually exponential with respect to the size of the input.

TCS Journal 2009 Journal Article

Repetitions in strings: Algorithms and combinatorics

  • Maxime Crochemore
  • Lucian Ilie
  • Wojciech Rytter

The article is an overview of basic issues related to repetitions in strings, concentrating on algorithmic and combinatorial aspects. This area is important both from theoretical and practical points of view. Repetitions are highly periodic factors (substrings) in strings and are related to periodicities, regularities, and compression. The repetitive structure of strings leads to higher compression rates, and conversely, some compression techniques are at the core of fast algorithms for detecting repetitions. There are several types of repetitions in strings: squares, cubes, and maximal repetitions also called runs. For these repetitions, we distinguish between the factors (sometimes qualified as distinct) and their occurrences (also called positioned factors). The combinatorics of repetitions is a very intricate area, full of open problems. For example we know that the number of (distinct) primitively-rooted squares in a string of length n is no more than 2 n − Θ ( log n ), conjecture to be n, and that their number of occurrences can be Θ ( n log n ). Similarly we know that there are at most 1. 029 n and at least 0. 944 n maximal repetitions and the conjecture is again that the exact bound is n. We know almost everything about the repetitions in Sturmian words, but despite the simplicity of these words, the results are nontrivial. One of the main motivations for writing this text is the development during the last couple of years of new techniques and results about repetitions. We report both the progress which has been achieved and which we expect to happen.

TCS Journal 2007 Journal Article

Equivalence of simple functions

  • Cédric Bastien
  • Jurek Czyzowicz
  • Wojciech Fraczak
  • Wojciech Rytter

A partial function F: Σ ∗ → Ω ∗ is called a simple function if F ( w ) ∈ Ω ∗ is the output produced in the leftmost derivation of a word w ∈ Σ ∗ from a nonterminal of a simple context free grammar G with output alphabet Ω. In this paper we present an efficient algorithm for testing the equivalence of simple functions. Such functions correspond also to one-state deterministic pushdown transducers. Our algorithm works in time polynomial with respect to | G | + v ( G ), where | G | is the size of the textual description of G, and v ( G ) is the maximum of the shortest lengths of words generated by nonterminals of G.

I&C Journal 2007 Journal Article

The number of runs in a string

  • Wojciech Rytter

A run in a string is a nonextendable (with the same minimal period) periodic segment in a string. The set of runs corresponds to the structure of internal periodicities in a string. Periodicities in strings were extensively studied and are important both in theory and practice (combinatorics of words, pattern-matching, computational biology). Let ρ ( n ) be the maximal number of runs in a string of length n. It has been shown that ρ ( n ) = O ( n ), the proof was very complicated and the constant coefficient in O ( n ) has not been given explicitly. We demystify the proof of the linear upper bound for ρ ( n ) and propose a new approach to the analysis of runs based on the properties of subperiods: the periods of periodic parts of the runs We show that ρ ( n ) ≤ 3. 44 n and there are at most O. 67 n runs with periods larger than 87. This supports the conjecture that the number of all runs is smaller than n. We also give a completely new proof of the linear bound and discover several new interesting “periodicity lemmas”.

MFCS Conference 2006 Conference Paper

Faster Algorithm for Bisimulation Equivalence of Normed Context-Free Processes

  • Slawomir Lasota 0001
  • Wojciech Rytter

Abstract The fastest known algorithm for checking bisimulation equivalence of normed context-free processes worked in O ( n 13 ) time. We give an alternative algorithm working in \(O(n^8 {\sl polylog} n)\) time, As a side effect we improve the best known upper bound for testing equivalence of simple context-free grammars from \(O(n^7 {\sl polylog} n)\) to \(O(n^6 {\sl polylog} n)\).

TCS Journal 2006 Journal Article

Prime normal form and equivalence of simple grammars

  • Cédric Bastien
  • Jurek Czyzowicz
  • Wojciech Fraczak
  • Wojciech Rytter

A prefix-free language is prime if it cannot be decomposed into a concatenation of two prefix-free languages. We show that we can check in polynomial time if a language generated by a simple context-free grammar is prime. Our algorithm computes a canonical representation of a simple language, converting its arbitrary simple grammar into prime normal form (PNF); a simple grammar is in PNF if all its nonterminals define primes. We also improve the complexity of testing the equivalence of simple grammars. The best previously known algorithm for this problem worked in O ( n 13 ) time. We improve it to O ( n 7 log 2 n ) and O ( n 5 polylog v ) time, where n is the total size of the grammars involved, and v is the length of a shortest string derivable from a nonterminal, maximized over all nonterminals.

TCS Journal 2006 Journal Article

The structure of subword graphs and suffix trees of Fibonacci words

  • Wojciech Rytter

We use automata-theoretic approach to analyze properties of Fibonacci words. The directed acyclic subword graph (dawg) is a useful deterministic automaton accepting all suffixes of the word. We show that dawg's of Fibonacci words have particularly simple structure. Our main result is a unifying framework for a large collection of relatively simple properties of Fibonacci words. The simple structure of dawgs of Fibonacci words gives in many cases simplified alternative proofs and new interpretation of several well-known properties of Fibonacci words. In particular, the structure of lengths of paths corresponds to a number-theoretic characterization of occurrences of any subword. Using the structural properties of dawg's it can be easily shown that for a string w we can check if w is a subword of a Fibonacci word in time O ( | w | ) and O ( 1 ) space. Compact dawg's of Fibonacci words show a very regular structure of their suffix trees and show how the suffix tree for the Fibonacci word grows (extending the leaves in a very simple way) into the suffix tree for the next Fibonacci word.

TCS Journal 2005 Journal Article

On the complexity of decidable cases of the commutation problem of languages

  • Juhani Karhumäki
  • Wojciech Plandowski
  • Wojciech Rytter

We investigate the complexity of basic decidable cases of the commutation problem for languages: testing the equality XY = YX for two languages X and Y. We show that it varies from co-NEXPTIME complete through PSPACE complete and co-NP complete to deterministic polynomial time, when Y is an explicitly given finite language and X is given by a CF grammar generating a finite language, a nondeterministic finite automaton (or a regular expression), an acyclic nondeterministic finite automaton or an explicitly given finite language, respectively. Interestingly in most cases the complexity status does not change if instead of explicitly given finite Y we consider general Y of the same type as X. For deterministic finite automata the problem remains open, due to the asymmetry of the catenation.

TCS Journal 2003 Journal Article

Application of Lempel–Ziv factorization to the approximation of grammar-based compression

  • Wojciech Rytter

We introduce new type of context-free grammars, AVL-grammars, and show their applicability to grammar-based compression. Using this type of grammars we present O(n log |Σ|) time and O(log n)-ratio approximation of minimal grammar-based compression of a given string of length n over an alphabet Σ and O(k log n) time transformation of LZ77 encoding of size k into a grammar-based encoding of size O(k log n). A preliminary version of this paper has been presented in Rytter (Combinatorial Pattern Matching, Lecture Notes in Computer Science, vol. 2373, Springer, Berlin, June 2000, pp. 20–31), independently of Charikar et al. (STOC, 2002), where grammar-based approximation has been attacked with different construction and a more complicated type of grammars (α-balanced grammars for α⩽1− 1 2 2 ). The AVL-grammar is a very natural and simple tool for grammar based compression, it is a straightforward extension of the classical AVL-tree.

FOCS Conference 2003 Conference Paper

Broadcasting Algorithms in Radio Networks with Unknown Topology

  • Artur Czumaj
  • Wojciech Rytter

In this paper we present new randomized and deterministic algorithms for the classical problem of broadcasting in radio networks with unknown topology. We consider directed n-node radio networks with specified eccentricity D (maximum distance from the source node to any other node). Our first main result closes the gap between the lower and upper bound: we describe an optimal randomized broadcasting algorithm whose running time complexity is O(D log(n/D) + log/sup 2/n), with high probability. In particular, we obtain a randomized algorithm that completes broadcasting in any n-node radio network in time O(n), with high probability. The main source of our improvement is a better "selecting sequence" used by the algorithm that brings some stronger property and improves the broadcasting time. Next, we demonstrate how to apply our approach to deterministic broadcasting, and describe a deterministic oblivious algorithm that completes broadcasting in almost optimal time O(n log/sup 2/D). Finally, we show how our randomized broadcasting algorithm can be used to improve the randomized complexity of the gossiping problem.

MFCS Conference 2003 Conference Paper

Faster Algorithms for k -Medians in Trees

  • Robert Benkoczi
  • Binay K. Bhattacharya
  • Marek Chrobak
  • Lawrence L. Larmore
  • Wojciech Rytter

Abstract In the k -median problem we are given a connected graph with non-negative weights associated with the nodes and lengths associated with the edges. The task is to compute locations of k facilities in order to minimize the sum of the weighted distances between each node and its closest facility. In this paper we consider the case when the graph is a tree. We show that this problem can be solved in time \(O(n {\mbox{\rm polylog}} (n))\) for the following cases: (i) directed trees (and any fixed k ), (ii) balanced undirected trees, and (iii) undirected trees with k =3.

TCS Journal 2003 Journal Article

On maximal suffixes and constant-space linear-time versions of KMP algorithm

  • Wojciech Rytter

Constant-space linear-time string-matching algorithms are usually very sophisticated. Most of them consist of two phases: (very technical) preprocessing phase and searching phase. An exception is one-phase Crochemore's algorithm (Theoret. Comput. Sci. 92 (1992) 33). It is an on-line version of Knuth–Morris–Pratt algorithm (KMP) with “on-the-fly” computation of pattern shifts (as approximate periods). In this paper we explore further Crochemore's approach, and construct alternative algorithms which are differently structured. In Crochemore's algorithm the approximate-period function is restarted from inside, which means that several internal variables of this function are changing globally, also Crochemore's algorithm strongly depends on the concrete implementation of approximate-periods computation. We present a simple modification of KMP algorithm which works in O(1) space, O(n) time for any function which computes periods or approximate periods in O(1)-space and linear time. The approximate-period function can be treated as a black box. We identify class of patterns, self-maximal words, which are especially well suited for Crochemore-style string matching. A new O(1)-space string-matching algorithm, MaxSuffix-Matching, is proposed in the paper, which gives yet another example of applicability of maximal suffixes.

TCS Journal 2003 Journal Article

On polynomial-time approximation algorithms for the variable length scheduling problem

  • Artur Czumaj
  • Leszek Ga̧sieniec
  • Daya Ram Gaur
  • Ramesh Krishnamurti
  • Wojciech Rytter
  • Michele Zito

This paper may be viewed as a corrigendum as well as an extension of the paper by (Czumaj et al. , Theoret. Comput. Sci. 262 (1–2), (2001) 569–582) where they deal with the variable length scheduling problem (VLSP) with parameters k 1, k 2, denoted VLSP(k 1, k 2). In the current paper, we first discuss an error in the analysis of one of the approximation algorithms described in (Czumaj et al. , Theoret. Comput. Sci. 262 (1–2), (2001) 569–582), where an approximation algorithm for VLSP(k 1, k 2), k 1<k 2, was presented and it was claimed that the algorithm achieves the approximation ratio of 1+(k 1(k 2−k 1))/k 2. In this paper we give a problem instance for which the same algorithm obtains the approximation ratio ≈ k2 k1. We then present two simple approximation algorithms, one for the case k1 =1 with an approximation ratio of 2, and one for the case k 1>1 with an approximation ratio of 2+(k 2/2k 1). This corrects the result claimed in (Czumaj et al. , Theoret. Comput. Sci. 262 (1–2), (2001) 569–582).

TCS Journal 2001 Journal Article

Efficient web searching using temporal factors

  • Artur Czumaj
  • Ian Finch
  • Leszek Ga̧sieniec
  • Alan Gibbons
  • PAUL LENG
  • Wojciech Rytter
  • Michele Zito

We study the issues involved in the design of algorithms for performing information gathering more efficiently, by taking advantage of anticipated variations in access times in different regions at different times of the day or week. We look at the problem theoretically, as a generalisation of single processor sequencing with release times and deadlines, in which performance times (lengths) of the tasks can change in time. The new problem is called Variable Length Sequencing Problem (VLSP). We show that although the decision version of VLSP seems to be intractable in the general case, it can be solved optimally for lengths 1 and 2. This result opens the possibility of practicable algorithms to schedule searches efficiently when expected access times can be categorised as either slow or fast. Some algorithms for more general cases are examined and complexity results derived.

MFCS Conference 2001 Conference Paper

The k-Median Problem for Directed Trees

  • Marek Chrobak
  • Lawrence L. Larmore
  • Wojciech Rytter

Abstract The k -median problem is a classical facility location problem. We consider the k -median problem for directed trees, motivated by the problem of locating proxies on the World Wide Web. The two main results of the paper are an O(n log n) time algorithm for k=2 and an O(n log 2 n) time algorithm for k=3. The previously known upper bounds for these two cases were O ( n 2 ).

FOCS Conference 2000 Conference Paper

Fast Broadcasting and Gossiping in Radio Networks

  • Marek Chrobak
  • Leszek Gasieniec
  • Wojciech Rytter

We establish an O(n log/sup 2/n) upper bound on the time for deterministic distributed broadcasting in multi-hop radio networks with unknown topology. This nearly matches the known lower bound of /spl Omega/(n log n). The fastest previously known algorithm for this problem works in time O(n/sup 3/2/). Using our broadcasting algorithm, we develop an O(n/sup 3/2/log/sup 2/n) algorithm for gossiping in the same network model.

TCS Journal 1999 Journal Article

Constant-space string-matching in sublinear average time

  • Maxime Crochemore
  • Leszek Ga̧sieniec
  • Wojciech Rytter

Given two strings: pattern P of length m and text T of length n. The string-matching problem is to find all occurrences of the pattern P in the text T. We present a string-matching algorithms which works in o(n) average time and constant additional space for one-dimensional texts and two-dimensional arrays. This is a first attempt to the small-space string-matching problem in which sublinear time algorithms are achieved. We show that all occurrences of one- or two-dimensional patterns can be found in O( n r ) average time with constant memory, where r is the repetition size of P (size of the longest repeated subword of P).

MFCS Conference 1999 Conference Paper

Efficiency of Fast Parallel Pattern Searching in Highly Compressed Texts

  • Leszek Gasieniec
  • Alan Gibbons
  • Wojciech Rytter

Abstract We consider efficiency of NC -algorithms for pattern-searching in highly compressed one- and two-dimensional texts. “Highly compressed” means that the text can be exponentially large with respect to its compressed version, and “fast” means “in polylogarithmic time”. Given an uncompressed pattern P and a compressed version of a text T, the compressed matching problem is to test if P occurs in T. Two types of closely related compressed representations of 1-dimensional texts are considered: the Lempel-Ziv encodings (LZ, in short) and restricted LZ encodings (RLZ, in short). For highly compressed texts there is a small difference between them, in extreme situations both of them compress text exponentially, e. g. Fibonacci words of size N have compressed versions of size O (log N ) for LZ and Restricted LZ encodings. Despite similarities we prove that LZ -compressed matching is P-complete while RLZ -compressed matching is rather trivially in NC. We show how to improve a naive straightforward NC algorithm and obtain almost optimal parallel RLZ-compressed matching applying tree-contraction techniques to directed acyclic graphs with polynomial tree-size. As a corollary we obtain an almost optimal parallel algorithm for LZW-compressed matching which is simpler than the (more general) algorithm in [ 11 ]. Highly compressed 2-dimensional texts are also considered.

TCS Journal 1999 Journal Article

Generalized factorizations of words and their algorithmic properties

  • Juhani Karhumäki
  • Wojciech Plandowski
  • Wojciech Rytter

We formalize the notion of a factorization of a word, a so-called F -factorization, introduced in [7] when solving some open problems on word equations. We show that most of the factorizations considered in the literature fit well into that framework, and in particular that central algorithmic problems, such as the uniqueness or the synchronizability, remain polynomial time solvable for an important and large class of F -factorizations, namely for regular F -factorizations.

TCS Journal 1998 Journal Article

Alphabet-independent optimal parallel search for three-dimensional patterns

  • Marek Karpinski
  • Wojciech Rytter

We give an alphabet-independent optimal parallel algorithm for the searching phase of three-dimensional pattern matching. All occurrences of a three-dimensional pattern P of shape m × m × m in a text T of shape n × n × n are to be found. Our algorithm works in log m time with O(N/ log(m)) processors on a CREW PRAM, where N = n 3. Some ideas from [3] are used. We explore classification of two-dimensional periodicities of faces of the cubic pattern. Some projection techniques are developed to deal with three dimensions. The nonperiodicity implies some sparseness properties, while periodicity implies other special useful properties (i. e. , monotonicity) of the set of occurrences. Both types of properties are used in deriving our algorithm. The advantage of our approach is that it is essentially two-dimensional, no special properties related to three dimensions and no new complicated data structures are considered, the resulting algorithm is rather simple. The search phase is preceded by the preprocessing phase (computation of the witness table). Our main results concern the searching phase, however, we present shortly a new approach to the second phase also. Usefulness of the dictionaries of basic factors (DBFs, see [9]), in the computation of the three-dimensional witness table is presented. Our algorithms can be easily adjusted to the case of unequally sided patterns.

TCS Journal 1997 Journal Article

Correctness of constructing optimal alphabetic trees revisited

  • Marek Karpinski
  • Lawrence L. Larmore
  • Wojciech Rytter

Several new observations which lead to new correctness proofs of two known algorithms (Hu-Tucker and Garsia-Wachs) for construction of optimal alphabetic trees are presented. A generalized version of the Garsia-Wachs algorithm is given. Proof of this generalized version works in a structured and illustrative way and clarifies the usually poorly understood behavior of both the Hu-Tucker and Garsia-Wachs algorithms. The generalized version permits any nonnegative weights, as opposed to strictly positive weights required in the original Garsia-Wachs algorithm. New local structural properties of optimal alphabetic trees are given. The concept of well-shaped segment (a part of an optimal tree) is introduced. It is shown that some parts of the optimal tree are known in advance to be well-shaped, and this implies correctness of the algorithms rather easily. The crucial part of the correctness proof of the Garsia-Wachs algorithm, namely the structural theorem, is identified. The correctness proof of the Hu-Tucker algorithm consists of showing a very simple mutual simulation between this algorithm and the Garsia-Wachs algorithm. For this proof, it is essential to use the generalized version of Garsia-Wachs algorithm, in which an arbitrary locally minimal pair is processed, not necessarily the rightmost minimal pair. Such a generalized version is also needed for parallel implementations. Another result presented in this paper is the clarification of the problem of resolving ties (equalities between weights of items) in the Hu-Tucker algorithm. This is related to the proof, by simulation, of correctness of the Hu-Tucker algorithm. It is shown that the condition that there are no ties may generally be assumed without harm and that, essentially, the Hu-Tucker algorithm avoids ties automatically.

TCS Journal 1995 Journal Article

Context-free recognition via shortest paths computation: a version of Valiant's algorithm

  • Wojciech Rytter

We present a new algorithm recognizing general context-free languages in O(BM(n)) time, where BM(n) is the time to multiply two n × n Boolean matrices. The only known algorithm for this problem with the same asymptotic complexity is Valiant's (1975) algorithm, which is quite sophisticated. The problem related to texts is reduced to arithmetics of matrices whose elements are in a semiring of constant size. The main difficulty in Valiant's algorithm is nonassociativity of considered semirings; the main point in our algorithm is that nonassociative semirings are replaced by associative ones. This simplifies the algorithm considerably. Our algorithm is more structured, its main part is a computation of shortest paths in a special graph called here the lattice graph. Valiant's lemma, see Harrison (1978), is replaced here by a shortest paths lemma. The shortest paths problem for lattice graphs is also interesting on its own.

TCS Journal 1995 Journal Article

The zooming method: a recursive approach to time-space efficient string-matching

  • Leszek Ga̧sieniec
  • Wojciech Plandowski
  • Wojciech Rytter

A new approach to time-space efficient string-matching is presented. The method is flexible, its implementation depends whether or not the alphabet is linearly ordered. The only known linear-time constant-space algorithm for string-matching over nonordered alphabets is the Galil-Seiferas algorithm, see Crochemore (1993) and Galil (1983) which are rather complicated. The zooming method gives probably the simplest string-matching algorithm working in constant space and linear time for nonordered alphabets. The novel feature of our algorithm is the application of the searching phase (which is usually simpler than preprocessing) in the preprocessing phase. The preprocessing has a recursive structure similar to selection in linear time, see Aho (1974). For ordered alphabets the preprocessing part is much simpler, its basic component is a simple and well-known algorithm for finding the maximal suffix, see Duval (1983). Hence we demonstrate a new application of this algorithm, see also Crochemore (1991). The idea of the zooming method was applied by Crochemore et al. (1995) to two-dimensional patterns.

MFCS Conference 1994 Conference Paper

On a Sublinear Time Parallel Construction of Optimal Binary Search Trees

  • Marek Karpinski
  • Wojciech Rytter

Abstract We design an efficient sublinear time parallel construction of optimal binary search trees. The efficiency of the parallel algorithm corresponds to its total work (the product time × processors ). Our algorithm works in O (n 1−ɛ log n ) time with the total work O (n 2−2ɛ ), for an arbitrarily small constant 0 < ε ≤ 1/2. This is optimal within a factor n 2ɛ with respect to the best known sequential algorithm given by Knuth, which needs only O (n 2 ) time due to a monotonicity property of optimal binary search trees, see [6]). It is unknown how to explore this property in an efficient NC construction of binary search trees. Here we show that it can be effectively used in sublinear time parallel computation. Our improvement also relies on the use (in independently processed small subcomputations) of the parallelism present in Knuth's algorithm. The best known sublinear time algorithms for the construction of binary search trees (as an instance of a more general problem) have O (n 3 ) work for time larger than n 3/4, see [3] and [7]. For time √n these algorithms need n 4 work, while our algorithm needs for this time only n 3 work, thus improving the known algorithms by a linear factor. Also if time is O (n 1−ɛ ) and ε is very small our improvement is close to O( n ). Such improvement is similar to the one implied by the monotonicity property in sequential computations (from n 3 sequential time for a more general dynamic programming problem to n 2 time for the special case of optimal binary search trees).

TCS Journal 1994 Journal Article

On two-dimensional pattern matching by optimal parallel algorithms

  • Maxime Crochemore
  • Wojciech Rytter

Simplified versions of Kedem–Landau–Palem algorithms for parallel one-dimensional and two-dimensional pattern-matching on a CRCW PRAM are presented. We show that the only nontrivial part of KLP algorithm is the preprocessing part: computation of consistent names of very small factors. The crucial part in KLP algorithm is a suffix–prefix matching subprocedure. In our algorithm such a subprocedure is avoided. A novel algorithm for 2-dimensional matching is presented which is more directly designed for two-dimensional objects. It does not use the multi-text/multi-pattern approach as in KLP algorithm. Techniques for constructing parallel image identification algorithms are introduced: cutting images into small factors, and compressing images by a parallel reduction of a large number of such independent factors into smaller objects. The importance of five types of factors is emphasized. A new useful type of two-dimensional factors is introduced: thin factors.

TCS Journal 1994 Journal Article

Two results on linear embeddings of complete binary trees

  • Marek Chrobak
  • Wojciech Rytter

Given a binary tree T with n vertices, we want to embed T onto a given set A of n points on the line so as to minimize the total embedded edge length. Polynomial-time algorithms for the two following special cases of this problem can be found in the literature: 1. when T is arbitrary but A = {1…n}. 2. when T is a complete binary tree and A is arbitrary. To the best of our knowledge, the complexity of the general problem is open. In this paper we deal with case (2). Bern et al. presented an algorithm for this case that runs in time O(n 5. 76) and uses O(n 3. 2) space. They also considered the naive embedding, which maps the root r of T into the middle point a of A, and then embeds, recursively, the left and right subtrees of r to the left and right of a, respectively. This is equivalent to embedding T from left to right according to the inorder traversal. They prove that this naive algorithm approximates the optimal solution within the factor of 3. The main results of this paper are: (i) the proof that the approximation ratio of this naive algorithm is exactly 7 3, and (ii) a more efficient algorithm for computing minimum embeddings of complete binary trees. Our algorithm runs in time O (n 1 + log 3) = O(n 2. 59), and uses O (n) space, where O (f) = O(f log c n), for some constant c > 0.

TCS Journal 1993 Journal Article

Efficient constructions of test sets for regular and context-free languages

  • Juhani Karhuma¨ki
  • Wojciech Rytter
  • Stefan Jarominek

We present a simple construction of linear size test sets for regular languages and of single exponential test sets for context-free languages. In the case of regular sets the size of our test set is exactly the number of transitions of the automaton. This improves the best-known upper bounds: exponential for regular and doubly exponential for context-free languages. We give also an O(n log n) time algorithm for the morphism equivalence and an O(n 3 log n) time algorithm to test the gsm equivalence on a regular language. An O(n 2 log n) time algorithm is given to test the equivalence of two deterministic gsm's as well as that of two deterministic finite transducers.

FOCS Conference 1993 Conference Paper

Optimally fast parallel algorithms for preprocessing and pattern matching in one and two dimensions

  • Richard Cole 0001
  • Maxime Crochemore
  • Zvi Galil
  • Leszek Gasieniec
  • Ramesh Hariharan
  • S. Muthukrishnan 0001
  • Kunsoo Park
  • Wojciech Rytter

All algorithms below are optimal alphabet-independent parallel CRCW PRAM algorithms. In one dimension: Given a pattern string of length m for the string-matching problem, we design an algorithm that computes a deterministic sample of a sufficiently long substring in constant time. This problem used to be a bottleneck in the pattern preprocessing for one- and two-dimensional pattern matching. The best previous time bound was O(log/sup 2/ m/log log m). We use this algorithm to obtain the following results. 1. Improving the preprocessing of the constant-time text search algorithm from O(log/sup 2/ m/log log m) to n(log log m), which is now best possible. 2. A constant-time deterministic string-matching algorithm in the case that the text length n satisfies n=/spl Omega/(m/sup 1+/spl epsiv//) for a constant /spl epsiv/>0. 3. A simple probabilistic string-matching algorithm that has constant time with high probability for random input. 4. A constant expected time Las-Vegas algorithm for computing the period of the pattern and all witnesses and thus string matching itself, solving the main open problem remaining in string matching. >

MFCS Conference 1992 Invited Paper

Parallel Recognition and Ranking of Context-Free Languages

  • Klaus-Jörn Lange
  • Peter Rossmanith
  • Wojciech Rytter

Abstract We survey the efficiency of the ‘fast’ parallel algorithms for the recognition and ranking of context-free languages on the Parallel Random Access Machine without write conflicts. The efficiency of the algorithm is the total number of operations (the product of time and number of processors). Such efficiency depends heavily on the class of context-free grammars and on the meaning of ‘fast’: log(n), log 2 n or sublinear time. The slower is the algorithm the better is its total efficiency. Several new results are presented in the paper. A new simpler version of the log(n) time parallel recognition of unambiguous cfl's is presented. The parallel complexity of ranking and max-word problems for several classes of cfl's is related to the complexity of certain (⊕, ⊗)-transitive closure problems, where (⊕, ⊗)=(+, * ) for the ranking problem of unambiguous languages and (⊕, ⊗)=(max, concat) for the max-word problem. This simplifies the ranking and max-word algorithms and reduces the number of processors.

MFCS Conference 1991 Conference Paper

Efficient Constructions of Test Sets for Regular and Context-Free Languages

  • Juhani Karhumäki
  • Wojciech Rytter
  • Stefan Jarominek

Abstract We present a simple construction of linear size test sets for regular languages and of single exponential test sets for context free languages. In the case of regular sets the size of our test set is exactly the number of transitions of the automaton. This improves the best known upper bounds: exponential for regular and doubly exponential for context-free languages. We give also an O(n log n) time algorithm for the morphism equivalence and an O(n 3 log n) time algorithm to test the gsm equivalence on a regular language. An O(n 2 log n) time algorithm is given to test the equivalence of two deterministic gsm's as well as that of two deterministic finite transducers.

TCS Journal 1991 Journal Article

On optimal parallel computations for sequences of brackets

  • Krzysztof Diks
  • Wojciech Rytter

We present an optimal parallel algorithm (log2 n time, n/log2 n processors) for computing the matching function for a sequence of brackets and for transforming sequences of brackets to trees on the parallel access machine without read and write conflicts (EREW PRAM). It gives also an optimal parallel transformation on EREW PRAM of texts of expressions to expression-trees. Previously an optimal parallel algorithm for this problem was known (Bar-On, Vishkin (1985)) on a stronger model of parallel computations (CREW PRAM), where read conflicts were essential. It is not clear presently how big the difference is between the power of CREW and EREW PRAMs. Our result implies optimal parallel algorithms on EREW PRAM for several other algorithmic problems which previously had optimal parallel algorithms only on a CREW PRAM: expression evaluation (Abrahamson (1987); Brent (1974); Gibbons, Rytter (1986); Miller, Reif (1985)); recognition of input-driven languages (Gibbons, Rytter (1988)); transforming regular expressions to finite automata (Rytter 1987)) and parsing bracket languages (Rytter, Giancarlo (1987)). If the tree of the expression is given then the expression can be optimally evaluated on the EREW PRAM, see Cole, Vishkin (1988); Kosaraju, Delcher (1988). However optimal parallel transformation of expression to corresponding trees was previously known only on the CREW PRAM. The structure of our algorithm for computing the matching function is similar to that of Bar-On and Vishkin (1985). The matching function is computed in the preprocessing phase for a subset of On/log2 n) brackets and later it guides the computation for all brackets. Our initial subset of brackets is a subset of that used in Bar-On, Vishkin (1985). It is small enough to eliminate read conflicts in the preprocessing phase, however it complicates other phases.

TCS Journal 1991 Journal Article

On the parallel recognition of unambiguous context-free languages

  • Michal Chytil
  • Maxime Crochemore
  • Burkhard Monien
  • Wojciech Rytter

We present a simple parallel algorithm recognizing unambiguous context-free languages on a CREW PRAM in time log2 n with only n 3 processors. This gives the smallest number of processors known for the recognition of unambiguous context-free languages in polylogarithmic time. Using the same framework a new algorithm is also given for the recognition of deterministic context-free languages in log2 n time with quadratic number of processors.

TCS Journal 1991 Journal Article

Usefulness of the Karp-Miller-Rosenberg algorithm in parallel computations on strings and arrays

  • Maxime Crochemore
  • Wojciech Rytter

The Karp-Miller-Rosenberg (1972) algorithm was one of the first efficient (almost linear) sequential algorithms for finding repeated patterns and for string matching. In the area of efficient sequential computations on strings it was soon superseded by more efficient (and more sophisticated) algorithms. We show that the Karp-Miller-Rosenberg algorithm (KMR) must be considered as a basic technique in parallel computations. For many problems, variations of KMR give the (known) most efficient parallel algorithms. The representation of the set of basic factors (subarrays) of a string (array) produced by the algorithm is an extremely useful data structure in parallel algorithms on strings and arrays. This gives also a general unifying framework for a large variety of problems. We show that the following problems for strings and arrays can be solved by almost optimal parallel algorithms: pattern-matching, longest repeated factor (subarray), longest common factor (subarray), maximal symmetric factor (subarray). Also the following problems for strings can be solved within the same complexity bounds: finding squares, testing even palstars and compositions of k palindromes for k=2, 3, 4, computing Lyndon factorization and building minimal pattern-matching automata. In the model without concurrent writes the parallel time is O(log(n)2) (with n processors) and in the model with concurrent writes the time, for most of the problems, is O(log(n)) (with n processors). For two problems related to the one-dimensional case (longest repeated factor and longest common factor) there were designed parallel algorithms using suffix trees (Apostolico et al. 1988). However, our data structure is simpler and, furthermore, for the two-dimensional case suffix trees do not work. The complexity of our algorithms does not depend on the size of the alphabet, except for the computation of pattern-matching automata.

TCS Journal 1990 Journal Article

Optimally edge-colouring outerplanar graphs is in NC

  • Alan Gibbons
  • Wojciech Rytter

We prove that every outerplanar graph can be optimally edge-coloured in polylogarithmic time using a polynomial number of processors on a parallel random access machine without write conflicts (P-RAM).

MFCS Conference 1990 Conference Paper

Parallel Construction of Minimal Suffix and Factor Automata

  • Maxime Crochemore
  • Wojciech Rytter

Abstract The main result of the paper is an efficient parallel construction of factor automata. We show that the construction of directed acyclic word graphs (dawg's) and of minimal suffix and minimal factor automata can be done by almost optimal parallel algorithms (optimal within logarithmic factor). Our constructions have the same parallel complexity as the best known parallel algorithms computing suffix trees. We exploit a simple relation between dawg's and suffix trees.

I&C Journal 1989 Journal Article

Optimal parallel algorithms for dynamic expression evaluation and context-free recognition

  • Alan Gibbons
  • Wojciech Rytter

We describe a deterministic parallel algorithm to evaluate algebraic expressions in O(log n) time using n log(n) processors on a parallel random access machine without write conflicts (P-RAM) and with no free preprocessing. The input to the algorithm is a string (of the symbols making up the expression) store in an array. Such a form for the input enables a consecutive numbering of the operands in the expression in O(log(n)) time with n log(n) processors. This corresponds to a consecutive numbering of the leaves of the expression tree. This then further permits us to partition the leaves into small segments. We improve the result of Miller and Reif (1985, in “26th IEEE Sympos. on Found. of Comput. Sci. ,” pp. 478–489), who described an optimal parallel randomized algorithm. (Strictly speaking, the input to their algorithm is different being the parse tree of the expression. The input to the innovative part of our algorithm (step 2) is this parse tree which, in addition, has its leaves numbered consecutively from left to right. These two orms are equivalent if we note that such a numbering can be obtained by an optimal parallel algorithm which employs the Euler tour technique and optimal list ranking). Our algorithm can be used to construct optimal parallel algorithms for the recognition of two nontrival subclasses of context-free languages: bracket and input-driven languages. These languages are the most complicated context-free languages known to be recognizable in deterministic logarithmic space. This strengthens the result of Matheyses and Fiduccia (1982 in “20th Allerton Conf. on Commun. Control and Comput. ”) who constructed an almost optimal parallel algorithm for Dyck languages, since Dyck languages are a proper subclass of input-driven languages. Our algorithm includes a new simple method for tree contraction which we call the leaves-cutting method. Its correctness is trival (compared with the method of Miller and Reif) and it can be implemented on a P-RAM without write and without read conflicts.

MFCS Conference 1989 Conference Paper

Optimal Parallel Algorithms For The Recognition And Colouring Outerplanar Graphs (Extended Abstract)

  • Krzysztof Diks
  • Torben Hagerup
  • Wojciech Rytter

Abstract We show how to test outerplanarity in time T( n )=O(log n log n ) using n /T( n ) processors of CREW PRAM. It is the first optimal parallel algorithm recognizing a nontrivial class of graphs and it is the main result of the paper. If the graph is outerplanar and biconnected then a Hamiltonian cycle is produced. Using this cycle and optimal parsing algorithm for bracket expressions the construction of the tree of faces as well as vertex colourings (with the smallest number of colours) are also done by optimal parallel algorithms.

MFCS Conference 1989 Conference Paper

Parallel Complexity of Lexicographically First Order Problems for Tree-Structured Graphs (Extended Abstract)

  • Bogdan S. Chlebus
  • Krzysztof Diks
  • Wojciech Rytter
  • Tomasz Szymacha

Abstract We study several P-complete graph problems and show that they are in NC if the input graphs are restricted to be tree-structured. These graphs are also known as partial k-trees, decomposable graphs or graphs of bounded tree width, and include outerplanar graphs, series-parallel graphs and Halin graphs. The particular problems investigated herein include the lexicographically first (l. f.) depth-first search tree and the l. f. maximal independent set. It is also shown that if a tree of faces of an outerplanar graph is given, then its dfs tree can be found in O(log 2 n) time using O(n/log 2 n) processors.

TCS Journal 1988 Journal Article

On efficient parallel computations for some dynamic programming problems

  • Wojciech Rytter

A general method for parallelization of some dynamic programming algorithms on VLSI was presented in [6]. We present a general method for parallelization for the same class of problems on more powerful parallel computers. The method is demonstrated on three typical dynamic programming problems: computing the optimal order of matrix multiplications, the optimal binary search tree and optimal triangulation of polygons (see[1, 2]). For these problems the dynamic programming approach gives algorithms having a similar structure. They can be viewed as straight-line programs of size O(n 3). The general method of parallelization of such programs described by Valiant et al. [16] then leads directly to algorithms working in log2 n time with O(n 9) processors. However we adopt an alternative approach and show that a special feature of dynamic programming problems can be used. They can be thought as generalized parsing problems: find a tree of the optimal decomposition of the problem into smaller subproblems. A parallel pebble game on trees [10, 11] is used to decrease the number of processors and to simplify the structure of the algorithms. We show that the dynamic programming problems considered can be computed in log2 n time using n6 log n processors on a parallel random-access machine without write conflicts (CREW P-RAM). The main operation is essentially matrix multiplication, which is easily implementable on parallel computers with a fixed interconnection network of processors (ultracomputers, in the sense of [15]). Hence the problems considered can also be computed in log2 n time using n 6 processors on a perfect shuffle computer (PSC) or a cube- connected computer (CCC). An extension of the algorithm from [14] for the recognition of context-free languages on PSC and CCC can be used. If the parallel random access machine with concurrent writes (CRCW P-RAM) is used, then the minimum of mnumbers can be determined in constant time (see [8]) and consequently the parallel time for the computation of dynamic programming problems can be reduced from log2 n to log n. We investigate also the parallel computation of trees realizing the optimal cost of dynamic programming problems.

TCS Journal 1987 Journal Article

Optimal parallel parsing of bracket languages

  • Wojciech Rytter
  • Raffaele Giancarlo

We prove that the parsing problem for bracket context-free languages can be solved in log n time using n/log n processors on a parallel random access machine without write conflicts (P-RAM). On the way we develop a new general technique for tree compression based on the bracket structure of the tree.

I&C Journal 1987 Journal Article

Parallel time O(log n) recognition of unambiguous context-free languages

  • Wojciech Rytter

We prove that every unambiguous context-free language can be recognized in O(log n) time on a parallel random access machine without write conflicts (P-RAM) using a polynomial number of processors. This strengthens the result of Reif (1982, in “Proceedings, 23rd IEEE Symp. Found. Comput. ,” pp. 114–118), who proved that every deterministic context-free language can be recognized on a P-RAM in O(log n) time.

TCS Journal 1986 Journal Article

On the complexity of parallel parsing of general context-free languages

  • Wojciech Rytter

Let T(n) be the time to recognize context-free languages on a parallel random-access machine without write conflicts (P-RAM) using a polynomial number of processors. We assume that T(n) = Ω(log n). Let P(n) be the time to compute a representation of a parsing tree for strings of length n using a polynomial number of processors. Then we prove P(n) = O(T(n)). A related result is a parallel time log n computation of the transitive closure of directed graphs having special structure.

TCS Journal 1986 Journal Article

On the decidability of some problems about rational subsets of free partially commutative monoids

  • Alan Gibbons
  • Wojciech Rytter

Let I = A ∪ B be a partially commutative alphabet such that two letters commute iff one of them belongs to A and the other one belongs to B. Let M = A∗ × B∗ denote the free partially commutative monoid generated by I. We consider the following six problems for rational (given by regular expressions) subsets, X, Y of M: (Q1): X∪Y=0? (Q2): X⊆Y? (Q3): X=Y? (Q4): X=M? (Q5): M−X finite? (Q6): X is recognized? It is known (see (Berstel, 1979)) that all these problems are undecidable if Card A > 1 and Card B > 1, and they are decidable if Card A = Card B = 1 (Card U denotes the cardinality of U). It was conjectured (see (Choffrut, 1986, p. 79)) that these problems are decidable in the remaining cases, where Card A = 1 and Card B > 1. In this paper we show that if Card A = 1 and Card B > 1, then the problem (Q1) is decidable, and problems (Q2)–(Q6) are undecidable. Our paper is an application of results concerning reversal-bounded, nondeterministic, multicounter machines and nondeterministic, general sequential machines.

MFCS Conference 1986 Conference Paper

Unique Deciperability for Partially Commutative Alphabet (Extended Abstract)

  • Marek Chrobak
  • Wojciech Rytter

Abstract We consider the unique decipherability problem for partially commutative alphabet. It is shown that the complexity of this problem depends heavily on the size of the alphabet and the structure of the commutativity relation graph. In particular, for alphabets with ≤3 letters the problem is decidable and for alphabets with ≥4 letters the problem is undecidable.

MFCS Conference 1984 Conference Paper

Fast Recognition of Pushdown Automaton and Context-Free Languages

  • Wojciech Rytter

Abstract We prove: 1) every language accepted by two-way nondeterministic pushdown automaton can be recognized on RAM in O(n 3 /log n) time; 2) every language accepted by two-way loop-free pushdown automaton can be recognized in O(n 3 /log 2 n) time; 3) every context-free language can be recognized on-line in O(n 3 /log 2 n) time. We improve the results of [1, 7, 4].

v2026.09.13