Papers
Topics
Authors
Recent
Search
2000 character limit reached

Stochastic Online Sorting

Updated 8 July 2026
  • Stochastic online sorting is an online placement problem where i.i.d. samples from U(0,1) are placed irrevocably into array cells to minimize the total variation.
  • Key algorithmic techniques include recursive hashing, adaptive buffer allocation, and phased balls-into-bins strategies that yield logarithmic and polylogarithmic competitive ratios.
  • Research advances shift the cost from an adversarial Θ(√n) barrier to near-optimal logarithmic bounds, while highlighting open challenges in tightening iterated-log factors and distribution robustness.

Searching arXiv for papers on stochastic online sorting and closely related formulations. arxiv_search(query="stochastic online sorting", max_results=10, sort_by="submittedDate") Stochastic online sorting is the online placement problem in which an array A[1..n]A[1..n] of nn initially empty cells receives i.i.d. samples x1,,xnU(0,1)x_1,\dots,x_n \sim \mathcal U(0,1) one by one, and each arrival must be placed immediately and irrevocably into an empty cell so as to minimize the total variation of the final array, typically written as i=1n1A[i+1]A[i]\sum_{i=1}^{n-1}|A[i+1]-A[i]| (Abrahamsen et al., 2024). In the one-dimensional uniform model, the offline optimum for the realized instance is stated to be Θ(1)\Theta(1) in the nn-cell case, so online guarantees can be expressed either as absolute cost bounds or as competitive ratios against a nearly constant benchmark (Abrahamsen et al., 2024). The area sits at the intersection of online algorithms, balls-into-bins concentration, and distribution-sensitive load balancing, and it has developed rapidly from an initial O~(n1/4)\widetilde O(n^{1/4}) guarantee to logarithmic and polylogarithmic bounds under stochastic input (Abrahamsen et al., 2024, Hu, 11 Aug 2025, Fotakis et al., 17 Aug 2025).

1. Formal model and performance criteria

The standard formulation gives an array A[1n]A[1\dots n] of nn initially empty cells and a stream of real items

x1,x2,,xn[0,1]x_1,x_2,\dots,x_n\in[0,1]

arriving one by one. Upon seeing nn0, the algorithm must immediately and irrevocably place it into an empty cell nn1. The cost of the final arrangement is

nn2

In the stochastic version, the nn3 are i.i.d. uniform on nn4, and analysis is carried out either in expectation or with high probability over the random input (Hu, 11 Aug 2025).

A common competitive formulation compares the online cost nn5 to the offline optimum nn6 on the same realized instance nn7. One explicit definition states that an algorithm is nn8-competitive with high probability if

nn9

for some constant x1,,xnU(0,1)x_1,\dots,x_n \sim \mathcal U(0,1)0 (Kalavas et al., 30 Sep 2025). Because the one-dimensional uniform-input offline optimum is reported as x1,,xnU(0,1)x_1,\dots,x_n \sim \mathcal U(0,1)1 in the x1,,xnU(0,1)x_1,\dots,x_n \sim \mathcal U(0,1)2-cell model, upper bounds on expected cost and upper bounds on competitive ratio are closely aligned at the level of asymptotic interpretation (Abrahamsen et al., 2024).

The adversarial and stochastic models differ sharply. In the adversarial model, the input sequence can be chosen by an adversary, possibly adapting to the algorithm’s past random coins. In the stochastic model, the sequence is sampled i.i.d. from x1,,xnU(0,1)x_1,\dots,x_n \sim \mathcal U(0,1)3, so concentration phenomena can be exploited through segmenting, hashing, and phased overflow control (Hu, 11 Aug 2025).

2. Historical benchmarks and asymptotic landscape

The baseline adversarial theory established a x1,,xnU(0,1)x_1,\dots,x_n \sim \mathcal U(0,1)4 barrier. Aamand, Abrahamsen, Beretta, and Kleist gave a deterministic algorithm with cost x1,,xnU(0,1)x_1,\dots,x_n \sim \mathcal U(0,1)5 and proved a matching x1,,xnU(0,1)x_1,\dots,x_n \sim \mathcal U(0,1)6 lower bound, and later work extended that x1,,xnU(0,1)x_1,\dots,x_n \sim \mathcal U(0,1)7 barrier to randomized adversarial algorithms (Hu, 11 Aug 2025). This made the stochastic model the natural setting in which substantially smaller costs might be possible.

