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^{\lceil \frac{n}{2}\rceil -2}\) happy permutations as well as \(2^{n-4}\) lucky permutations of n elements.







Similar content being viewed by others
References
Bafna, V., Pevzner, P.A.: Genome rearrangements and sorting by reversals. SIAM J. Comput. 25(2), 272–289 (1996)
Berman, P., Hannenhalli, S., Karpinski, M.: 1.375-approximation algorithm for sorting by reversals. In: Proceeding of European Symposium on Algorithms, pp. 200–210 (2002)
Bourque, G., Pevzner, P.A.: Genome-scale evolution: reconstructing gene orders in the ancestral species. Genome Res. 12(1), 26–36 (2002)
Caprara, Alberto: Sorting permutations by reversals and eulerian cycle decompositions. SIAM J. Discr. Math. 12(1), 91–110 (1999)
Chin, F.Y.L., Santis, A.D., Ferrara, A.L., Ho, N.L., Kim, S.K.: A simple algorithm for the constrained sequence problems. Inf. Process. Lett. 90(4), 175–179 (2004)
Dobzhansky, T., Sturtevant, A.H.: Inversions in the chromosomes of Drosophila pseudoobscura. Genetics 23, 28–64 (1938)
Feng, X., Meng, Z., Sudborough, I.H.: Improved upper bound for sorting by short swaps. In: Proceeding of International Symposium on Parallel Architectures, Algorithms and Networks, pp. 98–103 (2004)
Feng, X., Sudborough, I.H., Lu, E.: A fast algorithm for sorting by short swap. In: Proceeding of the 10th IASTED International Conference on Computational and Systems Biology, pp. 62–67 (2006)
Galvão, G.R., Dias, Z.: Approximation algorithms for sorting by signed short reversals. In: Proceedings of the 5th ACM Conference on Bioinformatics, Computational Biology, and Health Informatics, pp. 360–369 (2014)
Galvão, G.R., Lee, O., Dias, Z.: Sorting signed permutations by short operations. Algorith. Mol. Biol. 10(1), 1–17 (2015)
Hannenhalli, S., Pevzner, P.A.: Transforming cabbage into turnip: polynomial algorithm for sorting signed permutations by reversals. J. ACM 46(1), 1–27 (1999)
Heath, L.S., Vergara, J.P.C.: Sorting by short block-moves. Algorithmica 28(3), 323–354 (2000)
Heath, L.S., Vergara, J.P.C.: Sorting by short swaps. J. Comput. Biol. 10(5), 775–789 (2003)
Jerrum, M.: The complexity of finding minimum-length generator sequences. Theor. Comput. Sci. 36(2–3), 265–289 (1985)
Jiang, H., Feng, H., Zhu, D.: An 5/4-approximation algorithm for sorting permutations by short block moves. In: Proceedings of International Symposium on Algorithms and Computation, pp. 491–503. Springer (2014)
Jiang, H., Zhu, D.: A 14/11-approximation algorithm for sorting by short block-moves. Science China Inf. Sci. 54(2), 279–292 (2011)
Jiang, H., Zhu, D., Zhu, B.: A (1+ \(\varepsilon\))-approximation algorithm for sorting by short block-moves. Theor. Comput. Sci. 439, 1–8 (2012)
Kaplan, H., Shamir, R., Tarjan, R.E.: A faster and simpler algorithm for sorting signed permutations by reversals. SIAM J. Comput. 29(3), 880–892 (1999)
Kececioglu, J., Sankoff, D.: Exact and approximation algorithms for sorting by reversals, with application to genome rearrangement. Algorithmica 13(1–2), 180–210 (1995)
Palmer, J.D., Herbon, L.A.: Plant mitochondrial DNA evolves rapidly in structure, but slowly in sequence. J. Mol. Evol. 27, 87–97 (1988)
Pevzner, P., Tesler, G.: Genome rearrangements in mammalian evolution: lessons from human and mouse genomes. Genome Res. 13(1), 37–45 (2003)
Pradhan, G.P., Prasad, P.V.: Evaluation of wheat chromosome translocation lines for high temperature stress tolerance at grain filling stage. Plos One 10(2), 1–20 (2015)
Sankoff, D., Leduc, G., Antoine, N., Paquin, B., Lang, B.F., Cedergren, R.: Gene order comparisons for phylogenetic inference: evolution of the mitochondrial genome. Proc. Natl. Acad. Sci. USA 89(14), 6575–6579 (1992)
Watterson, G.A., Ewens, W.J., Hall, T.E., Morgan, A.: The chromosome inversion problem. J. Theor. Biol. 99(1), 1–7 (1982)
Zhang, S., Zhu, D., Jiang, H., Ma, J., Guo, J., Feng, H.: Can a permutation be sorted by best short swaps?. In: Proceeding of the 29th Annual Symposium on Combinatorial Pattern Matching, pp. 14:1–14:12 (2018)
Funding
This paper is supported by the National Natural Science Foundation of China: Nos. 61732009, 61761136017, 61672325, 61872427.
Author information
Authors and Affiliations
Corresponding author
Additional information
Publisher's Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
The extended abstract of this paper has been presented at the 29th Annual Symposium on Combinatorial Pattern Matching [25].
Rights and permissions
About this article
Cite this article
Zhang, S., Zhu, D., Jiang, H. et al. Sorting a Permutation by Best Short Swaps. Algorithmica 83, 1953–1979 (2021). https://doi.org/10.1007/s00453-021-00814-x
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s00453-021-00814-x