A Faster Closest-Point Algorithm for the An* Lattices
Abstract
The dual root lattice An* is an important lattice in quantization, coding, and estimation. It can be represented as the projection of the integer lattice Zn+1 onto the n-dimensional hyperplane whose coordinates sum to zero. This representation makes An* particularly natural for quantizing simplex-constrained data, such as histograms and probability distributions. This paper studies the closest-point problem for An*: given a query vector y, find the lattice point x∈ An* minimizing \|y-x\|2. The fastest previously known method is the linear-time algorithm of McKilliam, Clarkson, Smith, and Quinn (MCSQ), which employs bucket sort as a core operation. We present a faster linear-time algorithm. The key observation is that the closest-point objective depends on the rounding residuals only through two prefix aggregates: a count and a residual sum. Hence the elements inside each bucket never need to be sorted, stored, or traversed. This replaces the linked-list traversal and pointer chasing of MCSQ with a single bucketing pass over two flat arrays with counting-sort-style accumulates. A scaled objective further makes most of the computation exact integer arithmetic, and when the input coordinates are rationals with a common denominator, for example, histograms or empirical distibutions, the entire algorithm becomes exact and integer-only. Experiments on an Intel Core i9-13900H show speedups of about 1.8× to 3.0× over MCSQ for n=2,…,100, with larger gains at higher dimensions. The proposed algorithm is also noticeably faster than Conway and Sloan methods for other root lattices, including An, Dn*, and E8. An open-source implementation is available in the "fanstar" project.
Turn this paper into a full lesson
ArcXiv compiles a staged curriculum from this paper: 8-12 lessons across beginner → advanced, synthesised section guides, visuals, flashcards, a quiz, exercises, and on-demand deep dives per section. Grounded in the abstract, never invented.