IDEAS home Printed from https://ideas.repec.org/a/spr/jcomop/v37y2019i2d10.1007_s10878-018-0300-z.html
   My bibliography  Save this article

Efficient enumeration of non-equivalent squares in partial words with few holes

Author

Listed:
  • Panagiotis Charalampopoulos

    (King’s College London)

  • Maxime Crochemore

    (King’s College London
    Université Paris-Est)

  • Costas S. Iliopoulos

    (King’s College London)

  • Tomasz Kociumaka

    (University of Warsaw)

  • Solon P. Pissis

    (King’s College London)

  • Jakub Radoszewski

    (University of Warsaw)

  • Wojciech Rytter

    (University of Warsaw)

  • Tomasz Waleń

    (University of Warsaw)

Abstract

A word of the form WW for some word $$W\in \varSigma ^*$$ W ∈ Σ ∗ is called a square. A partial word is a word possibly containing holes (also called don’t cares). The hole is a special symbol $$\lozenge \notin \varSigma $$ ◊ ∉ Σ which matches any symbol from $$\varSigma \cup \{\lozenge \}$$ Σ ∪ { ◊ } . A p-square is a partial word matching at least one square WW without holes. Two p-squares are called equivalent if they match the same set of squares. A p-square is called here unambiguous if it matches exactly one square WW without holes. Such p-squares are natural counterparts of classical squares. Let $$\mathrm {PSQUARES}_k(n)$$ PSQUARES k ( n ) and $$\mathrm {USQUARES}_k(n)$$ USQUARES k ( n ) be the maximum number of non-equivalent p-squares and non-equivalent unambiguous p-squares in T over all partial words T of length n with at most k holes. We show asymptotically tight bounds: $$\begin{aligned} \mathrm {PSQUARES}_k(n) = \varTheta (\min (nk^2,\, n^2)),\ \ \mathrm {USQUARES}_k(n) = \varTheta (nk). \end{aligned}$$ PSQUARES k ( n ) = Θ ( min ( n k 2 , n 2 ) ) , USQUARES k ( n ) = Θ ( n k ) . We present an algorithm that reports all non-equivalent p-squares in $$\mathcal {O}(nk^3)$$ O ( n k 3 ) time for a partial word of length n with k holes, for an integer alphabet. In particular, it runs in linear time for $$k=\mathcal {O}(1)$$ k = O ( 1 ) and its time complexity near-matches the asymptotic bound for $$\mathrm {PSQUARES}_k(n)$$ PSQUARES k ( n ) . We also show an $$\mathcal {O}(n)$$ O ( n ) -time algorithm that reports all non-equivalent p-squares of a given length. The paper is a full and improved version of Charalampopoulos et al. (in Cao Y, Chen Y (eds) Proceedings of the 23rd international conference on computing and combinatorics, COCOON 2017; Springer, 2017).

Suggested Citation

  • Panagiotis Charalampopoulos & Maxime Crochemore & Costas S. Iliopoulos & Tomasz Kociumaka & Solon P. Pissis & Jakub Radoszewski & Wojciech Rytter & Tomasz Waleń, 2019. "Efficient enumeration of non-equivalent squares in partial words with few holes," Journal of Combinatorial Optimization, Springer, vol. 37(2), pages 501-522, February.
  • Handle: RePEc:spr:jcomop:v:37:y:2019:i:2:d:10.1007_s10878-018-0300-z
    DOI: 10.1007/s10878-018-0300-z
    as

    Download full text from publisher

    File URL: http://link.springer.com/10.1007/s10878-018-0300-z
    File Function: Abstract
    Download Restriction: Access to the full text of the articles in this series is restricted.

    File URL: https://libkey.io/10.1007/s10878-018-0300-z?utm_source=ideas
    LibKey link: if access is restricted and if your library uses this service, LibKey will redirect you to where you can use your library subscription to access this item
    ---><---

    As the access to this document is restricted, you may want to search for a different version of it.

    Corrections

    All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:spr:jcomop:v:37:y:2019:i:2:d:10.1007_s10878-018-0300-z. See general information about how to correct material in RePEc.

    If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

    We have no bibliographic references for this item. You can help adding them by using this form .

    If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: Sonal Shukla or Springer Nature Abstracting and Indexing (email available below). General contact details of provider: http://www.springer.com .

    Please note that corrections may take a couple of weeks to filter through the various RePEc services.

    IDEAS is a RePEc service. RePEc uses bibliographic data supplied by the respective publishers.