Weak Heaps and Friends: Recent Developments

A weak heap is a variant of a binary heap where, for each node, the heap ordering is enforced only for one of its two children. In 1993, Dutton showed that this data structure yields a simple worst-case-efficient sorting algorithm. In this paper we review the refinements proposed to the basic data structure that improve the efficiency even further. Ultimately, minimum and insert operations are supported in O(1) worst-case time and extract-min operation in \(O(\lg n)\) worst-case time involving at most \(\lg n + O(1)\) element comparisons. In addition, we look at several applications of weak heaps. This encompasses the creation of a sorting index and the use of a weak heap as a tournament tree leading to a sorting algorithm that is close to optimal in terms of the number of element comparisons performed. By supporting insert operation in O(1) amortized time, the weak-heap data structure becomes a valuable tool in adaptive sorting leading to an algorithm that is constant-factor optimal with respect to several measures of disorder. Also, a weak heap can be used as an intermediate step in an efficient construction of binary heaps. For graph search and network optimization, a weak-heap variant, which allows some of the nodes to violate the weak-heap ordering, is known to be provably better than a Fibonacci heap.

[1]  Amr Elmasry,et al.  Inversion-sensitive sorting algorithms in practice , 2009, JEAL.

[2]  Ingo Wegener,et al.  On the Performance of WEAK-HEAPSORT , 2000, STACS.

[3]  Amr Elmasry,et al.  The Weak-Heap Family of Priority Queues in Theory and Praxis , 2012, CATS.

[4]  Amr Elmasry,et al.  The weak-heap data structure: Variants and applications , 2012, J. Discrete Algorithms.

[5]  David R. Musser,et al.  Introspective Sorting and Selection Algorithms , 1997, Softw. Pract. Exp..

[6]  Juhani Karhumäki,et al.  Computer Science - Theory and Applications , 2014, Lecture Notes in Computer Science.

[7]  Ronald L. Rivest,et al.  Introduction to Algorithms, third edition , 2009 .

[8]  Robert E. Tarjan,et al.  Relaxed heaps: an alternative to Fibonacci heaps with applications to parallel computation , 1988, CACM.

[9]  Domenico Cantone,et al.  QuickHeapsort, an Efficient Mix of Classical Sorting Algorithms , 2000, CIAC.

[10]  Ronald D. Dutton,et al.  Weak-heap sort , 1993, BIT.

[11]  Ingo Wegener BOTTOM-UP-HEAPSORT, a New Variant of HEAPSORT, Beating, on an Average, QUICKSORT (if n is not Very Small) , 1993, Theor. Comput. Sci..

[12]  Timothy J. Purcell Sorting and searching , 2005, SIGGRAPH Courses.

[13]  Stefan Edelkamp,et al.  QuickXsort: Efficient Sorting with n log n - 1.399n +o(n) Comparisons on Average , 2014, CSR.

[14]  Amr Elmasry,et al.  Multipartite priority queues , 2008, TALG.

[15]  A. Nijenhuis Combinatorial algorithms , 1975 .

[16]  Jyrki Katajainen The Ultimate Heapsort , 1998, CATS.

[17]  Fabio Vitale,et al.  Navigation Piles with Applications to Sorting, Priority Queues, and Priority Deques , 2003, Nord. J. Comput..

[18]  Stefan Edelkamp,et al.  Implementing HEAPSORT with (n logn - 0.9n) and QUICKSORT with (n logn + 0.2n) comparisons , 2002, JEAL.

[19]  Amr Elmasry,et al.  A Catalogue of Algorithms for Building Weak Heaps , 2012, IWOCA.

[20]  Amr Elmasry,et al.  In-place Heap Construction with Optimized Comparisons, Moves, and Cache Misses , 2012, MFCS.

[21]  Amr Elmasry,et al.  Two Constant-Factor-Optimal Realizations of Adaptive Heapsort , 2011, IWOCA.

[22]  Donald E. Knuth,et al.  The art of computer programming, volume 3: (2nd ed.) sorting and searching , 1998 .

[23]  Stefan Edelkamp,et al.  Policy-Based Benchmarking of Weak Heaps and Their Relatives, , 2010, SEA.

[24]  Gaston H. Gonnet,et al.  Heaps on Heaps , 1982, SIAM J. Comput..

[25]  Amr Elmasry,et al.  Adaptive sorting: an information theoretic perspective , 2008, Acta Informatica.

[26]  Bruce A. Reed,et al.  Building Heaps Fast , 1989, J. Algorithms.

[27]  Amr Elmasry,et al.  Weak heaps engineered , 2013, J. Discrete Algorithms.

[28]  Vladimiro Sassone,et al.  Mathematical Foundations of Computer Science 2012 , 2012, Lecture Notes in Computer Science.

[29]  Xin-She Yang,et al.  Introduction to Algorithms , 2021, Nature-Inspired Optimization Algorithms.

[30]  Jean Vuillemin,et al.  A data structure for manipulating priority queues , 1978, CACM.

[31]  Donald E. Knuth,et al.  The Art of Computer Programming: Volume 3: Sorting and Searching , 1998 .

[32]  Christos Levcopoulos,et al.  Adaptive Heapsort , 1993, J. Algorithms.