arXiv:2610.39105cs.DSOct 2026

Manuscript Offprint

arXiv:2610.39105

Building On Learning-Augmented Online Sorting

Wyatt Olson

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

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. [3] 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(nr)O(\frac{n}{r})-consistent and O(r)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.

1 Introduction

A small but interesting line of work has recently arisen surrounding the problem of online sorting, which was first proposed by Aamand et al. [1] in work exploring translation-only polygon packing in an online setting. The problem is as follows: we are given an online input sequence X=x1,x2,…,xnX = x_1, x_2, \ldots, x_n to be sorted into an array AA of length nn such that an element of the input sequence must be irrevocably placed into an empty cell of AA before the next element of the sequence appears. The goal is for AA to be as close to sorted as possible upon assigning all values of XX to cells in AA. The cost of the resulting array AA provides a measure to quantify this closeness and is defined as c=∑i=1n−1∣A[i]−A[i+1]∣c = \sum_{i=1}^{n-1} |A[i] - A[i+1]|. It is clear that the optimal cost is given when AA is sorted in the traditional sense, in which case the cost is simply the range of the elements of XX (i.e. copt=range(X)c_{opt} = \text{range}(X)).