String Rearrangement Inequalities and a Total Order Between Primitive Words
Ruixi Luo, Taikun Zhu, Kai Jin

TL;DR
This paper introduces an efficient $O(L)$ time algorithm for rearranging words to achieve lexicographically smallest or largest concatenations by leveraging the ordering of their infinite repeating strings, and establishes a total order among primitive words.
Contribution
It reduces the rearrangement problem to sorting based on repeating strings and provides an optimal algorithm, also extending the total order to primitive words.
Findings
Rearrangement reduces to sorting by repeating strings.
An $O(L)$ time sorting algorithm is designed.
A total order on primitive words is established.
Abstract
We study the following rearrangement problem: Given words, rearrange and concatenate them so that the obtained string is lexicographically smallest (or largest, respectively). We show that this problem reduces to sorting the given words so that their repeating strings are non-decreasing (or non-increasing, respectively), where the repeating string of a word refers to the infinite string . Moreover, for fixed size alphabet , we design an time sorting algorithm of the words (in the mentioned orders), where denotes the total length of the input words. Hence we obtain an time algorithm for the rearrangement problem. Finally, we point out that comparing primitive words via comparing their repeating strings leads to a total order, which can further be extended to a total order on the finite words (or all words).
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsAlgorithms and Data Compression · semigroups and automata theory · DNA and Biological Computing
