On recognising words that are squares for the shuffle product

The shuffle of two words u and v of A⁎ is the language u⧢v consisting of all words u1v1u2v2…ukvk, where k≥0 and the ui and vi are words of A⁎ such that u=u1u2…uk and v=v1v2…vk. In other words, u⧢v is the finite set of all words obtainable from merging the words u and v from left to right, but choosing the next symbol arbitrarily from u or v. A word u∈A⁎ is a square for the shuffle product if it is the shuffle of two identical words (i.e., u∈v⧢v for some v∈A⁎). Whereas it can be decided in polynomial-time whether or not u∈v1⧢v2 for given words u, v1 and v2 (J.-C. Spehner, 1986 [19]), we show in this paper that it is NP-complete to determine whether or not a word u is a square for the shuffle product. The novelty in our approach lies in representing words as linear graphs, in which deciding whether or not a given word is a square for the shuffle product reduces to computing some inclusion-free perfect matching. Finally, we prove that it is NP-complete to determine whether or not an input word is in the shuffle of a word with its reverse.

[1]  Anthony Mansfield,et al.  On the computational complexity of a merge recognition problem , 1983, Discret. Appl. Math..

[2]  Hao Yuan,et al.  Improved algorithms for largest cardinality 2-interval pattern problem , 2007, J. Comb. Optim..

[3]  Gerhard J. Woeginger,et al.  Precedence-constrained scheduling problems parameterized by partial order width , 2016, DOOR.

[4]  Christian Choffrut,et al.  Combinatorics of Words , 1997, Handbook of Formal Languages.

[5]  J C Spehner Rapid calculation of shuffles of two words , 1986 .

[6]  John D. Kececioglu,et al.  Reconstructing a history of recombinations from a set of sequences , 1994, SODA '94.

[7]  Minghui Jiang A PTAS for the Weighted 2-Interval Pattern Problem over the Preceding-and-Crossing Model , 2007, COCOA.

[8]  D. Henshall,et al.  Shuffling and Unshuffling , 2011, Bull. EATCS.

[9]  David Maier,et al.  The Complexity of Some Problems on Subsequences and Supersequences , 1978, JACM.

[10]  Shuai Cheng Li,et al.  On two open problems of 2-interval patterns , 2009, Theor. Comput. Sci..

[11]  Kazuo Iwama Unique decomposability of shuffled strings: A formal treatment of asynchronous time-multiplexed communication , 1983, STOC '83.

[12]  David Haussler,et al.  On the Complexity of Iterated Shuffle , 1984, J. Comput. Syst. Sci..

[13]  Stéphane Vialette,et al.  On the computational complexity of 2-interval pattern matching problems , 2004, Theor. Comput. Sci..

[14]  Samuel R. Buss,et al.  Unshuffling a square is NP-hard , 2014, J. Comput. Syst. Sci..

[15]  Maria Axenovich,et al.  A regularity lemma and twins in words , 2012, J. Comb. Theory A.

[16]  M. Lothaire,et al.  Applied Combinatorics on Words , 2005 .

[17]  Romeo Rizzi,et al.  On Recognizing Words That Are Squares for the Shuffle Product , 2013, CSR.

[18]  Jan van Leeuwen,et al.  Efficient Recognition of Rational Relations , 1982, Inf. Process. Lett..

[19]  Takayuki Kimura An algebraic system for process structuring and interprocess communication , 1976, STOC '76.

[20]  Stéphane Vialette Two-Interval Pattern Problems , 2008, Encyclopedia of Algorithms.