Sorting with Predictions

Xingjian Bai, Christian Coester
2/12/2026

No official code found. Best implementation: xingjian-bai/Sorting-with-Predictions (8 stars, last commit 2023-11-10).

Abstract

We explore the fundamental problem of sorting through the lens of learning-augmented algorithms, where algorithms can leverage possibly erroneous predictions to improve their efficiency. We consider two different settings: In the first setting, each item is provided a prediction of its position in the sorted list. In the second setting, we assume there is a"quick-and-dirty"way of comparing items, in addition to slow-and-exact comparisons. For both settings, we design new and simple algorithms using only $O(\sum_i \log \eta_i)$ exact comparisons, where $\eta_i$ is a suitably defined prediction error for the $i$th element. In particular, as the quality of predictions deteriorates, the number of comparisons degrades smoothly from $O(n)$ to $O(n\log n)$. We prove that the comparison complexity is theoretically optimal with respect to the examined error measures. An experimental evaluation against existing adaptive and non-adaptive sorting algorithms demonstrates the potential of applying learning-augmented algorithms in sorting tasks.

View on arXivView PDF

Code Implementations(1)

82C++, ShellApr 18, 20232 years ago

Similar Papers

Cite this paper

@article{bai2026sorting,
  title  = {Sorting with Predictions},
  author = {Xingjian Bai and Christian Coester},
  year   = {2026},
  eprint = {2311.00749},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2311.00749},
  journal = {NEURIPS 2023 2023}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2311.00749.svg)](https://codeofpaper.com/paper/2311.00749)

Discussion