Consider the geometric range space where and is the set of ranges defined by -dimensional halfspaces. In this setting we consider that is the disjoint union of a red and blue set. For each halfspace define a function that measures the "difference" between the fraction of red and fraction of blue points which fall in the range . In this context the maximum discrepancy problem is to find the . We aim to instead find an such that . This is the central problem in linear classification for machine learning, in spatial scan statistics for spatial anomaly detection, and shows up in many other areas. We provide a solution for this problem in time, which improves polynomially over the previous best solutions. For we show that this is nearly tight through conditional lower bounds. For different classes of we can either provide a time lower bound for the exact solution with a reduction to APSP, or an lower bound for the approximate solution with a reduction to 3SUM. A key technical result is a -approximate halfspace range counting data structure of size with query time, which we can build in time.
View on arXiv