Nearly Optimal Bounds for Stochastic Online Sorting
Abstract
In the online sorting problem, we have an array A of n cells, and receive a stream of n items x1,…,xn∈ [0,1]. When an item arrives, we need to immediately and irrevocably place it into an empty cell. The goal is to minimize the sum of absolute differences between adjacent items, which is called the cost of the algorithm. It has been shown by Aamand, Abrahamsen, Beretta, and Kleist (SODA 2023) that when the stream x1,…,xn is generated adversarially, the optimal cost bound for any deterministic algorithm is (n). In this paper, we study the stochastic version of online sorting, where the input items x1,…,xn are sampled uniformly at random. Despite the intuition that the stochastic version should yield much better cost bounds, the previous best algorithm for stochastic online sorting by Abrahamsen, Bercea, Beretta, Klausen and Kozma (ESA 2024) only achieves O(n1/4) cost, which seems far from optimal. We show that stochastic online sorting indeed allows for much more efficient algorithms, by presenting an algorithm that achieves expected cost n· 2O(* n). We also prove a cost lower bound of ( n), thus show that our algorithm is nearly optimal.
Turn this paper into a full lesson
ArcXiv compiles a staged curriculum from this paper: 8-12 lessons across beginner → advanced, synthesised section guides, visuals, flashcards, a quiz, exercises, and on-demand deep dives per section. Grounded in the abstract, never invented.