Combinatorial Algorithms for Multidimensional Necklaces

A necklace is an equivalence class of words of length n over an alphabet under the cyclic shift (rotation) operation. As a classical object, there have been many algorithmic results for key operations on necklaces, including counting, generating, ranking, and unranking. This paper generalises the concept of necklaces to the multidimensional setting. We define multidimensional necklaces as an equivalence classes over multidimensional words under the multidimensional cyclic shift operation. Alongside this definition, we generalise several problems from the one dimensional setting to the multidimensional setting for multidimensional necklaces with size (n1, n2, . . . , nd) over an alphabet of size q including: providing closed form equations for counting the number of necklaces; an O(n1 · n2 · . . . · nd) time algorithm for transforming some necklace w̃ to the next necklace in the ordering; an O((n1 ·n2 · . . . ·nd)) time algorithm to rank necklaces (determine the number of necklaces smaller than w̃ in the set of necklaces); an O((n1 · n2 · . . . · nd) · log(q)) time algorithm to unrank multidimensional necklace (determine the i necklace in the set of necklaces). Our results on counting, ranking, and unranking are further extended to the fixed content setting, where every necklace has the same Parikh vector, in other words every necklace shares the same number of occurrences of each symbol. Finally, we study the k-centre problem for necklaces both in the single and multidimensional settings. We provide strong approximation algorithms for solving this problem in both the one dimensional and multidimensional settings. ∗Department of Computer Science, Reykjavik University, Iceland. Email: duncana@ru.is †Royal Holloway University of London, UK. Email: argyrios.deligkas@rhul.ac.uk ‡Materials Innovation Factory, Department of Chemistry, University of Liverpool, UK. Email: Vladimir.Gusev@liverpool.ac.uk §Department of Computer Science, University of Liverpool, UK. Email: potapov@liverpool.ac.uk 1 ar X iv :2 10 8. 01 99 0v 2 [ m at h. C O ] 5 N ov 2 02 1

[1]  Teofilo F. GONZALEZ,et al.  Clustering to Minimize the Maximum Intercluster Distance , 1985, Theor. Comput. Sci..

[2]  Moshe Schwartz,et al.  The structure of single-track Gray codes , 1999, IEEE Trans. Inf. Theory.

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

[4]  Wojciech Rytter,et al.  Computing k-th Lyndon Word and Decoding Lexicographically Minimal de Bruijn Sequence , 2014, CPM.

[5]  Frank Ruskey,et al.  Generating Necklaces and Strings with Forbidden Substrings , 2000, COCOON.

[6]  Frank Ruskey,et al.  Ranking and unranking permutations in linear time , 2001, Inf. Process. Lett..

[7]  Joe Sawada,et al.  Generating bracelets with fixed content , 2013, Theor. Comput. Sci..

[8]  P. Mandal,et al.  Accelerated discovery of two crystal structure types in a complex inorganic phase field , 2017, Nature.

[9]  A. Litman,et al.  On covering problems of codes , 1997, Theory of Computing Systems.

[10]  Joe Sawada,et al.  Practical algorithms to rank necklaces, Lyndon words, and de Bruijn sequences , 2017, J. Discrete Algorithms.

[11]  Joonho Lee,et al.  Time-crystalline eigenstate order on a quantum processor , 2021, Nature.

[12]  Glenn H. Hurlbert,et al.  New constructions for De Bruijn tori , 1995, Des. Codes Cryptogr..

[13]  Martin Mares,et al.  Linear-Time Ranking of Permutations , 2007, ESA.

[14]  Frank Ruskey,et al.  Generating Necklaces , 1992, J. Algorithms.

[15]  George L. Nemhauser,et al.  Easy and hard bottleneck location problems , 1979, Discret. Appl. Math..

[16]  Takuro Fukunaga,et al.  Unranking of small combinations from large sets , 2014, J. Discrete Algorithms.

[17]  Dániel Marx,et al.  The Parameterized Hardness of the k-Center Problem in Transportation Networks , 2018, Algorithmica.

[18]  Bin Ma,et al.  On the closest string and substring problems , 2002, JACM.

[19]  Fred S. Annexstein Generating De Bruijn Sequences: An Efficient Implementation , 1997, IEEE Trans. Computers.

[20]  Rolf Niedermeier,et al.  Fixed-Parameter Algorithms for CLOSEST STRING and Related Problems , 2003, Algorithmica.

[21]  Joe Sawada,et al.  Ranking and unranking fixed-density necklaces and Lyndon words , 2019, Theor. Comput. Sci..

