paper

Recovery Beats Storage: Improved Space for Preprocessed 3SUM

arXiv:2608.22355

Abstract

The 3SUM problem asks, given sets of integers, whether there exist and whose sum belongs to . In the preprocessed variant with unknown , one preprocesses sets and , each of size , and subsequently answers a query specified by subsets , and a target set of size , by solving the 3SUM instance . Kirkpatrick, Kuszmaul, Mathialagan, and Vassilevska Williams [ICALP 2026] gave the first algorithm with subquadratic space for this problem, achieving query time using space, for every . Their algorithm employs separate mechanisms for heavy and light targets, and for each heavy target it stores explicitly the list of pairs whose sum is congruent to it modulo a random prime but differs from it. These lists dominate the space bound. We present a unified construction that uses a single mechanism for all queries. Instead of storing these lists of pairs, our algorithm recovers on demand the residue class of the target modulo a random prime by inverting the function . Additionally, instead of storing the heavy targets, it recomputes at query time a set that covers them. This leads to an improved space bound of , while maintaining the same query time. Moreover, our construction is the first to achieve subquadratic space while supporting adaptively chosen queries.

arXiv comment18 pages, 4 figures