Table of Contents
Fetching ...

Beyond Worst-Case Subset Sum: An Adaptive, Structure-Aware Solver with Sub-$2^{n/2}$ Enumeration

Jesus Salas

TL;DR

This work reframes Subset Sum through the lens of the effective search space U, the number of distinct subset sums, and develops a deterministic, structure-aware solver that enumerates unique sums via a novel enumerator. It combines a double meet-in-the-middle strategy with Controlled Aliasing to guarantee sub-^{n/2} worst-case bounds, while maintaining anytime/online capabilities and strong practical performance on structured inputs. The approach is validated by theoretical claims (runtime bounds parameterized by U) and extensive empirical results showing dramatic speedups when additive structure (low doubling, high additive energy, duplicates, progressions) constrains U. The framework offers a unified, adaptable blueprint for solving NP-hard problems by targeting problem structure and enabling incremental, resilience-enabled computation, with potential extensions to Knapsack and related domains.

Abstract

The Subset Sum problem, which asks whether a set of $n$ integers has a subset summing to a target $t$, is a fundamental NP-complete problem in cryptography and combinatorial optimization. The classical meet-in-the-middle (MIM) algorithm of Horowitz--Sahni runs in $\mathcal{O}^*(2^{n/2})$, which remains the best-known deterministic bound. Yet in practice, many instances exhibit abundant collisions in partial sums, so the true difficulty is often governed by $U = |Σ(S)|$, the number of unique subset sums. We present a structure-aware, adaptive solver that enumerates only the distinct subset sums, pruning duplicates on the fly and achieving deterministic runtime $\mathcal{O}(U \cdot n^2)$ and expected randomized runtime $\mathcal{O}(U \cdot n)$. Its core is a canonical unique-subset-sums enumerator combined with a double meet-in-the-middle strategy, supporting anytime and online modes. To ensure worst-case gains even on unstructured inputs, we introduce a Controlled Aliasing technique that provably reduces the enumeration space by a fixed constant factor. This yields a guaranteed global runtime of $\mathcal{O}^*(2^{n/2 - \varepsilon})$ for some $\varepsilon > 0$, strictly improving upon classical bounds. Empirical results show that the solver adapts efficiently to structured inputs with low entropy (e.g., instances with small doubling constants, duplicates, or additive progressions) often approaching near-dynamic programming performance. We conclude by outlining how this adaptive framework can be extended to other NP-complete problems.

Beyond Worst-Case Subset Sum: An Adaptive, Structure-Aware Solver with Sub-$2^{n/2}$ Enumeration

TL;DR

This work reframes Subset Sum through the lens of the effective search space U, the number of distinct subset sums, and develops a deterministic, structure-aware solver that enumerates unique sums via a novel enumerator. It combines a double meet-in-the-middle strategy with Controlled Aliasing to guarantee sub-^{n/2} worst-case bounds, while maintaining anytime/online capabilities and strong practical performance on structured inputs. The approach is validated by theoretical claims (runtime bounds parameterized by U) and extensive empirical results showing dramatic speedups when additive structure (low doubling, high additive energy, duplicates, progressions) constrains U. The framework offers a unified, adaptable blueprint for solving NP-hard problems by targeting problem structure and enabling incremental, resilience-enabled computation, with potential extensions to Knapsack and related domains.

Abstract

The Subset Sum problem, which asks whether a set of integers has a subset summing to a target , is a fundamental NP-complete problem in cryptography and combinatorial optimization. The classical meet-in-the-middle (MIM) algorithm of Horowitz--Sahni runs in , which remains the best-known deterministic bound. Yet in practice, many instances exhibit abundant collisions in partial sums, so the true difficulty is often governed by , the number of unique subset sums. We present a structure-aware, adaptive solver that enumerates only the distinct subset sums, pruning duplicates on the fly and achieving deterministic runtime and expected randomized runtime . Its core is a canonical unique-subset-sums enumerator combined with a double meet-in-the-middle strategy, supporting anytime and online modes. To ensure worst-case gains even on unstructured inputs, we introduce a Controlled Aliasing technique that provably reduces the enumeration space by a fixed constant factor. This yields a guaranteed global runtime of for some , strictly improving upon classical bounds. Empirical results show that the solver adapts efficiently to structured inputs with low entropy (e.g., instances with small doubling constants, duplicates, or additive progressions) often approaching near-dynamic programming performance. We conclude by outlining how this adaptive framework can be extended to other NP-complete problems.

Paper Structure

This paper contains 48 sections, 2 theorems, 28 equations, 7 figures, 4 tables, 4 algorithms.

Key Result

Theorem 6

Let $\mathcal{E}$ be the enumerator described above, which expands partial solutions one element at a time, and resolves duplicate sums by storing the lexicographically minimal canonical subset representation. Then:

Figures (7)

  • Figure 1: Counts of $k$-subsets enumerated per column expansion (input $n=48$).
  • Figure 2: Run-time graphs for $n=48$ with optimization enabled. The left panel shows the most computationally expensive column expansion in each cycle, while the right panel illustrates the number of subsets enumerated in each cycle.
  • Figure 3: Anytime run-time graphs for input instances of lengths 32, 40, 48, and 56.
  • Figure 4: Counts of $k$-subsets enumerated per column expansion for a (input $n=48$) input instance with elements of varying bit-length from w=32 to w=20 decreasing in steps of 4 bits.
  • Figure 5: Counts of $k$-subsets enumerated per column expansion (input $n = 100$ with $w = 16, 20, 24$).
  • ...and 2 more figures

Theorems & Definitions (8)

  • Definition 1: Subset Sum Problem
  • Definition 2: Asymptotic Notation
  • Definition 3: Density
  • Definition 4: $k$-Permutations and $k$-Subsets
  • Definition 5: Enumeration Tree Topology
  • Remark
  • Theorem 6: Enumerator Correctness
  • Lemma 7: Complement Trick for Half-Enumeration