[22]  Fan Chung Graham,et al.  Universal cycles for combinatorial structures , 1992, Discret. Math..

[23]  J. Plesník On the computational complexity of centers locating in a graph , 1980 .

[24]  Ming Li,et al.  On the k-Closest Substring and k-Consensus Pattern Problems , 2004, CPM.

[25]  E. Gilbert,et al.  Symmetry types of periodic sequences , 1961 .

[26]  Chak-Kuen Wong,et al.  Ranking and Unranking of B-Trees , 1983, J. Algorithms.

[27]  Bin Ma,et al.  Distinguishing string selection problems , 2003, SODA '99.

[28]  Gwénaël Richomme,et al.  Periodicity in rectangular arrays , 2016, Inf. Process. Lett..

[29]  Arto Salomaa,et al.  A sharpening of the Parikh mapping , 2001, RAIRO Theor. Informatics Appl..

[30]  Marcin Sydow,et al.  Comparison of String Distance Metrics for Lemmatisation of Named Entities in Polish , 2007, LTC.

[31]  Frank Ruskey,et al.  De Bruijn Sequences for Fixed-Weight Binary Strings , 2012, SIAM J. Discret. Math..

[32]  David B. Shmoys,et al.  A unified approach to approximation algorithms for bottleneck problems , 1986, JACM.

[33]  Ronald L. Graham,et al.  Concrete mathematics - a foundation for computer science , 1991 .

[34]  Marcella Anselmo,et al.  Toroidal Codes and Conjugate Pictures , 2019, LATA.

[35]  Brett Stevens,et al.  Locating patterns in the de Bruijn torus , 2016, Discret. Math..

[36]  S. Gill Williamson Ranking Algorithms for Lists of Partitions , 1976, SIAM J. Comput..

[37]  Dorit S. Hochbaum,et al.  Various notions of approximations: good, better, best, and more , 1996 .

[38]  Frank Ruskey,et al.  An efficient algorithm for generating necklaces with fixed density , 1999, SODA '99.

[39]  Samir Guglani,et al.  LINGUISTIC COMPETENCE AND PSYCHOPATHOLOGY : A CROSS-CULTURAL MODEL , 1982, Indian journal of psychiatry.

[40]  Myung M. Bae,et al.  Gray codes for torus and edge disjoint Hamiltonian cycles , 2000, Proceedings 14th International Parallel and Distributed Processing Symposium. IPDPS 2000.

[41]  Kenneth G. Paterson,et al.  On the Existence of de Bruijn Tori with Two by Two Windows , 1996, J. Comb. Theory, Ser. A.

[42]  Frank Ruskey,et al.  Fast Algorithms to Generate Necklaces, Unlabeled Necklaces, and Irreducible Polynomials over GF(2) , 2000, J. Algorithms.

[43]  Max M. Louwerse,et al.  A Comparison of String Similarity Measures for Toponym Matching , 2013, COMP '13.

[44]  Pradeep Ravikumar,et al.  A Comparison of String Distance Metrics for Name-Matching Tasks , 2003, IIWeb.

[45]  Clelia de Felice,et al.  Unavoidable sets and circular splicing languages , 2017, Theor. Comput. Sci..

[46]  Igor Potapov,et al.  Ranking Bracelets in Polynomial Time , 2021, CPM.

[47]  G. Weyer,et al.  On the structure of the necklace Lie algebra , 2008, 0801.1621.

[48]  Tero Harju,et al.  Combinatorics on Words , 2004 .

[49]  Andrzej Lingas,et al.  Efficient approximation algorithms for the Hamming center problem , 1999, SODA '99.

[50]  Jean Marcel Pallo,et al.  Enumerating, Ranking and Unranking Binary Trees , 1986, Comput. J..

[51]  Bin Ma,et al.  More Efficient Algorithms for Closest String and Substring Problems , 2008, SIAM J. Comput..

[52]  Michael E. Saks,et al.  Efficient Indexing of Necklaces and Irreducible Polynomials over Finite Fields , 2014, Theory Comput..

[53]  C Collins,et al.  The Flexible Unit Structure Engine (FUSE) for probe structure-based composition prediction. , 2018, Faraday discussions.

[54]  Harold Fredricksen,et al.  An algorithm for generating necklaces of beads in two colors , 1986, Discret. Math..

[55]  Glenn H. Hurlbert,et al.  On the de Bruijn Torus Problem , 1993, J. Comb. Theory, Ser. A.

[56]  Thomas Gärtner,et al.  A survey of kernels for structured data , 2003, SKDD.