Back to Search Start Over

Sorting a Permutation by Best Short Swaps.

Authors :
Zhang, Shu
Zhu, Daming
Jiang, Haitao
Guo, Jiong
Feng, Haodi
Liu, Xiaowen
Source :
Algorithmica. Jul2021, Vol. 83 Issue 7, p1953-1979. 27p.
Publication Year :
2021

Abstract

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 ⌈ n 2 ⌉ - 2 happy permutations as well as 2 n - 4 lucky permutations of n elements. [ABSTRACT FROM AUTHOR]

Subjects

Subjects :
*ALGORITHMS
*PERMUTATIONS

Details

Language :
English
ISSN :
01784617
Volume :
83
Issue :
7
Database :
Academic Search Index
Journal :
Algorithmica
Publication Type :
Academic Journal
Accession number :
151026190
Full Text :
https://doi.org/10.1007/s00453-021-00814-x