Selection from heaps, row-sorted matrices and X+Y using soft heaps

We use soft heaps to obtain simpler optimal algorithms for selecting the $k$-th smallest item, and the set of~$k$ smallest items, from a heap-ordered tree, from a collection of sorted lists, and from $X+Y$, where $X$ and $Y$ are two unsorted sets. Our results match, and in some ways extend and improve, classical results of Frederickson (1993) and Frederickson and Johnson (1982). In particular, for selecting the $k$-th smallest item, or the set of~$k$ smallest items, from a collection of~$m$ sorted lists we obtain a new optimal "output-sensitive" algorithm that performs only $O(m+\sum_{i=1}^m \log(k_i+1))$ comparisons, where $k_i$ is the number of items of the $i$-th list that belong to the overall set of~$k$ smallest items.

[1]  Bernard Chazelle,et al.  A minimum spanning tree algorithm with inverse-Ackermann type complexity , 2000, JACM.

[2]  Donald B. Johnson,et al.  The Complexity of Selection and Ranking in X+Y and Matrices with Sorted Columns , 1982, J. Comput. Syst. Sci..

[3]  Michael L. Fredman,et al.  How Good is the Information Theory Bound in Sorting? , 1976, Theor. Comput. Sci..

[4]  Bernard O. Koopman,et al.  The Optimum Distribution of Effort , 1953, Oper. Res..

[5]  David Eppstein,et al.  Finding the k shortest paths , 1994, Proceedings 35th Annual Symposium on Foundations of Computer Science.

[6]  Donald B. Johnson,et al.  Lower Bounds for Selection in X + Y and Other Multisets , 1978, JACM.

[7]  Uri Zwick,et al.  Median Selection Requires (2+epsilon)n Comparisons , 2001, SIAM J. Discret. Math..

[8]  Ileana Streinu,et al.  A Pseudo-Algorithmic Separation of Lines from Pseudo-Lines , 1995, Inf. Process. Lett..

[9]  Ronald L. Rivest,et al.  Introduction to Algorithms, 3rd Edition , 2009 .

[10]  Jean Cardinal,et al.  Sorting under partial information (without the ellipsoid algorithm) , 2009, STOC '10.

[11]  Donald B. Johnson,et al.  Selecting the Kth element in X + Y and X_1 + X_2 + ... + X_m , 1978, SIAM J. Comput..

[12]  J. L. Hodges,et al.  Estimates of Location Based on Rank Tests , 1963 .

[13]  Shachar Lovett,et al.  Near-optimal Linear Decision Trees for k-SUM and Related Problems , 2019, J. ACM.

[14]  Greg N. Frederickson,et al.  An Optimal Algorithm for Selection in a Min-Heap , 1993, Inf. Comput..

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

[16]  Jeff Kahn,et al.  Entropy and sorting , 1992, STOC '92.

[17]  Jean-Luc Lambert Sorting the Sums (xi+yj) in O(n2) Comparisons , 1992, Theor. Comput. Sci..

[18]  Donald B. Johnson,et al.  Erratum: Generalized Selection and Ranking: Sorted Matrices , 1990, SIAM J. Comput..

[19]  Donald B. Johnson,et al.  Generalized Selection and Ranking: Sorted Matrices , 1984, SIAM J. Comput..

[20]  Seth Pettie,et al.  An optimal minimum spanning tree algorithm , 2000, JACM.

[21]  Manuel Blum,et al.  Time Bounds for Selection , 1973, J. Comput. Syst. Sci..

[22]  J. Kahn,et al.  Balancing poset extensions , 1984 .

[23]  Arnold Schönhage,et al.  Finding the Median , 1976, J. Comput. Syst. Sci..

[24]  Alejandro López-Ortiz,et al.  Online Sorted Range Reporting , 2009, ISAAC.

[25]  Haim Kaplan,et al.  Soft Heaps Simplified , 2013, SIAM J. Comput..

[26]  Bernard Chazelle,et al.  The soft heap: an approximate priority queue with optimal error rate , 2000, JACM.

[27]  Uri Zwick,et al.  Selecting the median , 1995, SODA '95.