betaFeedback

WorksComputer Science

The Online Steinitz Problem

Abstract

Inspired by Steinitz's celebrated result (1913) and recent online vector-balancing results of Kulkarni et al. (2024) and Aden-Ali (2026), we introduce the online Steinitz problem: TT vectors in Rd\mathbb R^d, each of ℓ2\ell_2-norm at most 11 and with total sum zero, arrive one at a time and must be assigned immediately and irrevocably to unused positions of an array. The goal is to keep every prefix sum of the resulting order small. We first obtain deterministic prefix-discrepancy bounds of O(log⁡T)O(\log T) for d=1d=1 and O(T)O(\sqrt T) for d≥2d\ge2. Our main contribution is a general reduction that converts deterministic and randomized online vector-balancing algorithms, which assign signs to arriving vectors, into online ordering algorithms. Combined with recent vector-balancing results, this yields a randomized algorithm with prefix discrepancy O(log⁡T+dlog⁡T)O(\log T+\sqrt{d\log T}) and running time O(dTlog⁡T)O(dT\log T). The guarantee holds with high probability against an oblivious adversary. The reduction also gives bounds for sparse vectors and extends to inputs in arbitrary compact convex bodies. Finally, we prove matching lower bounds in both the deterministic and randomized cases.

Introduction

The classical Steinitz lemma asks how to order a zero-sum family of bounded vectors so that every prefix sum remains small [25]. For vectors v1,…,vT∈Rdv_1,\ldots,v_T \in\mathbb{R}^{d} with ∥vt∥2≤1\lVert v_t\rVert_2 \le1 and ∑t=1Tvt=0\sum_{t=1}^{T}v_t=0, the goal is to prove there exists an ordering distributes cancellation throughout the sequence instead of postponing it until the end. Indeed, Steinitz [25] proved that there is a permutation π:[T]→[T]\pi:[T]\to[T] such that

max⁡0≤k≤T∥∑j=1kvπ(j)∥2≤d.\max_{0\le k\le T}\left\lVert\sum_{j=1}^{k}v_{\pi(j)}\right\rVert_2\le d.

Establishing an O(d)O(\sqrt{d}) upper bound for the Euclidean Steinitz constant has been a long-standing open problem. On 6 October 2026, OpenAI announced a proof of this bound [19], which, if confirmed, would determine the constant depending on dd up to absolute factors.1 Beyond the importance of the mathematical question itself, the principle of the Steinitz lemma serves as a standard tool in discrepancy theory and integer programming, e.g., [14, 16, 15].

We introduce the online Steinitz problem (OSP). In this problem, there are TT initially empty output positions, and vectors v1,…,vTv_1,\ldots,v_T that arrive sequentially with ∥vt∥2≤1\lVert v_t\rVert_2\le1 and ∑t=1Tvt=0\sum_{t=1}^{T}v_t=0, identically to the offline case. Upon seeing vtv_t, the algorithm must assign it immediately and irrevocably to an unused position pt∈[T]p_t\in[T], thereby building a permutation π\pi on the fly such that π(pt)=t\pi(p_t)=t. The completed output is therefore vπ(j)v_{\pi(j)} and its prefix discrepancy by the end of the assignment is max⁡0≤k≤T∥∑j=1kvπ(j)∥2\max_{0\le k\le T}\left\lVert\sum_{j=1}^{k}v_{\pi(j)}\right\rVert_2. Although the prefix discrepancy is an identical measure in both offline and the online case, the requirement of an immediate and irrevocable placement and the limited future knowledge leads to a substantially harder algorithmic task that we seek to investigate:

Question. What is the worst-case online prefix discrepancy for immediate and irrevocable vector decisions, and how does this compare with the offline optimum?

