On the Optimality of Tape Merge of Two Lists with Similar Size

The problem of merging sorted lists in the least number of pairwise comparisons has been solved completely only for a few special cases. Graham and Karp [TAOCP, 1999] independently discovered that the tape merge algorithm is optimal in the worst case when the two lists have the same size. Stockmeyer and Yao [SICOMP, 1980], Murphy and Paull [Inform. Control, 1979], and Christen [1978] independently showed when the lists to be merged are of size m and n satisfying m leq n leq floor(3/2 m) + 1, the tape merge algorithm is optimal in the worst case. This paper extends this result by showing that the tape merge algorithm is optimal in the worst case whenever the size of one list is no larger than 1.52 times the size of the other. The main tool we used to prove lower bounds is Knuth’s adversary methods [TAOCP, 1999]. In addition, we show that the lower bound cannot be improved to 1.8 via Knuth's adversary methods. We also develop a new inequality about Knuth's adversary methods, which might be interesting in its own right. Moreover, we design a simple procedure to achieve constant improvement of the upper bounds for 2m - 2 leq n leq 3m.

[1]  Michael A. Langston,et al.  Practical in-place merging , 1987, CACM.

[2]  Jean Cardinal,et al.  On Generalized Comparison-Based Sorting Problems , 2013, Space-Efficient Data Structures, Streams, and Algorithms.

[3]  Xiaoming Sun,et al.  Searching monotone multi-dimensional arrays , 2008, Discret. Math..

[4]  Frank K. Hwang,et al.  A Simple Algorithm for Merging Two Disjoint Linearly-Ordered Sets , 1972, SIAM J. Comput..

[5]  Donald E. Knuth,et al.  The art of computer programming: sorting and searching (volume 3) , 1973 .

[6]  Avinatan Hassidim,et al.  Sorting and Selection with Imprecise Comparisons , 2009, ICALP.

[7]  Marvin C. Paull,et al.  Minimum Comparison Merging of Sets of Approximately Equal Size , 1979, Inf. Control..

[8]  Nathan Linial,et al.  The Information-Theoretic Bound is Good for Merging , 1984, SIAM J. Comput..

[9]  Alan M. Frieze,et al.  Average-Case Analysis of the Merging Algorithm of Hwang and Lin , 1998, Algorithmica.

[10]  Amit Kumar,et al.  Sorting and selection with structured costs , 2001, Proceedings 2001 IEEE International Conference on Cluster Computing.

[11]  Michael E. Saks,et al.  Searching Ordered Structures , 1985, J. Algorithms.

[12]  Robert Michael Tanner,et al.  Minimean Merging and Sorting: An Algorithm , 1978, SIAM J. Comput..

[13]  Sampath Kannan,et al.  Two Probabilistic Results on Merging , 1993, SIAM J. Comput..

[14]  Frank K. Hwang,et al.  Optimal merging of 2 elements with n elements , 2004, Acta Informatica.

[15]  Jürgen Schulte Mönting Merging of 4 or 5 Elements with n Elements , 1981, Theor. Comput. Sci..

[16]  Vangalur S. Alagar,et al.  Optimal Expected-Time Algorithms for Merging , 1986, J. Algorithms.

[17]  Fanica Gavril Merging with parallel processors , 1975, CACM.

[18]  Tien D. Bui,et al.  An improvement of the binary merge algorithm , 1982, BIT Comput. Sci. Sect..

[19]  Robert E. Tarjan,et al.  A Fast Merging Algorithm , 1979, JACM.

[20]  C. Christen Improving the bounds on optimal merging , 1978, 19th Annual Symposium on Foundations of Computer Science (sfcs 1978).

[21]  Paul K. Stockmeyer,et al.  On the Optimality of Linear Merge , 1980, SIAM J. Comput..

[22]  Donald Ervin Knuth,et al.  The Art of Computer Programming , 1968 .

[23]  Sampath Kannan,et al.  Algorithms for the Generalized Sorting Problem , 2011, 2011 IEEE 52nd Annual Symposium on Foundations of Computer Science.

[24]  Glenn K. Manacher,et al.  Significant Improvements to the Hwang-Lin Merging Algorithm , 1979, JACM.

[25]  B. Mazur,et al.  CONJECTURE , 2004, Synthese.

[26]  Sampath Kannan,et al.  Selection with monotone comparison costs , 2003, SODA '03.

[27]  Frank K. Hwang,et al.  A Class of Merging Algorithms , 1973, JACM.

[28]  Frank K. Hwang Optimal Merging of 3 Elements with n Elements , 1980, SIAM J. Comput..

[29]  Tien D. Bui,et al.  Optimum combinations of sorting and merging , 1989, JACM.