
1 Introduction
Discrepancy is a fundamental notion in combinatorics and theoretical computer science. The dis-
crepancy of a real matrix A∈Rm×nwith respect to a “coloring” vector x∈ {±1}nis defined
as
disc(A, x) := kAxk∞= max
j∈[m]|(Ax)j|.
This is a natural generalization of the classic combinatorial notion of discrepancy of set-systems,
corresponding to binary matrices A∈ {0,1}m×nwhere rows represent (the indicator vector of)
msets over a ground set of [n] elements, and the goal is to find a coloring x∈ {±1}nwhich is
as “balanced” as possible simultaneously on all sets , i.e., to find disc(A) = minx∈{±1}nkAxk∞.
Discrepancy minimization has various applications in combinatorics, computational geometry, de-
randomization, rounding of integer linear programming and approximation algorithms for NP-hard
problems [Cha00], and has been studied for decades in math and TCS ([Mat99]). Most of the his-
tory of this problem was focused on the existential question of understanding the minimum possible
discrepancy achievable for various classes of matrices. For general set-systems of size n(arbitrary
n×nbinary matrices A), Spencer’s classic result [Spe85] states that disc(A)≤6√n, which is
asymptotically better than random coloring (Θ(√nlog n). More recent works have focused on re-
stricted matrix families, such as geometric matrices [Lar23] and sparse matrices ([Ban98,BF81]),
showing that it is possible to achieve o(√n) discrepancy in these restricted cases. For example, the
minimum-discrepancy coloring of k-sparse binary matrices (sparse set-systems) turn out to have
discrepancy at most O(√klog n) [Ban98].
All of these results, however, are non-constructive—they only argue about the existence of
low-discrepancy colorings—which prevents their use in algorithmic applications that rely on low-
discrepancy (partial) coloring, such as bin-packing problems [Rot13,HR17].1Indeed, the question
of efficiently finding a low-discrepancy coloring, i.e., computing disc(A), was less understood until
recently, and is more nuanced: Charikar, Newman and Nikolov [CNN11] showed it is NP-hard
to distinguish whether a matrix has disc(A) = 0 or disc(A) = Ω(√n), suggesting that (ω(1))
approximation is inevitable to achieve fast runtimes. The celebrated work of Bansal [Ban10] gave
the first polynomial-time algorithm which achieves an additive O(√n)-approximation to the optimal
coloring of general n×nmatrices, matching Spencer’s non-constructive result. Bansal’s algorithm
has approximation guarantees in terms of the hereditary discrepancy [LSV86], denoted herdisc(A),
which is the maximum discrepancy of any submatrix A0of Aobtained by deleting a subset of the
columns of A(equivalently, deleting a subset of the elements in the ground-set [n]). More formally,
Bansal [Ban10] gave an SDP-based algorithm that finds a coloring exsatisfying
disc(A, ex) = O(log(n)·herdisc(A)),
for any real matrix A, in time e
O(mn4.5) assuming state-of-art SDP solvers [JKL+20,HJS+22]. In
other words, if all submatrices of Ahave low-discrepancy colorings, then it is in fact possible (yet
still quite expensive) to find an almost-matching overall coloring.
Building on Bansal’s work, Lovett and Meka [LM15] designed a simpler algorithm for set-
systems (binary matrices A), running in e
O((n+m)3) time. The main new idea of their algorithm,
which is also central to our work, was a subroutine for repeatedly finding a partial-coloring via
random-walks (a.k.a Edge-Walk), which in every iteration “rounds” a constant-fraction of the
1If we don’t have a polynomial constructive algorithm, then we can’t approximate solution for bin packing in
polynomial. This is common in many problems (in integer programming) where we first relax it to linear programming
and then rounding it back to an integer solution.
3