101 research outputs found

    Fast Algorithm for Partial Covers in Words

    Get PDF
    A factor uu of a word ww is a cover of ww if every position in ww lies within some occurrence of uu in ww. A word ww covered by uu thus generalizes the idea of a repetition, that is, a word composed of exact concatenations of uu. In this article we introduce a new notion of α\alpha-partial cover, which can be viewed as a relaxed variant of cover, that is, a factor covering at least α\alpha positions in ww. We develop a data structure of O(n)O(n) size (where n=wn=|w|) that can be constructed in O(nlogn)O(n\log n) time which we apply to compute all shortest α\alpha-partial covers for a given α\alpha. We also employ it for an O(nlogn)O(n\log n)-time algorithm computing a shortest α\alpha-partial cover for each α=1,2,,n\alpha=1,2,\ldots,n

    The Number of Repetitions in 2D-Strings

    Get PDF
    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)\Omega(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(n2log2n)O(n^2 \log^2 n). In particular, our bound implies that the O(n2logn+output)O(n^2\log n + \textsf{output}) run-time of the algorithm of Amir et al. for computing 2D-runs is also O(n2log2n)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(n2log2n)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(n2log2n)O(n^2 \log^2 n). Here, we prove that the number of distinct general quartics is also O(n2log2n)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.)Comment: To appear in the ESA 2020 proceeding

    Efficient Enumeration of Non-Equivalent Squares in Partial Words with Few Holes

    Get PDF
    International audienceA partial word is a word with holes (also called don't cares: special symbols which match any symbol). A p-square is a partial word matching at least one standard square without holes (called a full square). Two p-squares are called equivalent if they match the same sets of full squares. Denote by psquares(T) the number of non-equivalent p-squares which are subwords of a partial word T. Let PSQUARES k (n) be the maximum value of psquares(T) over all partial words of length n with k holes. We show asympthotically tight bounds: c1 · min(nk 2 , n 2) ≤ PSQUARES k (n) ≤ c2 · min(nk 2 , n 2) for some constants c1, c2 > 0. We also present an algorithm that computes psquares(T) in O(nk 3) time for a partial word T of length n with k holes. In particular, our algorithm runs in linear time for k = O(1) and its time complexity near-matches the maximum number of non-equivalent p-squares

    Repetitive subwords

    Get PDF
    The central notionof thisthesisis repetitionsin words. We studyproblemsrelated to contiguous repetitions. More specifically we will consider repeating scattered subwords of non-primitive words, i.e. words which are complete repetitions of other words. We will present inequalities concerning these occurrences as well as giving apartial solutionto an openproblemposedby Salomaaet al. We will characterize languages, whichare closed under the operation ofduplication, thatis repeating any factor of a word. We alsogive newbounds onthe number of occurrencesof certain types of repetitions of words. We give a solution to an open problem posed by Calbrix and Nivat concerning regular languages consisting of non-primitive words. We alsopresentsomeresultsregarding theduplication closureoflanguages,among which a new proof to a problem of Bovet and Varricchio

    Repetitions in partial words

    Get PDF
    El objeto de esta tesis está representado por las repeticiones de palabras parciales, palabras que, además de las letras regulares, pueden tener un número de símbolos desconocidos,llamados símbolos "agujeros" o "no sé qué". Más concretamente, se presenta y se resuelve una extensión de la noción de repetición establecida por Axel Thue. Investigamos las palabras parciales con un número infinito de agujeros que cumplen estas propiedades y, también las palabras parciales que conservan las propiedades después de la inserción de un número arbitrario de agujeros, posiblemente infinito. Luego, hacemos un recuento del número máximo de 2-repeticiones distintas compatibles con los factores de una palabra parcial. Se demuestra que el problema en el caso general es difícil, y estudiamos el problema en el caso de un agujero. Al final, se estudian algunas propiedades de las palabras parciales sin fronteras y primitivas (palabras sin repeticiones) y se da una caracterización del lenguaje de palabras parciales con una factorización crítica
    corecore