Practical Deterministic Linear-Time Modular Subset Sum
Phuoc Dinh Le, Kha Le
Key points
From the paper's conclusion- We give a deterministic algorithm for exact modular subset sum that, for every modulus m, computes all reachable residues and one requested witness in O(m) time and O(m) auxiliary words.
Abstract
We give a deterministic algorithm for exact modular subset sum that, for every modulus m, computes all reachable residues and one requested witness in O(m) time and O(m) auxiliary words. The input is a compact list of distinct residues with multiplicities, and the word-RAM supports constant-time modular arithmetic. The algorithm represents reachable residues as intervals along cycles of repeated addition, charging work on partial cycles to newly reached residues. Processing prime factors in increasing order keeps the cost of rebuilding and changing cycles linear. A classical theorem on subset sums of distinct invertible residues bounds the number of boundary lists by O(m^(3/4)); together they contain O(m) interval endpoints. Comparison sorting the short lists and radix sorting the long ones then takes O(m) total time. The algorithm is fast in practice, using arrays and interval lists rather than heavy data structures.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- Subset Sum in Almost-Linear TimearXiv · 2026
- Subset Sum and Integer Programming Feasibility Test in Near-Optimal TimearXiv · 2026
- Computing bounded solutions to linear Diophantine equations with the sum of divisorsarXiv · 2026
- On Deterministically Finding an Element of High Order Modulo a CompositeACM Transactions on Algorithms · 2026
- Pigeonhole Equal Subset Sum: Subexponential Algorithm, Tight Lower Bounds, and Average-Case AnalysisarXiv · 2026
- Subset Sum via Partial MatcharXiv · 2026