Discrepancy Minimization in Input-Sparsity Time

Yichuan Deng, Xiaoyu Li, Zhao Song, Omri Weinstein

Introduction

Discrepancy theory is a cornerstone of combinatorics and theoretical computer science. Imagine you have a collection of sets over a group of elements, and you want to color each element either red (+1) or blue (-1) such that every set is as "balanced" as possible. Mathematically, for a matrix $A$, the goal is to find a coloring vector $x \in \{-1, 1\}^n$ that minimizes the discrepancy: $\text{disc}(A, x) := \|Ax\|_\infty$.

While low-discrepancy colorings are known to exist (e.g., Spencer's famous result showing $\text{disc}(A) \leq 6\sqrt{n}$ for $n \times n$ binary matrices), finding them efficiently is notoriously difficult. Early algorithms relied on slow Semidefinite Programming (SDP). Recent breakthroughs introduced faster combinatorial methods, but a computational gap remained: could we find these colorings in "input-sparsity time"—time proportional to the number of non-zero entries in the matrix? This is especially critical for "tall" matrices (where the number of sets $m$ is much larger than the number of elements $n$) and sparse data common in real-world machine learning applications.

This paper introduces the first input-sparsity time algorithm for discrepancy minimization on real-valued matrices. By combining randomized sketching with a novel "lazy" data structure, the authors achieve a significant speedup over previous state-of-the-art methods, breaking the cubic time barrier for square matrices while maintaining strong theoretical guarantees.

Core Methods

The authors build upon the "Edge-Walk" framework, which finds a coloring by performing a random walk in a subspace that keeps the discrepancy low. Their primary contribution is overcoming the computational bottlenecks of this process through two key techniques:

1. Implicit Leverage-Score Sampling

To keep the random walk "safe," previous algorithms needed to compute projections onto subspaces, a step that typically takes $O(mn^2)$ time. The authors use randomized sketching (specifically Johnson-Lindenstrauss transforms) to estimate row norms and identify "heavy" rows without full computation. They develop a way to sample rows based on "leverage scores" implicitly, allowing them to find a good projection matrix in time nearly linear to the number of non-zeros in $A$.

Sketching technique to reduce the time cost of computing row norms.

2. "Lazy" Data Structure for Edge-Walk

The iterative nature of the coloring process usually hits a computational wall known as the Online Matrix-Vector (OMv) conjecture, which suggests a cubic ($n^3$) time bottleneck for updating projections step-by-step. The authors circumvent this by designing a "guess-and-correct" data structure. They batch the random Gaussian steps of the walk and apply low-rank corrections only when necessary, effectively amortizing the cost of updates.

Key Insights and Results

A major insight of this work is the robustness of the discrepancy algorithm to noise. Exact row norms or an exact Singular Value Decomposition (SVD) are not strictly necessary to maintain the coloring's quality; approximate sketching is "good enough" to stay within the required theoretical bounds. Furthermore, by observing that the random vectors used in the walk are independent of the changing subspace, the authors found they could pre-compute batches of projections and "fix" them later with low-rank updates.

Flowchart comparing Larsen's original algorithm (a) with the proposed fast version (b).

These optimizations yield impressive theoretical and empirical results:

  • Theoretical Speedup: The algorithm achieves a runtime of $\tilde{O}(\text{nnz}(A) + n^{2.53})$ using Fast Matrix Multiplication (FMM), or a purely combinatorial $\tilde{O}(\text{nnz}(A) + n^3)$. This is a major improvement over the previous best of $\tilde{O}(mn^2 + n^3)$.
  • Empirical Performance: Evaluated on synthetic benchmarks (Uniform, 2D corner, and 2D halfspace matrices), the new algorithm demonstrated substantial real-world gains. On $10,000 \times 1,000$ matrices, it was roughly 6 times faster than the state-of-the-art combinatorial approach (Larsen, 2023), reducing runtime from ~375 seconds to ~62 seconds.
  • Quality Preservation: Despite the massive speedup from sketching and lazy updates, the resulting discrepancy (objective value) remained very close to previous, slower methods.

Limitations and Future Directions

While the $n^{2.53}$ runtime is theoretically superior, Fast Matrix Multiplication often carries large constant factors that can make it slower than $n^3$ approaches for smaller, practical matrix sizes. Additionally, the approximation ratio is slightly weaker (by logarithmic factors) than the original, much slower SDP-based algorithms.

Looking forward, the authors suggest that these "lazy" data structures and implicit sampling techniques could be adapted for other problems in combinatorial optimization, or extended to handle data in streaming and distributed environments.

Summary updated

BibTeX
@inproceedings{deng2025discrepancy,
  author = {Yichuan Deng and Xiaoyu Li and Zhao Song and OMRI WEINSTEIN},
  title = {{Discrepancy Minimization in Input-Sparsity Time}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=TmJvacopmV},
}
Figure