We study this question under the oblivious adversarial model, which fixes the entire input independently of the algorithm’s randomness, and also under the adaptive adversarial model, which may choose each vector after observing the previous assignments. This means that, against the former kind of adversary, randomness may help, while against the latter it does not. We therefore write OS⁡rand(d,T,δ)\operatorname{OS}_{\mathrm{rand}}(d,T,\delta) for the smallest discrepancy bound that a randomized algorithm can guarantee with probability at least 1−δ1-\delta on every fixed input. The corresponding optimal deterministic worst-case bound against adaptive inputs is denoted by OS⁡det(d,T)\operatorname{OS}_{\mathrm{det}}(d,T).

The problem is reminiscent of online vector balancing (OVB) [12, 6, 18, 4]: in that case, an OVB algorithm chooses a sign for each arriving vector and controls signed prefix sums in arrival order. On the other hand, an OSP algorithm chooses among all vacant positions, and one placement may affect many output prefixes, which are evaluated only after the stream ends, and not after each arrival. We defer the reader to the survey of Bansal and Nikolov [13] for an extensive treatment of algorithmic discrepancy in its various forms, including offline and online.

Our results

Despite their differences, our main upper-bound contribution is a general reduction from OSP to OVB. We first describe this general reduction, followed by its deterministic and randomized applications, further corollaries, and matching lower bounds.

A general reduction. In § 2, we present a black-box reduction from online vector balancing to online Steinitz ordering. The reduction builds an OSP router from OVB subroutines, which we call signers. Its ordering guarantee is stated in terms of the signers’ final vector and count bounds, or alternatively their subgaussian estimates. As a result, the same routing framework can use a range of deterministic or randomized signers, and any improvement in their balancing performance immediately yields stronger ordering bounds. The reduction also applies when the total sum of the input vectors is arbitrary and unknown in advance, and it ensures that every prefix remains close to its proportional share of this total. In addition, if the inputs lie in a known compact convex body KK of affine dimension ss, then any Euclidean proportional-prefix bound ρ\rho implies that the residuals lie in (sρ/2)(K−K)(s\rho/2)(K-K), where, as usual, K−K={x−y:x,y∈K}K-K=\{x-y:x,y\in K\}. This extension does not require KK to be symmetric, and it preserves deterministic and probabilistic guarantees under the same adversarial model.

Deterministic bounds. Using the OSP router given by the reduction instantiated with deterministic OVB signers, in § 3, we show that the optimal deterministic discrepancy is

