Skip to main content
Log in

Sorting a Permutation by Best Short Swaps

  • Published:
Algorithmica Aims and scope Submit manuscript

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.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Institutional subscriptions

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7

Similar content being viewed by others

References

  1. Bafna, V., Pevzner, P.A.: Genome rearrangements and sorting by reversals. SIAM J. Comput. 25(2), 272–289 (1996)

    Article  MathSciNet  Google Scholar 

  2. 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)

  3. Bourque, G., Pevzner, P.A.: Genome-scale evolution: reconstructing gene orders in the ancestral species. Genome Res. 12(1), 26–36 (2002)

    Google Scholar 

  4. Caprara, Alberto: Sorting permutations by reversals and eulerian cycle decompositions. SIAM J. Discr. Math. 12(1), 91–110 (1999)

    Article  MathSciNet  Google Scholar 

  5. 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)

    Article  MathSciNet  Google Scholar 

  6. Dobzhansky, T., Sturtevant, A.H.: Inversions in the chromosomes of Drosophila pseudoobscura. Genetics 23, 28–64 (1938)

    Article  Google Scholar 

  7. 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)

  8. 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)

  9. 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)

  10. Galvão, G.R., Lee, O., Dias, Z.: Sorting signed permutations by short operations. Algorith. Mol. Biol. 10(1), 1–17 (2015)

    Article  Google Scholar 

  11. Hannenhalli, S., Pevzner, P.A.: Transforming cabbage into turnip: polynomial algorithm for sorting signed permutations by reversals. J. ACM 46(1), 1–27 (1999)

    Article  MathSciNet  Google Scholar 

  12. Heath, L.S., Vergara, J.P.C.: Sorting by short block-moves. Algorithmica 28(3), 323–354 (2000)

    Article  MathSciNet  Google Scholar 

  13. Heath, L.S., Vergara, J.P.C.: Sorting by short swaps. J. Comput. Biol. 10(5), 775–789 (2003)

    Article  Google Scholar 

  14. Jerrum, M.: The complexity of finding minimum-length generator sequences. Theor. Comput. Sci. 36(2–3), 265–289 (1985)

    Article  MathSciNet  Google Scholar 

  15. 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)

  16. Jiang, H., Zhu, D.: A 14/11-approximation algorithm for sorting by short block-moves. Science China Inf. Sci. 54(2), 279–292 (2011)

    Article  MathSciNet  Google Scholar 

  17. Jiang, H., Zhu, D., Zhu, B.: A (1+ \(\varepsilon\))-approximation algorithm for sorting by short block-moves. Theor. Comput. Sci. 439, 1–8 (2012)

    Article  MathSciNet  Google Scholar 

  18. 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)

    Article  MathSciNet  Google Scholar 

  19. Kececioglu, J., Sankoff, D.: Exact and approximation algorithms for sorting by reversals, with application to genome rearrangement. Algorithmica 13(1–2), 180–210 (1995)

    Article  MathSciNet  Google Scholar 

  20. Palmer, J.D., Herbon, L.A.: Plant mitochondrial DNA evolves rapidly in structure, but slowly in sequence. J. Mol. Evol. 27, 87–97 (1988)

    Article  Google Scholar 

  21. Pevzner, P., Tesler, G.: Genome rearrangements in mammalian evolution: lessons from human and mouse genomes. Genome Res. 13(1), 37–45 (2003)

    Article  Google Scholar 

  22. 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)

    Article  Google Scholar 

  23. 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)

    Article  Google Scholar 

  24. Watterson, G.A., Ewens, W.J., Hall, T.E., Morgan, A.: The chromosome inversion problem. J. Theor. Biol. 99(1), 1–7 (1982)

    Article  Google Scholar 

  25. 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)

Download references

Funding

This paper is supported by the National Natural Science Foundation of China: Nos. 61732009, 61761136017, 61672325, 61872427.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Daming Zhu.

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

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

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

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s00453-021-00814-x

Keywords

Navigation