The first stochastic breakthrough gave a x1,,xnU(0,1)x_1,\dots,x_n \sim \mathcal U(0,1)8-competitive algorithm for i.i.d. uniform inputs (Abrahamsen et al., 2024). Subsequent work produced two stronger lines of results. Hu obtained a deterministic online algorithm with expected cost

x1,,xnU(0,1)x_1,\dots,x_n \sim \mathcal U(0,1)9

and also proved that any randomized online-sorting algorithm on i=1n1A[i+1]A[i]\sum_{i=1}^{n-1}|A[i+1]-A[i]|0 i.i.d. i=1n1A[i+1]A[i]\sum_{i=1}^{n-1}|A[i+1]-A[i]|1 items has i=1n1A[i+1]A[i]\sum_{i=1}^{n-1}|A[i+1]-A[i]|2, yielding a nearly optimal logarithmic characterization up to a i=1n1A[i+1]A[i]\sum_{i=1}^{n-1}|A[i+1]-A[i]|3 factor (Hu, 11 Aug 2025). Independently, polylogarithmic competitive algorithms based on phased balls-into-bins decompositions achieved i=1n1A[i+1]A[i]\sum_{i=1}^{n-1}|A[i+1]-A[i]|4-competitive guarantees with high probability and extended to stochastic Online TSP in fixed dimension i=1n1A[i+1]A[i]\sum_{i=1}^{n-1}|A[i+1]-A[i]|5 (Fotakis et al., 17 Aug 2025, Kalavas et al., 30 Sep 2025).

Paper Setting Guarantee
"Online sorting and online TSP: randomized, stochastic, and high-dimensional" (Abrahamsen et al., 2024) Stochastic online sorting i=1n1A[i+1]A[i]\sum_{i=1}^{n-1}|A[i+1]-A[i]|6-competitive
"Nearly Optimal Bounds for Stochastic Online Sorting" (Hu, 11 Aug 2025) Stochastic online sorting expected cost i=1n1A[i+1]A[i]\sum_{i=1}^{n-1}|A[i+1]-A[i]|7, lower bound i=1n1A[i+1]A[i]\sum_{i=1}^{n-1}|A[i+1]-A[i]|8
"A Polylogarithmic Algorithm for Stochastic Online Sorting" (Fotakis et al., 17 Aug 2025) Stochastic online sorting i=1n1A[i+1]A[i]\sum_{i=1}^{n-1}|A[i+1]-A[i]|9-competitive w.h.p.
"A Polylogarithmic Competitive Algorithm for Stochastic Online Sorting and TSP" (Kalavas et al., 30 Sep 2025) Stochastic online sorting and TSP Θ(1)\Theta(1)0-approximation/competitive guarantee w.h.p.

This progression shows that stochastic input fundamentally changes the achievable scale: from the adversarial Θ(1)\Theta(1)1 regime to subpolynomial, then logarithmic or polylogarithmic behavior.

3. Recursive hashing and the Θ(1)\Theta(1)2 algorithm

The Θ(1)\Theta(1)3 algorithm of Abrahamsen, Bercea, Beretta, Klausen, and Kozma is built around recursive hashing into buckets plus a fallback “backyard,” explicitly borrowing ideas from hash-table design (Abrahamsen et al., 2024). For parameters Θ(1)\Theta(1)4 and Θ(1)\Theta(1)5, it sets

Θ(1)\Theta(1)6

and uses the hash

Θ(1)\Theta(1)7

Each arriving value is sent to its designated bucket if there is space; otherwise it is inserted into the backyard. Inside each bucket and inside the backyard, the scheme invokes the known deterministic adversarial Θ(1)\Theta(1)8-competitive subroutine on the corresponding subarray (Abrahamsen et al., 2024).

The one-level algorithm already yields nontrivial performance when Chernoff bounds control bucket loads. The fully recursive version, denoted Θ(1)\Theta(1)9, re-applies exactly the same scheme inside each bucket, using the fact that keys that hash into a bucket are again i.i.d. uniform on nn0 when viewed relative to that bucket. The analysis balances the recursive shrinkage of subproblem sizes against overflow probability. With a carefully chosen nn1 and recursion depth nn2, the main theorem states that there is an online algorithm for i.i.d. nn3 achieving cost

