On Two-Dimensional Lyndon Words

A Lyndon word is a primitive string which is lexicographically smallest among cyclic permutations of its characters. Lyndon words are used for constructing bases in free algebras, constructing de Bruijn sequences, finding the lexicographically smallest or largest substring in a string, and succinct suffix-prefix matching of highly periodic strings. In this paper, we extend the concept of the Lyndon word to two dimensions. We introduce the 2D Lyndon word and use it to capture 2D horizontal periodicity of a matrix in which each row is highly periodic, and to efficiently solve 2D horizontal suffix-prefix matching among a set of patterns. This yields a succinct and efficient algorithm for 2D dictionary matching. We present several algorithms that compute the 2D Lyndon word that represents a matrix. The final algorithm achieves linear time complexity even when the least common multiple of the periods of the rows is exponential in the matrix width.

[1]  Gary Benson,et al.  An Alphabet Independent Approach to Two-Dimensional Pattern Matching , 1994, SIAM J. Comput..

[2]  Maxime Crochemore,et al.  Fast parallel Lyndon factorization with applications , 1995, Mathematical systems theory.

[3]  Dina Sokol,et al.  Succinct 2D Dictionary Matching , 2012, Algorithmica.

[4]  Marcin Mucha,et al.  Lyndon Words and Short Superstrings , 2012, SODA.

[5]  R. Lyndon On Burnside’s problem , 1954 .

[6]  Donald Ervin Knuth,et al.  The Art of Computer Programming , 1968 .

[7]  Gary Benson,et al.  Two-dimensional periodicity and its applications , 1992, SODA '92.

[8]  Gad M. Landau,et al.  Parallel Suffix-Prefix-Matching Algorithm and Applications , 1996, SIAM J. Comput..

[9]  Eric Rivals,et al.  STAR: an algorithm to Search for Tandem Approximate Repeats , 2004, Bioinform..

[10]  Marc Chemillier Periodic musical sequences and Lyndon words , 2004, Soft Comput..

[11]  Nontrivial lower bounds for the least common multiple of some finite sequences of integers , 2007, 0803.0290.

[12]  Gad M. Landau,et al.  An Efficient Algorithm for the All Pairs Suffix-Prefix Problem , 1992, Inf. Process. Lett..

[13]  Harold Fredricksen,et al.  Necklaces of beads in k colors and k-ary de Bruijn sequences , 1978, Discret. Math..

[14]  M. Lothaire Applied Combinatorics on Words (Encyclopedia of Mathematics and its Applications) , 2005 .

[15]  Gary Benson,et al.  Two-Dimensional Periodicity in Rectangular Arrays , 1998, SIAM J. Comput..

[16]  Enno Ohlebusch,et al.  Efficient algorithms for the all-pairs suffix-prefix problem and the all-pairs substring-prefix problem , 2010, Inf. Process. Lett..