当前位置: X-MOL 学术Algorithmica › 论文详情
Our official English website, www.x-mol.net, welcomes your feedback! (Note: you will need to create a separate account there.)
Sorting a Permutation by Best Short Swaps
Algorithmica ( IF 1.1 ) Pub Date : 2021-03-02 , DOI: 10.1007/s00453-021-00814-x
Shu Zhang , Daming Zhu , Haitao Jiang , Jiong Guo , Haodi Feng , Xiaowen Liu

A permutation is happy, if it can be transformed into the identity permutation using as many short swaps as one third times the number of inversions in the permutation. The complexity of the decision version of sorting a permutation by short swaps, is still open. We present an O(n) time algorithm to decide whether it is true for a permutation to be happy, where n is the number of elements in the permutation. If a permutation is happy, we give an \(O(n^2)\) time algorithm to find a sequence of as many short swaps as one third times the number of its inversions, to transform it into the identity permutation. A permutation is lucky, if it can be transformed into the identity permutation using as many short swaps as one fourth times the length sum of the permutation’s element vectors. We present an O(n) time algorithm to decide whether it is true for a permutation to be lucky, where n is the number of elements in the permutation. If a permutation is lucky, we give an \(O(n^2)\) time algorithm to find a sequence of as many short swaps as one fourth times the length sum of its element vectors to transform it into the identity permutation. This improves upon the \(O(n^2)\) time algorithm proposed by Heath and Vergara to decide whether a permutation is lucky. We show that there are at least \(2^{\lceil \frac{n}{2}\rceil -2}\) happy permutations as well as \(2^{n-4}\) lucky permutations of n elements.



中文翻译:

按最佳掉期排序排列

如果可以使用短置换来将其转换为身份置换,置换次数是该置换中反转次数的三分之一,那么该置换就是幸福的。通过短交换对排列进行排序的决策版本的复杂性仍然存在。我们提出一种On)时间算法来确定排列满足的条件是否正确,其中n是排列中元素的数量。如果排列满意,我们给出一个\(O(n ^ 2)\)时间算法,以找到一个短交换的序列,该序列的数量是其反转次数的三分之一,以将其转换为身份排列。排列很幸运,如果可以使用与置换元素向量长度总和的四分之一一样多的短交换将其转换为身份置换。我们提出一种On)时间算法来确定排列是否幸运是正确的,其中n是排列中元素的数量。如果置换是幸运的,我们给出一个\(O(n ^ 2)\)时间算法,以找到一个短交换的序列,其数量是其元素向量长度总和的四分之一,以将其转换为身份置换。这是对Heath和Vergara提出的\(O(n ^ 2)\)时间算法的改进,该算法确定排列是否很幸运。我们显示至少有\(2 ^ {\ lceil \ frac {n} {2} \ rceil -2} \)n个元素的快乐排列以及\(2 ^ {n-4} \)幸运排列。

更新日期:2021-03-03
down
wechat
bug