{"title":"String Rearrangement Inequalities and a Total Order Between Primitive Words","authors":"Ruixi Luo, Taikun Zhu, Kai Jin","doi":"10.48550/arXiv.2204.11213","DOIUrl":null,"url":null,"abstract":"We study the following rearrangement problem: Given $n$ 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 $A$ refers to the infinite string $AAA\\ldots$. Moreover, for fixed size alphabet $\\Sigma$, we design an $O(L)$ time sorting algorithm of the words (in the mentioned orders), where $L$ denotes the total length of the input words. Hence we obtain an $O(L)$ 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).","PeriodicalId":101589,"journal":{"name":"Frontiers in Algorithmics","volume":"31 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2022-04-24","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Frontiers in Algorithmics","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.48550/arXiv.2204.11213","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0
Abstract
We study the following rearrangement problem: Given $n$ 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 $A$ refers to the infinite string $AAA\ldots$. Moreover, for fixed size alphabet $\Sigma$, we design an $O(L)$ time sorting algorithm of the words (in the mentioned orders), where $L$ denotes the total length of the input words. Hence we obtain an $O(L)$ 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).
我们研究以下重排问题:给定$n$个单词,重新排列并连接它们,使获得的字符串在字典顺序上分别是最小的(或最大的)。我们证明,这个问题可以简化为对给定的单词进行排序,使它们的重复字符串是非递减的(或分别是非递增的),其中单词的重复字符串$ a $指的是无限字符串$AAA\ldots$。此外,对于固定大小的字母表$\Sigma$,我们设计了$O(L)$时间排序算法(按照上述顺序),其中$L$表示输入单词的总长度。因此,我们得到了一个$O(L)$ time的重排算法。最后,我们指出,通过比较原语单词的重复字符串来比较原语单词会导致一个总顺序,这个顺序可以进一步扩展到有限单词(或所有单词)上的总顺序。