Searcharxiv⌕ Search

arXiv · 2609.30992

Practical Deterministic Linear-Time Modular Subset Sum

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.

Explore related subjects

Keep this discovery

Explore connections, maps & timelines

BibTeXRIS

Phuoc Dinh Le, Kha Le. 2026-09-25. Practical Deterministic Linear-Time Modular Subset Sum. https://arxiv.org/abs/2609.30992

Cite the original work for its findings. Save a collection to share your selection of sources.

KEEP EXPLORING

Related papers

Computational complexity of the recoverable robust shortest path problem in acyclic digraphs under interval budgeted uncertainty

In this paper, we consider the recoverable robust shortest path problem in acyclic digraphs, employing interval budgeted uncertainty to model uncertain second-stage costs. For the continuous budgeted uncertainty model, we prove that the problem is strongly NP-hard even in layered digraphs. Furthermore, we show that in general acyclic digraphs, the problem cannot be approximated within any constant factor unless $\mathrm{P} = \mathrm{NP}$, nor can it be approximated within a factor of $2^{\log^{1-ε} n}$ for any $ε> 0$ unless $\mathrm{NP} \subseteq \mathrm{DTIME}(n^{\mathrm{poly} \log n})$. For the discrete budgeted uncertainty model, we show that the problem is not approximable unless $\mathrm{P} = \mathrm{NP}$, even in layered digraphs. Finally, we establish that under continuous budgeted uncertainty, the integrality gap of a relaxation allowing a fractional first-stage solution is at least $Ω(\sqrt{n})$.

cs.DS↗

Odd and Even Harder Problems on Cycle-Factors

For a graph (undirected or directed), a cycle-factor is a collection of vertex-disjoint cycles covering the entire vertex set. Cycle-factors subject to parity constraints arise naturally in the study of structural graph theory and algorithmic complexity. In this work, we study four variants of the problem of finding a cycle-factor subject to the following parity constraints: (1) all cycles are odd, (2) all cycles are even, (3) at least one cycle is odd, and (4) at least one cycle is even. We show that all the variants of the problem are NP-complete both in undirected and directed graphs, even if each vertex is incident to at most three edges. We also prove that the first two variants are NP-complete even for planar directed graphs.

cs.DS↗

An $n^{8/5+o(1)}$-Time $Ω(λ^3)$-Approximation for Longest Common Subsequence

Let $λ$ denote the ratio of the length of a longest common subsequence of two length-$n$ strings to $n$. Rubinstein, Seddighin, Song and Sun [RSSS19] gave an $Ω(λ^3)$-approximation for LCS running in $\widetilde O(n^{39/20})$ time, where $39/20=1.95$. Song [Son19] mentioned that improving the $n^{1.95}$ running time is an interesting open question. We give an algorithm that computes an $Ω(λ^3)$-approximation of the longest common subsequence in $n^{8/5+o(1)}$ time. This improves the exponent $1.95$ to $1.6+o(1)$.

cs.DS↗