Algorithm improves online sorting without knowing best solution

Building On Learning-Augmented Online Sorting

Data Structures and Algorithms

Summary

Sorting things as they arrive, without knowing the full list upfront, is tricky. The authors improve a method that uses predictions to place items in order as they come, without needing to know the best possible sorting ahead of time. Their new approach matches the best known performance and extends to related problems, like online travelling salesman routes. This means it’s more practical for situations where the full data isn’t available initially.

What this means in practice

  • For real-time data engineers: Sort data streams efficiently when the best final order is unknown in advance, improving data processing in dynamic environments.
  • For route planning teams: Design routes in real time with improved accuracy even when full travel data is unavailable upfront.

A theory result. No direct application yet.

Authors

Wyatt Olson

Abstract

Online sorting is a problem that has gained attention recently, and is a natural translation of sorting into an online setting. The problem at hand is to place elements of an online sequence immediately and irrevocably with the goal of producing an array that is as close to sorted as possible upon inserting all elements. Recent work by Bercea et al. [ESA 2026] introduced the incorporation of learned predictions into the online sorting domain. They show lower bounds for the consistency and robustness of any algorithm, including randomization, then provide a deterministic algorithm that is $O(n/r)$-consistent and $O(r)$-robust, which are tight bounds. However, this algorithm requires prior knowledge of the optimal offline cost of the full input sequence before all elements have been revealed. We resolve this by providing an algorithm with matching bounds that does not require knowledge of the optimal cost, then extend these results to the more general problem of online metric TSP, in line with the prior work.