OS⁡det(d,T)∈{O(log⁡T),d=1,O(T),d≥2.\operatorname{OS}_{\mathrm{det}}(d,T)\in \begin{cases} O(\log T), & d=1,\\ O(\sqrt{T}), & d\ge2. \end{cases}

As mentioned previously, both upper bounds hold against adaptive adversaries, and the higher-dimensional lower bound already holds in a fixed plane.

Tight bounds against an oblivious adversary. In § 4, we instantiate the general reduction with Aden-Ali’s randomized OVB signer [4] and obtain a prefix discrepancy of

OS⁡rand(d,T,δ)∈O(log⁡T+(d+log⁡(1/δ))log⁡T),(1)\operatorname{OS}_{\mathrm{rand}}(d,T,\delta)\in O\left(\log T+\sqrt{(d+\log(1/\delta))\log T}\right), \tag*{(1)}

with probability at least 1−δ1-\delta. This guarantee is achieved efficiently, with the overall procedure having a running time of O(dTlog⁡T)O(dT\log T), and furthermore yields a guarantee of O(log⁡T+log⁡T⋅log⁡(1/δ))O\left(\log T+\sqrt{\log T\cdot\log(1/\delta)}\right) in the ℓ∞\ell_\infty-norm. Furthermore, we can instantiate our reduction with a different OVB signer for zero-sum inputs in [−1,1]d[-1,1]^d with at most κ\kappa nonzero coordinates, and ℓ2\ell_2-norm as large as κ\sqrt{\kappa}. Specifically, the signer of Altschuler–Tikhomirov [8] gives O(κlog⁡T)O(\sqrt{\kappa}\log T) coordinatewise discrepancy whenever the failure bound in Corollary 4.4 is at most δ\delta.

Matching lower bounds. In § 5, all hard inputs consist of an initial stream followed by identical vectors that cancel its total. An all-ones initial stream and Tijdeman–Wagner [26] give an Ω(log⁡T)\Omega(\log T) lower bound; coordinate cycles and Roth’s method [21] give Ω(d∗log⁡(2+T/d∗))\Omega\left(\sqrt{d_*}\log(2+T/d_*)\right), where d∗=min⁡{d,T}d_*=\min\{d,T\}. Both hold for every 0<δ≤1/20<\delta\le1/2. Their sum matches the upper bound of (19) whenever T−β≤δ≤1/2T^{-\beta}\le\delta\le1/2 for fixed β>0\beta>0. An adaptive initial stream in a fixed plane gives the matching deterministic Ω(T)\Omega(\sqrt{T}) lower bound for d≥2d\ge2.

Related work

The Steinitz lemma and its extensions. In the offline setting, the classical Steinitz lemma [25] guarantees that a zero-sum family of bounded vectors admits an ordering whose prefix sums are bounded independently of the number of vectors. Grinberg and Sevastyanov [16] established the bound dd in every dd-dimensional normed space. For the ℓ2\ell_2-norm, improving the dimension dependence to O(d)O(\sqrt{d}) remains a longstanding conjecture, with a matching Ω(d)\Omega(\sqrt{d}) lower bound. Recent work of Ambrus and Heck [5] relates this problem to ordering nearly unit vectors with arbitrary total sum, measuring each prefix against its proportional share of that total. Another direction concerns simultaneous rearrangements: Oertel et al. [20] proved a colorful Steinitz lemma that permutes several sequences while controlling their combined prefixes independently of the number of sequences. Bárány [9] improved their 40d540d^5 bound to 4d−24d-2. Steinitz lemma also has algorithmic applications beyond discrepancy, as for instance, the work of Eisenbrand and Weismantel [15] which used it to establish proximity bounds and faster algorithms for integer programming.

Online vector balancing and scheduling. Online vector balancing replaces rearrangement by sequential sign choices. Bansal et al. [12] studied stochastic inputs drawn independently from an arbitrary distribution and obtained applications to geometric discrepancy. For oblivious adversarial inputs, Alweiss et al. [6] introduced the self-balancing walk, giving efficient algorithms with logarithmic ℓ∞\ell_\infty prefix discrepancy for Euclidean unit-ball vectors. Kulkarni et al. [18] subsequently obtained a universal subgaussian guarantee for each signed prefix. This implies O(log⁡T)O(\sqrt{\log T}) maximum ℓ∞\ell_\infty prefix discrepancy with high probability, matching their lower bound against oblivious adversaries. Aden-Ali [4] obtained the same asymptotic guarantee with an O(dT)O(dT)-time algorithm. For coordinate-bounded vectors with at most κ\kappa nonzero coordinates, Altschuler and Tikhomirov [8] obtained O(κ)O(\sqrt{\kappa}) online ℓ∞\ell_\infty prefix discrepancy above a near-logarithmic sparsity threshold. Online vector scheduling [17] likewise requires irrevocable allocation of arriving vectors, but distributes nonnegative demand vectors among machines to optimize their loads, whereas OSP assigns vectors to ordered positions and exploits cancellation to control all prefix sums.

Signing, rearrangement, and geometric discrepancy. The connection between signing and rearrangement predates their online versions. Bárány and Grinberg [11] proved that every prescribed sequence of unit vectors in a dd-dimensional normed space admits offline signs for which all signed prefixes have norm at most 2d−12d-1. Chobanyan’s transference theorem [14] shows that a uniform bound for this offline prefix-signing problem also bounds the Steinitz constant, without increasing the bound. However, this does not transfer to the online setting as argued in § 2.5. Controlling only the final signed sum is a different problem. For example, Ambrus and Bozzai [2] proved sharp Euclidean bounds for colorful vector balancing, where one selects a vector from each prescribed family and controls the sum of the selected vectors. Our lower bounds use another connection to discrepancy: points record arrival times and assigned positions. Schmidt’s planar rectangle-discrepancy theorem [22] gives the deterministic scalar bound; Tijdeman–Wagner’s strengthening [26] and a restricted form of Roth’s orthogonal-function argument [21] yield the oblivious bounds. For a broader account of these topics and their algorithmic connections, see the monograph manuscript of Bansal and Nikolov [13].

Online sorting and online TSP. Our placement model is also closely related to online sorting [1] and its extension to online TSP [3, 10]: arriving numbers or points must be assigned immediately and irrevocably to unused array positions. It is worth noting that the work of Azar et al. [7] further studies the tradeoff between array size and competitiveness for online metric TSP, obtaining a deterministic O(log⁡3T)O(\log^{3} T)-competitive algorithm with 2T2T cells. Their placement constraint coincides with ours when the array has exactly TT cells, but their objective controls distances between consecutive entries rather than cumulative vector sums. Their tree-based placement scheme organizes points by metric proximity, whereas our reduction uses online signing to balance the sums routed to subintervals. More generally, these problems minimize the total distance between consecutive entries, whereas OSP controls the norm of every prefix sum. Geometrically, their inputs are points to connect by a short path, while ours are steps to arrange into a walk that stays close to the origin through cancellation.

The signing-to-ordering reduction

The reduction repeatedly divides the output positions into two nearly equal intervals. At each division, an online signer proposes a child for the arriving vector, and the router can only override this choice when it has to avoid an interval that is already full. We first describe this algorithm, then state the signing guarantees that suffice and prove how its local splits control every output prefix.

The ordering algorithm

We first introduce some notation, beginning with the definition of residuals.

Residuals. For the completed ordering vπ=(vπ(1),…,vπ(T))v_{\pi}=(v_{\pi(1)},\ldots,v_{\pi(T)}), write tot⁡:=∑t=1Tvt\operatorname{tot}:=\sum_{t=1}^{T}v_t and define the prefix residual for each k∈[T]k\in[T] and the maximum residual by

res⁡k(vπ):=∑j=1kvπ(j)−kTtot⁡,res⁡max⁡(vπ):=max⁡0≤k≤T∥res⁡k(vπ)∥2.(2)\operatorname{res}_{k}(v_{\pi}):=\sum_{j=1}^{k}v_{\pi(j)}-\frac{k}{T}\operatorname{tot},\qquad\operatorname{res}_{\max}(v_{\pi}):=\max_{0\leq k\leq T}\lVert\operatorname{res}_{k}(v_{\pi})\rVert_{2}. \tag*{(2)}

These residuals measure deviations from proportional shares of the total and become ordinary prefix sums when tot⁡=0\operatorname{tot}=0. Hence, for some upper bound U≥0U\geq0 achieved deterministically or in high probability, we have that, if res⁡max⁡≤U\operatorname{res}_{\max}\leq U then OS⁡≤U\operatorname{OS}\leq U, since tot⁡=0\operatorname{tot}=0. We next describe the position tree and the meta-algorithm needed for our reduction.

The position tree. Our algorithm assigns each arriving vector to an output position by routing it through a balanced binary tree. This tree has the output positions as its leaves, and so has height h=⌈log⁡2T⌉h=\lceil\log_{2}T\rceil. Each node uu represents a consecutive interval Iu⊆[T]I_u\subseteq[T] which consists of the output positions labeling the

Algorithm 1 Tree routing with local proposal rules

Require: Horizon $T$, local routines $\operatorname{Sign}_u$, and vectors $v_1,\ldots,v_T$ arriving one at a time.

Ensure: An online permutation $\pi$, with $\pi(p_t)=t$.

1: Build the balanced position tree with capacities $m_u=|I_u|$.
2: for each internal node $u$ do
3:   Initialize $\operatorname{Sign}_u$ once.
4:   for $c\in\{u_L,u_R\}$ do
5:     $N_c\gets 0,\quad X_c\gets 0$.
6:   for $t=1,\ldots,T$ do
7:     Receive $v_t$ and set $u\gets\operatorname{root}$.
8:     while $u$ is not a leaf do
9:       $\varepsilon\gets\operatorname{Sign}_u(v_t;X_{u_L},X_{u_R},m_{u_L}-N_{u_L},m_{u_R}-N_{u_R})$.
10:      $\widehat{\varepsilon}\gets\varepsilon$. ▷ Proposed versus actual routing sign
11:      if $N_{u_L}=m_{u_L}$ then
12:        $\widehat{\varepsilon}\gets-1$.
13:      else if $N_{u_R}=m_{u_R}$ then
14:        $\widehat{\varepsilon}\gets+1$.
15:      if $\widehat{\varepsilon}=+1$ then
16:        $c\gets u_L$.
17:      else
18:        $c\gets u_R$.
19:      $N_c\gets N_c+1,\quad X_c\gets X_c+v_t$.
20:      $u\gets c$.
21:    $p_t\gets\min I_u,\quad \pi(p_t)\gets t$.

leaves in the subtree rooted at uu. The node uu has capacity mu:=∣Iu∣m_u:=|I_u| with children uL,uRu_L,u_R of capacities ⌈mu/2⌉\lceil m_u/2\rceil and ⌊mu/2⌋\lfloor m_u/2\rfloor, respectively.

As illustrated in Algorithm 1 and Figure 1, each internal node uses a persistent local signer Sign⁡u\operatorname{Sign}_u to propose +1+1 (left) or −1-1 (right). The router follows this proposal unless the requested child is full, in which case it uses the other child. Repeating the decision until a leaf is reached assigns the vector’s output position immediately. During the descent, the algorithm records in NcN_c how many positions are already filled in child cc, and in XcX_c the sum of the corresponding vectors. The arguments of Sign⁡u\operatorname{Sign}_u are the arriving vector vtv_t, the child sums XuL,XuRX_{u_L},X_{u_R}, and the remaining capacities muL−NuL,muR−NuRm_{u_L}-N_{u_L},m_{u_R}-N_{u_R}. Here the semicolon separates vtv_t from the routing statistics. In particular, the scalar rule in § 3 uses these statistics directly, while, for a Euclidean signing subroutine, the node submits the augmented vector (vt,1)/2(v_t,1)/\sqrt{2}, so the extra coordinate balances left and right counts along with the original vector coordinates.

Routing tree showing the highlighted path assigning $v_t$ to output position 6

Figure 1. Routing an arriving vector vtv_t when T=8T = 8. At each visited internal node, the local rule selects one of the two child intervals. The highlighted path assigns vtv_t to output position 6.

Each local signer receives every vector reaching its node, even after one child fills, and updates its private state with its proposed sign. We stress that only the router overrides the destination. Moreover, we also note that randomized copies have independent tapes, independent of the input, and different rules may be used at different node sizes.

The reduction guarantee

References

  1. [1]Anders Aamand, Mikkel Abrahamsen, Lorenzo Beretta, and Linda Kleist. Online sorting and translational packing of convex polygons. In Proceedings of SODA, pages 1806–1833, 2023.arxiv.org/abs/2112.03791
  2. [2]Gergely Ambrus and Rainie Bozzai. Colorful vector balancing. Mathematika, 70(4):e12274, 2024.DOI
  3. [3]Mikkel Abrahamsen, Ioana O. Bercea, Lorenzo Beretta, Jonas Klausen, and László Kozma. Online sorting and online TSP: Randomized, stochastic, and high-dimensional. In Proceedings of ESA, volume 308 of LIPics, pages 5:1–5:15, 2024.arxiv.org/abs/2406.19257
  4. [4]Ishaq Aden-Ali. Optimal online discrepancy minimization in linear time, 2026.
  5. [5]Gergely Ambrus and Rainie Heck. A note on the Steinitz lemma. Mathematika, 72(2):e70085, 2026.DOI
  6. [6]Ryan Alweiss, Yang P. Liu, and Mehtaab Sawhney. Discrepancy minimization via a self-balancing walk. In STOC, pages 14–20. ACM, 2021.
  7. [7]Yossi Azar, Debmalya Panigrahi, and Or Vardi. Online metric TSP: beyond the √n barrier. In ICALP, volume 374 of LIPics, pages 18:1–18:18. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2026.DOI
  8. [8]Dylan J. Altschuler and Konstantin Tikhomirov. Online Beck–Fiala down to logarithmic sparsity, 2026.arxiv.org/abs/2607.14238
  9. [9]Imre Bárány. A matrix version of the Steinitz lemma. Journal für die reine und angewandte Mathematik, 809:261–267, 2024.arxiv.org/abs/2308.10102
  10. [10]Christian Bertram. Online metric TSP. In ESA, volume 351 of LIPics, pages 80:1–80:9. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2025.arxiv.org/abs/2504.17716
  11. [11]Imre Bárány and V. S. Grinberg. On some combinatorial questions in finite-dimensional spaces. Linear Algebra and its Applications, 41:1–9, 1981.DOI
  12. [12]Nikhil Bansal, Haotian Jiang, Sahil Singla, and Makrand Sinha. Online vector balancing and geometric discrepancy. In STOC, pages 1139–1152. ACM, 2020.arxiv.org/abs/1912.03350
  13. [13]Nikhil Bansal and Aleksandar Nikolov. Discrepancy theory: An algorithmic and geometric perspective, 2026. Manuscript for an unpublished monograph.arxiv.org/abs/2608.00140
  14. [14]Sergej Chobanyan. Convergence a.s. of rearranged random series in Banach space and associated inequalities. In Jørgen Hoffmann-Jørgensen, James Kuelbs, and Michael B. Marcus, editors, Probability in Banach Spaces, 9, volume 35 of Progress in Probability, pages 3–29. Birkhäuser, Boston, MA, 1994.DOI
  15. [15]Friedrich Eisenbrand and Robert Weismantel. Proximity results and faster algorithms for integer programming using the Steinitz lemma. ACM Transactions on Algorithms, 16(1):1–14, 2020.
  16. [16]V. S. Grinberg and S. V. Sevastyanov. Value of the Steinitz constant. Functional Analysis and Its Applications, 14(2):125–126, 1980.DOI
  17. [17]Sungjin Im, Nathaniel Kell, Janardhan Kulkarni, and Debmalya Panigrahi. Tight bounds for online vector scheduling. SIAM Journal on Computing, 48(1):93–121, 2019.
  18. [18]Janardhan Kulkarni, Victor Reis, and Thomas Rothvoss. Optimal online discrepancy minimization. In Proceedings of the 56th Annual ACM Symposium on Theory of Computing, pages 1832–1840. ACM, 2024.arxiv.org/abs/2308.01406
  19. [19]OpenAI. Sharing AI progress in mathematics. Online announcement, 2026. 6 October 2026; see result 097 in the accompanying catalogue.
  20. [20]Timm Oertel, Joseph Paat, and Robert Weismantel. A colorful Steinitz lemma with application to block-structured integer programs. Mathematical Programming, 204:677–702, 2024.DOI
  21. [21]Klaus F. Roth. On irregularities of distribution. Mathematika, 1(2):73–79, 1954.DOI
  22. [22]Wolfgang M. Schmidt. Irregularities of distribution, VII. Acta Arithmetica, 21(1):45–50, 1972.DOI
  23. [23]Joel Spencer. Balancing games. Journal of Combinatorial Theory, Series B, 23(1):68–74, 1977.DOI
  24. [24]Joel Spencer. Ten Lectures on the Probabilistic Method. Society for Industrial and Applied Mathematics, 2nd edition edition, 1994.
  25. [25]Ernst Steinitz. Bedingt konvergente reihen und konvexe systeme. Journal für die reine und angewandte Mathematik, 143:128–176, 1913.DOI
  26. [26]Robert Tijdeman and Gerold Wagner. A sequence has almost nowhere small discrepancy. Monatshefte für Mathematik, 90(4):315–329, 1980.DOI

Paper details

vlnc:W_cbs49tep
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 0

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

GPT-5.5 (bare), GPT-6 Astra (bare)

View statement
Looking for related papers…
Contents