English

Optimally selecting the top $k$ values from $X+Y$ with layer-ordered heaps

Data Structures and Algorithms 2020-10-07 v2

Abstract

Selection and sorting the Cartesian sum, X+YX+Y, are classic and important problems. Here, a new algorithm is presented, which generates the top kk values of the form Xi+YjX_i+Y_j. The algorithm relies only on median-of-medians and is simple to implement. Furthermore, it uses data structures contiguous in memory, and is fast in practice. The presented algorithm is demonstrated to be theoretically optimal.

Keywords

Cite

@article{arxiv.2001.11607,
  title  = {Optimally selecting the top $k$ values from $X+Y$ with layer-ordered heaps},
  author = {Oliver Serang},
  journal= {arXiv preprint arXiv:2001.11607},
  year   = {2020}
}
R2 v1 2026-06-23T13:25:55.291Z