arXiv · 2602.12667
Efficient Streaming Algorithms for Two-Dimensional Congruence Testing and Congruence Hashing
Abstract
Geometric congruence asks whether two point multisets are identical up to translation and rotation, while congruence hashing seeks compact encodings that support efficient congruence queries. We study these problems in the streaming model under finite-precision rational inputs, where each coordinate is $p/q$ with $|p|,|q|\le U$. Our main results are two randomized polylogarithmic-space algorithms for 2D congruence identification (CI), which additionally requires outputting a valid transformation when congruent. With probability at least $1-\delta$, our 3-pass product-anchor algorithm uses $O((\log n+\log U+\log \frac{1}{\delta})\log\log n\log \frac{1}{\delta})$ space in the turnstile model, while our 3-pass complex-moment algorithm uses $O(\log n(\log n+\log U+\log \frac{1}{\delta}))$ space in the insertion-only model. Using CI as a building block, we obtain a 4-pass insertion-only congruence hashing algorithm over $m$ query sets using $O(m(\log n+\log U+\log m+\log \frac{1}{\delta}))$ space and producing signatures of length $O(\log \frac{1}{\delta}+\log U+\log m)$. Both algorithms presample primes for modular hashing to handle precision. The former algorithm uses finite-field embeddings and number-theoretic guarantees to recover rotations, and the latter hinges on a new non-vanishing complex moment criterion, thus avoiding additional number-theoretic conditions and the classical vanishing-moment obstacle. For the hardness results, we prove that any $p$-pass randomized streaming algorithm for 2D CI with error at most $\delta$ requires $\Omega(\frac{1}{p}(\log n+\log U+\log \frac{1}{\delta}))$ space, matching the turnstile upper bound up to a $\log\log n$ factor. Moreover, approximate CI requires $\text{poly}(n)$ space even with $\text{poly}(n)$ passes. This sharply contrasts with the RAM model, where both exact and approximate versions are solvable in polynomial time.
Explore related subjects
Keep this discovery
Yen-Cheng Chang, Tsun Ming Cheung, Meng-Tsung Tsai, Ting-An Wu. 2026-02-13. Efficient Streaming Algorithms for Two-Dimensional Congruence Testing and Congruence Hashing. https://arxiv.org/abs/2602.12667
Cite the original work for its findings. Save a collection to share your selection of sources.