nn4

(Abrahamsen et al., 2024).

This work also made two broader points. First, it established an explicit structural connection between stochastic online sorting and efficient hash tables via bucket hashing, backyards, and concentration-based overflow control (Abrahamsen et al., 2024). Second, it identified the large-array variant with nn5 cells as a distinct regime: by hashing into nn6 and using linear probing, it obtained an nn7 competitive ratio in that model (Abrahamsen et al., 2024).

4. Nearly optimal logarithmic expected-cost bounds

Hu’s analysis sharpens the stochastic theory to a nearly tight logarithmic scale by combining a refined upper bound with a general lower bound (Hu, 11 Aug 2025). The algorithmic upper bound is deterministic and proceeds in three stages.

The first stage, “Adaptive allocation,” partitions nn8 into a constant nn9 of equal-length segments, pre-allocates a buffer of O~(n1/4)\widetilde O(n^{1/4})0 cells to each segment, and leaves the rest as a pool. When a buffer first overflows, the algorithm uses the history to estimate how many future items each segment is likely to send into the pool, then carves the pool into new buffers of those sizes. Across phases, the total pool size shrinks from O~(n1/4)\widetilde O(n^{1/4})1 to O~(n1/4)\widetilde O(n^{1/4})2, then to O~(n1/4)\widetilde O(n^{1/4})3, and so on, until only O~(n1/4)\widetilde O(n^{1/4})4 cells remain. The resulting recurrence has the form

O~(n1/4)\widetilde O(n^{1/4})5

and choosing O~(n1/4)\widetilde O(n^{1/4})6 forces O~(n1/4)\widetilde O(n^{1/4})7 (Hu, 11 Aug 2025).

The second stage, “Segment synchronization,” allows the number of segments to decrease over phases. When the current pool becomes smaller than O~(n1/4)\widetilde O(n^{1/4})8, the algorithm merges every block of O~(n1/4)\widetilde O(n^{1/4})9 adjacent segments into a “mega-segment” and allocates a small “dampening” buffer. A Chernoff-style argument shows that the old small buffers together with the dampening buffer behave like one uniform buffer of size A[1n]A[1\dots n]0. The third stage, “Recursion on nonuniform subproblems,” reintroduces recursion and handles both regular buffers, which see truly i.i.d. uniform inputs on their segment, and dampening buffers or final pools, which see a “multiway-pool” distribution of the same high-level type. The final guarantee is

A[1n]A[1\dots n]1

(Hu, 11 Aug 2025).

The lower bound is information-theoretic. For a uniformly random adjacent pair of cells A[1n]A[1\dots n]2, one examines the last A[1n]A[1\dots n]3 insertions and the event that one of the two cells is still empty after the first A[1n]A[1\dots n]4 placements. With probability A[1n]A[1\dots n]5, this occurs; conditioning on it, the next item placed into the vacant neighbor produces an expected gap of A[1n]A[1\dots n]6. Summing over A[1n]A[1\dots n]7 yields

A[1n]A[1\dots n]8

for every randomized online algorithm (Hu, 11 Aug 2025). The paper therefore identifies the optimal expected cost as A[1n]A[1\dots n]9 up to the factor nn0, and it explicitly leaves open whether that iterated-log gap can be removed.

5. Polylogarithmic phased algorithms and balls-into-bins hierarchies

A separate 2025 line of work obtains nn1-scale guarantees with high probability through phased decompositions of the array into geometrically decreasing subarrays and balanced balls-into-bins instances (Fotakis et al., 17 Aug 2025, Kalavas et al., 30 Sep 2025). The central idea is to partition the array into nn2 contiguous phases nn3, with nn4 geometrically decreasing, and in each phase to quantize nn5 into nn6 equal-probability buckets whose capacities are nn7. Incoming values are mapped to buckets by the quantization; a value is placed into its designated bucket if that bucket is not full, and otherwise it overflows into the corresponding bucket of the next phase (Kalavas et al., 30 Sep 2025).

