Abstract
In this paper, we propose an algorithm for sorting n pancakes. The previous studies were focused on finding upper bound or lower bound regarding a limited n-pancake. This study, however, suggests the algorithms for n-pancake with \(n\ge 5\). The only constraint is that \(n\ge 5\), which eliminates the very strong constraints [\(n\equiv 0\) (mod 16), \(n\equiv 0\) (mod 14), \(n\equiv 3\) (mod 4), etc.] that were used in previous studies. In addition, the sorting cost of the proposed algorithm is almost a half, from other existing studies, despite the fact that it reduces the degree from \(n-1\) to \(\frac{n}{2}+1\). We define the term ‘restricted reversal’, and based on that terminology, we also propose simple sorting and improved sorting algorithms for the pancake sorting. Further, we examine the worst case time complexity and average time to complete a sort using the suggested algorithms. We also propose sorting costs for the evaluation of similar sorting algorithms such as pancake, burnt pancake, and signed permutation algorithms, and compare the sorting costs and constraints that were found in existing studies. In addition, we propose a burnt pancake sorting algorithm that employs the proposed restricted reversals.
Similar content being viewed by others
References
Gates W, Papadimitriou C (1979) Bounds for sorting by prefix reversal. Discret Math 27:47–57
Cohen D, Blum M (1995) On the problem of sorting burnt pancakes. Discret Appl Math 61(2):105–1120
Kaplan H, Shamir R, Tarjan RE (1998) A faster and simpler algorithm for sorting signed permutations by reversals. SIAM J Comput 29(3):880–892
Chitturi B, Fahle W, Meng Z, Morales L, Shields CO, Sudborough IH, Voit W (2009) An (18/11)\(n\) upper bound for sorting by prefix reversals. Theor Comput Sci 410(36):3372–3390
Bulteau L, Fertin G, Rusu I (2012) Pancake flipping is hard. In: Proceedings of 37th international symposium on mathematical foundations of computer science. LNCS, vol 7464, pp 247–258
Hu X, Liu H (2013) The (conditional) matching preclusion for burnt pancake graphs. Discret Appl Math 161(10–11):1481–1489
Tannier E, Bergeron A, Sagot MF (2007) Advances on sorting by reversals. Discret Appl Math 155:881–888
Akers SB, Krishnamurthy B (1989) A group-theoretic model for symmetric interconnection networks. IEEE Trans Comput 38(4):555–566
Heydari M, Sudborough I (1993) On sorting by prefix reversals and the diameter of pancake networks. In: Proceedings of first Heinz Nixdorf symposium Paderborn on parallel architectures and their efficient use. LNCS, vol 678, pp 218–227
Heydari M, Sudborough I (1997) On the diameter of the pancake network. J Algorithms 25(1):67–94
Mendia VE, Sarkar D (1992) Optimal broadcasting on the star graph. IEEE Trans Parallel Distrib Syst 3(4):389–396
Yeh CH, Varvarigos E (1996) Macro-star networks: efficient low-degree alternatives to star graphs for large-scale parallel architectures. In: Proceedings of frontiers’96 symposium on the frontiers of massively parallel computation, pp 290–297
Latifi S, Srimani PK (1996) Transposition networks as a class of fault-tolerant robust networks. IEEE Trans Comput 45(2):230–238
Lee OK, Kim JS, Park KW, Seo JH, Oh E (2005) Matrix star graphs: a new interconnection network based on matrix operations. In: Proceedings of 10th Asia-Pacific conference on advances in computer systems architecture. LNCS vol 3740, pp 478–487
Bafna V, Pevzner P (1996) Genome rearrangements and sorting by reversals. SIAM J Comput 25(2):272–289
Berman P, Hannenhalli S, Karpinski M (2002) 1.375-Approximation algorithms for sorting by reversals. In: Proceedings of 10th annual European symposium. LNCS, vol 2461, pp 200–210
Elias I, Hartman T (2006) A 1.375-approximation algorithm for sorting by transpositions. IEEE/ACM Trans Comput Biol Bioinform 4(3):369–379
Grusea S, Labarre A (2013) The distribution of cycles in breakpoint graphs of signed permutations. Discret Appl Math 161(10–11):1448–1466
Haynes KA, Broderick ML, Brown AD, Butner TL, Dickson JO, Harden WL, Heard LH, Jessen EL, Malloy KJ, Ogden BJ, Rosemond S, Simpson S, Zwack E, Campbell AM, Eckdahl TT, Heyer LJ, Poet JL (2008) Engineering bacteria to solve the burnt pancake problem. J Biol Eng 2(8):1–12
Heyer LJ, Poet JL, Broderick ML, Compeau PEC, Dickson JO, Harden WL (2010) Bacterial computing: using E. coli to solve the burnt pancake problem. Math Horiz 17(3):5–10
Hannenhalli S, Pevzner PA (1999) Transforming cabbage into turnio: polynomial algorithm for sorting signed permutations by reversals. J ACM 46(1):1–27
Bhandarkar SM, Arabnia HR (1995) The REFINE multiprocessor: theoretical properties and algorithms. Parallel Comput 21(11):1783–1806
Arabnia HR, Smith JW (1993) A reconfigurable interconnection network for imaging operations and its implementation using a multi-stage switching box. In: Proceedings of the 1993 high performance computing: new horizons supercomputing symposium, pp 349-357
Arabnia HR (1990) A parallel algorithm for the arbitrary rotation of digitized images using process-and-data-decomposition approach. J Parallel Distrib Comput 10(2):188–193
Bhandarkar SM, Arabnia HR (1995) The hough transform on a reconfigurable multi-ring network. J Parallel Distrib Comput 24(1):107–114
Arabnia HR, Bhandarkar SM (1996) Parallel stereocorrelation on a reconfigurable multi-ring network. J Supercomput 10(3):243–270
Bhandarkar SM, Arabnia HR, Smith JW (1995) A reconfigurable architecture for image processing and computer vision. Int J Pattern Recognit Artif Intell 9(2):201–229
Arabnia HR (1995) A distributed stereocorrelation algorithm. In: Proceedings of Fourth International Conference on Computer Communications and Networks. IEEE, pp 479–482
Acknowledgments
We thank the reviewers for their comments and suggestions which have substantially improved our presentation. This research was supported by Basic Science Research Program through the National Research Foundation of Korea (NRF) funded by the Ministry of Education, Science and Technology (2012R1A1A4A01014439).
Author information
Authors and Affiliations
Corresponding author
Appendix: simple sorting and improved sorting examples
Appendix: simple sorting and improved sorting examples
Simple sorting example (worst case)
-
\(\ldots \) (worst case 11 time)
-
\(14,13,12,11,10,9,8,3,5,1,7,4,2,6 \rightarrow 6,2,4,7,1,5,3,8,9,10,11,12, 13,14,15 \rightarrow \)
-
\(\ldots \) (worst case 11 time)
-
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15.
-
Total 50 flip \(<3.5n+0.5.\)
Improved sorting example (near worst case)
Total 37 flip \(<3n+4.\)
Rights and permissions
About this article
Cite this article
Seo, JH., Kim, JS. & Lee, HO. An algorithm for sorting pancake by restricted reversals. J Supercomput 71, 3832–3850 (2015). https://doi.org/10.1007/s11227-015-1473-1
Published:
Issue Date:
DOI: https://doi.org/10.1007/s11227-015-1473-1