Source author record

Panagiotis Charalampopoulos

Explore this author’s publications, collaborators and research topics. This catalog record has not been claimed by its author.

ResearcherUnclaimed source record

Catalog footprint

Research overview

7works
2topics
4close collaborators

Published work

7 publications

preprint2022arXiv

Faster Pattern Matching under Edit Distance

We consider the approximate pattern matching problem under the edit distance. Given a text TT of length nn, a pattern PP of length mm, and a threshold kk, the task is to find the starting positions of all substrings of TT that can be transformed to PP with at most kk edits. More than 20 years ago, Cole and Hariharan [SODA'98, J. Comput.'02] gave an O(n+k4⋅n/m)\mathcal{O}(n+k^4 \cdot n/ m)-time algorithm for this classic problem, and this runtime has not been improved since. Here, we present an algorithm that runs in time O(n+k3.5log⁡mlog⁡k⋅n/m)\mathcal{O}(n+k^{3.5} \sqrt{\log m \log k} \cdot n/m), thus breaking through this long-standing barrier. In the case where n1/4+ε≤k≤n2/5−εn^{1/4+\varepsilon} \leq k \leq n^{2/5-\varepsilon} for some arbitrarily small positive constant ε\varepsilon, our algorithm improves over the state-of-the-art by polynomial factors: it is polynomially faster than both the algorithm of Cole and Hariharan and the classic O(kn)\mathcal{O}(kn)-time algorithm of Landau and Vishkin [STOC'86, J. Algorithms'89]. We observe that the bottleneck case of the alternative O(n+k4⋅n/m)\mathcal{O}(n+k^4 \cdot n/m)-time algorithm of Charalampopoulos, Kociumaka, and Wellnitz [FOCS'20] is when the text and the pattern are (almost) periodic. Our new algorithm reduces this case to a new dynamic problem (Dynamic Puzzle Matching), which we solve by building on tools developed by Tiskin [SODA'10, Algorithmica'15] for the so-called seaweed monoid of permutation matrices. Our algorithm relies only on a small set of primitive operations on strings and thus also applies to the fully-compressed setting (where text and pattern are given as straight-line programs) and to the dynamic setting (where we maintain a collection of strings under creation, splitting, and concatenation), improving over the state of the art.

preprint2021arXiv

An Almost Optimal Edit Distance Oracle

We consider the problem of preprocessing two strings SS and TT, of lengths mm and nn, respectively, in order to be able to efficiently answer the following queries: Given positions i,ji,j in SS and positions a,ba,b in TT, return the optimal alignment of S[i. .j]S[i \mathinner{.\,.} j] and T[a. .b]T[a \mathinner{.\,.} b]. Let N=mnN=mn. We present an oracle with preprocessing time N1+o(1)N^{1+o(1)} and space N1+o(1)N^{1+o(1)} that answers queries in log⁡2+o(1)N\log^{2+o(1)}N time. In other words, we show that we can query the alignment of every two substrings in almost the same time it takes to compute just the alignment of SS and TT. Our oracle uses ideas from our distance oracle for planar graphs [STOC 2019] and exploits the special structure of the alignment graph. Conditioned on popular hardness conjectures, this result is optimal up to subpolynomial factors. Our results apply to both edit distance and longest common subsequence (LCS). The best previously known oracle with construction time and size O(N)\mathcal{O}(N) has slow Ω(N)Ω(\sqrt{N}) query time [Sakai, TCS 2019], and the one with size N1+o(1)N^{1+o(1)} and query time log⁡2+o(1)N\log^{2+o(1)}N (using a planar graph distance oracle) has slow Ω(N3/2)Ω(N^{3/2}) construction time [Long & Pettie, SODA 2021]. We improve both approaches by roughly a N\sqrt N factor.

preprint2021arXiv

Fault-Tolerant Distance Labeling for Planar Graphs

In fault-tolerant distance labeling we wish to assign short labels to the vertices of a graph GG such that from the labels of any three vertices u,v,fu,v,f we can infer the uu-to-vv distance in the graph G∖{f}G\setminus \{f\}. We show that any directed weighted planar graph (and in fact any graph in a graph family with O(n)O(\sqrt{n})-size separators, such as minor-free graphs) admits fault-tolerant distance labels of size O(n2/3)O(n^{2/3}). We extend these labels in a way that allows us to also count the number of shortest paths, and provide additional upper and lower bounds for labels and oracles for counting shortest paths.

preprint2020arXiv

Circular Pattern Matching with kk Mismatches

The kk-mismatch problem consists in computing the Hamming distance between a pattern PP of length mm and every length-mm substring of a text TT of length nn, if this distance is no more than kk. In many real-world applications, any cyclic rotation of PP is a relevant pattern, and thus one is interested in computing the minimal distance of every length-mm substring of TT and any cyclic rotation of PP. This is the circular pattern matching with kk mismatches (kk-CPM) problem. A multitude of papers have been devoted to solving this problem but, to the best of our knowledge, only average-case upper bounds are known. In this paper, we present the first non-trivial worst-case upper bounds for the kk-CPM problem. Specifically, we show an O(nk)O(nk)-time algorithm and an O(n+nm k4)O(n+\frac{n}{m}\,k^4)-time algorithm. The latter algorithm applies in an extended way a technique that was very recently developed for the kk-mismatch problem [Bringmann et al., SODA 2019]. A preliminary version of this work appeared at FCT 2019. In this version we improve the time complexity of the main algorithm from O(n+nm k5)O(n+\frac{n}{m}\,k^5) to O(n+nm k4)O(n+\frac{n}{m}\,k^4).

preprint2020arXiv

Counting Distinct Patterns in Internal Dictionary Matching

We consider the problem of preprocessing a text TT of length nn and a dictionary D\mathcal{D} in order to be able to efficiently answer queries CountDistinct(i,j)CountDistinct(i,j), that is, given ii and jj return the number of patterns from D\mathcal{D} that occur in the fragment T[i. .j]T[i \mathinner{.\,.} j]. The dictionary is internal in the sense that each pattern in D\mathcal{D} is given as a fragment of TT. This way, the dictionary takes space proportional to the number of patterns d=∣D∣d=|\mathcal{D}| rather than their total length, which could be Θ(n⋅d)Θ(n\cdot d). An O~(n+d)\tilde{\mathcal{O}}(n+d)-size data structure that answers CountDistinct(i,j)CountDistinct(i,j) queries O(log⁡n)\mathcal{O}(\log n)-approximately in O~(1)\tilde{\mathcal{O}}(1) time was recently proposed in a work that introduced internal dictionary matching [ISAAC 2019]. Here we present an O~(n+d)\tilde{\mathcal{O}}(n+d)-size data structure that answers CountDistinct(i,j)CountDistinct(i,j) queries 22-approximately in O~(1)\tilde{\mathcal{O}}(1) time. Using range queries, for any mm, we give an O~(min⁡(nd/m,n2/m2)+d)\tilde{\mathcal{O}}(\min(nd/m,n^2/m^2)+d)-size data structure that answers CountDistinct(i,j)CountDistinct(i,j) queries exactly in O~(m)\tilde{\mathcal{O}}(m) time. We also consider the special case when the dictionary consists of all square factors of the string. We design an O(nlog⁡2n)\mathcal{O}(n \log^2 n)-size data structure that allows us to count distinct squares in a text fragment T[i. .j]T[i \mathinner{.\,.} j] in O(log⁡n)\mathcal{O}(\log n) time.

preprint2020arXiv

The Number of Repetitions in 2D-Strings

The notions of periodicity and repetitions in strings, and hence these of runs and squares, naturally extend to two-dimensional strings. We consider two types of repetitions in 2D-strings: 2D-runs and quartics (quartics are a 2D-version of squares in standard strings). Amir et al. introduced 2D-runs, showed that there are O(n3)O(n^3) of them in an n×nn \times n 2D-string and presented a simple construction giving a lower bound of Ω(n2)Ω(n^2) for their number (TCS 2020). We make a significant step towards closing the gap between these bounds by showing that the number of 2D-runs in an n×nn \times n 2D-string is O(n2log⁡2n)O(n^2 \log^2 n). In particular, our bound implies that the O(n2log⁡n+output)O(n^2\log n + \textsf{output}) run-time of the algorithm of Amir et al. for computing 2D-runs is also O(n2log⁡2n)O(n^2 \log^2 n). We expect this result to allow for exploiting 2D-runs algorithmically in the area of 2D pattern matching. A quartic is a 2D-string composed of 2×22 \times 2 identical blocks (2D-strings) that was introduced by Apostolico and Brimkov (TCS 2000), where by quartics they meant only primitively rooted quartics, i.e. built of a primitive block. Here our notion of quartics is more general and analogous to that of squares in 1D-strings. Apostolico and Brimkov showed that there are O(n2log⁡2n)O(n^2 \log^2 n) occurrences of primitively rooted quartics in an n×nn \times n 2D-string and that this bound is attainable. Consequently the number of distinct primitively rooted quartics is O(n2log⁡2n)O(n^2 \log^2 n). Here, we prove that the number of distinct general quartics is also O(n2log⁡2n)O(n^2 \log^2 n). This extends the rich combinatorial study of the number of distinct squares in a 1D-string, that was initiated by Fraenkel and Simpson (J. Comb. Theory A 1998), to two dimensions. Finally, we show some algorithmic applications of 2D-runs. (Abstract shortened due to arXiv requirements.)

preprint2016arXiv

Optimal Computation of Avoided Words

The deviation of the observed frequency of a word ww from its expected frequency in a given sequence xx is used to determine whether or not the word is avoided. This concept is particularly useful in DNA linguistic analysis. The value of the standard deviation of ww, denoted by std(w)std(w), effectively characterises the extent of a word by its edge contrast in the context in which it occurs. A word ww of length k>2k>2 is a ρρ-avoided word in xx if std(w)≤ρstd(w) \leq ρ, for a given threshold ρ<0ρ< 0. Notice that such a word may be completely absent from xx. Hence computing all such words na\"ıvely can be a very time-consuming procedure, in particular for large kk. In this article, we propose an O(n)O(n)-time and O(n)O(n)-space algorithm to compute all ρρ-avoided words of length kk in a given sequence xx of length nn over a fixed-sized alphabet. We also present a time-optimal O(σn)O(σn)-time and O(σn)O(σn)-space algorithm to compute all ρρ-avoided words (of any length) in a sequence of length nn over an alphabet of size σσ. Furthermore, we provide a tight asymptotic upper bound for the number of ρρ-avoided words and the expected length of the longest one. We make available an open-source implementation of our algorithm. Experimental results, using both real and synthetic data, show the efficiency of our implementation.

Research graph

See the researcher in context

Open full explorer

Inspect adjacent papers, topics, institutions and collaborators without losing the researcher page.

Building this map preview

BZPEER is loading the nearby papers, people, topics and institutions for this page.