Table of Contents
Fetching ...

A Polylogarithmic Competitive Algorithm for Stochastic Online Sorting and TSP

Andreas Kalavas, Charalampos Platanos, Thanos Tolias

TL;DR

The paper addresses stochastic online sorting and its multidimensional generalization, stochastic online TSP, where elements arrive i.i.d. from uniform distributions. It introduces a unified hierarchical balls-into-bins framework that partitions the domain into phases and equal-mass bins with bucket size $\Theta(\log^2 n)$, enabling high-probability competitive guarantees. The main results prove an $O(\log^2 n)$-competitive cost for stochastic online sorting and an $O(\log^2 n)\cdot \mathrm{Opt}$ bound for stochastic online TSP, representing exponential improvements over prior adversarial or weaker stochastic bounds. The framework extends to higher dimensions via space-filling block partitioning and Bertram-type intra-bucket placement, offering dimension-robust polylog results with potential for general distributions and future work on unknown input models.

Abstract

In \emph{Online Sorting}, an array of $n$ initially empty cells is given. At each time step $t$, an element $x_t \in [0,1]$ arrives and must be placed irrevocably into an empty cell without any knowledge of future arrivals. We aim to minimize the sum of absolute differences between pairs of elements placed in consecutive array cells, seeking an online placement strategy that results in a final array close to a sorted one. An interesting multidimensional generalization, a.k.a. the \emph{Online Travelling Salesperson Problem}, arises when the request sequence consists of points in the $d$-dimensional unit cube and the objective is to minimize the sum of euclidean distances between points in consecutive cells. Motivated by the recent work of (Abrahamsen, Bercea, Beretta, Klausen and Kozma; ESA 2024), we consider the \emph{stochastic version} of Online Sorting (\textit{resp.} Online TSP), where each element (\textit{resp.} point) $x_t$ is an i.i.d. sample from the uniform distribution on $[0, 1]$ (\textit{resp.} $[0,1]^d$). By carefully decomposing the request sequence into a hierarchy of balls-into-bins instances, where the balls to bins ratio is large enough so that bin occupancy is sharply concentrated around its mean and small enough so that we can efficiently deal with the elements placed in the same bin, we obtain an online algorithm that approximates the optimal cost within a factor of $O(\log^2 n)$ with high probability. Our result comprises an exponential improvement on the previously best known competitive ratio of $\tilde{O}(n^{1/4})$ for Stochastic Online Sorting due to (Abrahamsen et al.; ESA 2024) and $O(\sqrt{n})$ for (adversarial) Online TSP due to (Bertram, ESA 2025).

A Polylogarithmic Competitive Algorithm for Stochastic Online Sorting and TSP

TL;DR

The paper addresses stochastic online sorting and its multidimensional generalization, stochastic online TSP, where elements arrive i.i.d. from uniform distributions. It introduces a unified hierarchical balls-into-bins framework that partitions the domain into phases and equal-mass bins with bucket size , enabling high-probability competitive guarantees. The main results prove an -competitive cost for stochastic online sorting and an bound for stochastic online TSP, representing exponential improvements over prior adversarial or weaker stochastic bounds. The framework extends to higher dimensions via space-filling block partitioning and Bertram-type intra-bucket placement, offering dimension-robust polylog results with potential for general distributions and future work on unknown input models.

Abstract

In \emph{Online Sorting}, an array of initially empty cells is given. At each time step , an element arrives and must be placed irrevocably into an empty cell without any knowledge of future arrivals. We aim to minimize the sum of absolute differences between pairs of elements placed in consecutive array cells, seeking an online placement strategy that results in a final array close to a sorted one. An interesting multidimensional generalization, a.k.a. the \emph{Online Travelling Salesperson Problem}, arises when the request sequence consists of points in the -dimensional unit cube and the objective is to minimize the sum of euclidean distances between points in consecutive cells. Motivated by the recent work of (Abrahamsen, Bercea, Beretta, Klausen and Kozma; ESA 2024), we consider the \emph{stochastic version} of Online Sorting (\textit{resp.} Online TSP), where each element (\textit{resp.} point) is an i.i.d. sample from the uniform distribution on (\textit{resp.} ). By carefully decomposing the request sequence into a hierarchy of balls-into-bins instances, where the balls to bins ratio is large enough so that bin occupancy is sharply concentrated around its mean and small enough so that we can efficiently deal with the elements placed in the same bin, we obtain an online algorithm that approximates the optimal cost within a factor of with high probability. Our result comprises an exponential improvement on the previously best known competitive ratio of for Stochastic Online Sorting due to (Abrahamsen et al.; ESA 2024) and for (adversarial) Online TSP due to (Bertram, ESA 2025).

Paper Structure

This paper contains 25 sections, 27 theorems, 32 equations, 3 figures, 4 algorithms.

Key Result

Theorem 1.1

theAlg achieves a cost of at most $O(\log^2 n)$ with high probability for the stochastic online sorting problem.

Figures (3)

  • Figure 1: A timeline of the phases of our algorithm during execution. Note how the inequality $T_i'-T_i\leq T_{i+1}$ is preserved.
  • Figure 2: A visual representation of our splitting procedure on the plane. Uniform distribution ensures that splitting a block in half creates two block of equal probability mass.
  • Figure 3: The domain $[0,1] \times [0,1]$ is partitioned into four blocks. The left panel shows the block-by-block tour produced by our algorithm, while the right panel shows the optimal TSP tour on the same instance. Although the two tours may differ, our partitioning ensures that their lengths remain close with high probability.

Theorems & Definitions (48)

  • Theorem 1.1
  • Theorem 1.2
  • Definition 2.1
  • Lemma 2.2
  • Lemma 2.3
  • Definition 2.4
  • Lemma 2.5
  • Remark 2.6
  • Definition 2.7
  • Lemma 2.8
  • ...and 38 more