The key analytic device is a concentration lemma for throwing balls into nn8 bins of capacity nn9. In one formulation, if x1,x2,,xn[0,1]x_1,x_2,\dots,x_n\in[0,1]0 is the total capacity, then with probability at least x1,x2,,xn[0,1]x_1,x_2,\dots,x_n\in[0,1]1, no bin overflows before x1,x2,,xn[0,1]x_1,x_2,\dots,x_n\in[0,1]2 balls have been thrown, and with the same probability all bins are full after x1,x2,,xn[0,1]x_1,x_2,\dots,x_n\in[0,1]3 throws (Fotakis et al., 17 Aug 2025). This concentration window is then used to show phase-by-phase success: conditioned on all prior phases being “good,” one subarray fills completely before the next subarray overflows, and a union bound yields overall success with probability x1,x2,,xn[0,1]x_1,x_2,\dots,x_n\in[0,1]4 (Fotakis et al., 17 Aug 2025).

The cost analysis decomposes into several components. Within each bucket, an adversarial x1,x2,,xn[0,1]x_1,x_2,\dots,x_n\in[0,1]5-competitive subroutine is run on a bucket of size x1,x2,,xn[0,1]x_1,x_2,\dots,x_n\in[0,1]6, producing x1,x2,,xn[0,1]x_1,x_2,\dots,x_n\in[0,1]7 cost per bucket-scale subproblem. Inter-bucket stitching inside a phase is bounded by the quantization gaps, and between-phase connectors contribute only one transition per phase. The final residual block also has size x1,x2,,xn[0,1]x_1,x_2,\dots,x_n\in[0,1]8, so it can be handled within the same asymptotic scale. Summing these contributions gives an overall x1,x2,,xn[0,1]x_1,x_2,\dots,x_n\in[0,1]9 guarantee with high probability (Fotakis et al., 17 Aug 2025).

The two presentations differ slightly in emphasis. One paper frames the result as an nn00-competitive algorithm for stochastic online sorting and extends it to stochastic Online TSP in fixed dimension nn01 by combining the same phase structure with equal-probability hypercube decompositions and a space-filling-curve-style traversal (Fotakis et al., 17 Aug 2025). The other states that the algorithm approximates the optimal cost within a factor of nn02 with high probability and likewise extends to Online TSP through a hierarchy of balls-into-bins instances on a laminar partition of space (Kalavas et al., 30 Sep 2025). In both cases, the conceptual advance is the use of logarithmically many balanced load-balancing instances whose bucket capacities remain only polylogarithmic.

A persistent source of confusion is that not every “stochastic sorting” problem is an online-placement problem. A distinct line of work studies sorting under stochastic uncertainty on intervals: each item nn03 has an unknown value nn04, a known distribution on that interval, and a query cost nn05; paying nn06 reveals the exact value, and the goal is to minimize expected total query cost while certifying the total order (Chaplick et al., 2020). In that model, an adaptive strategy is a decision tree whose branches are indexed by maximal subintervals induced by interval endpoints, and cascading queries occur when a revealed value falls into an overlapping interval. Chaplick, Halldórsson, de Lima, and Tonoyan show that optimal sorting under this stochastic uncertainty model can be solved in polynomial time via a dynamic program on the proper interval graph of the uncertainty intervals, with running time nn07 when the clique number is nn08 (Chaplick et al., 2020). That result is related in spirit through stochastic structure, but it addresses query minimization rather than irrevocable online placement.

Within stochastic online sorting proper, the open problems are now comparatively sharp. Hu explicitly asks whether the factor nn09 above the nn10 lower bound can be removed, or whether a stronger lower bound of the form nn11 is possible (Hu, 11 Aug 2025). The same work raises the overprovisioned case with nn12 cells and nn13 items, asking whether one can go below nn14 or prove nontrivial lower bounds in the stochastic model (Hu, 11 Aug 2025).

The phase-based polylogarithmic papers formulate a different set of extensions. They ask for algorithms under unknown distributions via online learning of cell-probabilities, for improvements toward the nn15 lower bound, and for derandomization under weaker model assumptions (Kalavas et al., 30 Sep 2025). Earlier work also points to random-order arrival and other beyond-worst-case models as intermediates between the nn16 adversarial regime and the stochastic regime (Abrahamsen et al., 2024). Taken together, these directions indicate that the current theory has largely identified the right asymptotic scale for the uniform i.i.d. model, while leaving substantial room in distributional robustness, high-dimensional structure, and lower-bound tightness.

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Stochastic Online Sorting.