Homomorphic Hashing for Sparse Coefficient Extraction

Petteri Kaski, Mikko Koivisto, Jesper Nederlof

Introduction

In the field of exact algorithms for NP-hard problems, researchers have traditionally faced a stark trade-off between time efficiency and memory consumption. This paper introduces "homomorphic hashing," a novel algorithmic framework that bridges two powerful but previously distinct paradigms: Dynamic Programming (DP) and Coefficient Extraction. By "hashing down" complex algebraic circuits into smaller domains, the authors provide a method to solve problems like Subset Sum and SAT with the space efficiency of coefficient extraction and the sparsity-exploiting speed of dynamic programming.

The Sparsity-Space Trade-off

To understand the significance of this work, one must consider the two standard approaches to NP-hard problems:

  1. Dynamic Programming (DP): These algorithms excel at exploiting sparsity. If a problem instance has few "partial solutions," DP with memoization only stores those specific entries, leading to faster execution. However, DP is notoriously memory-hungry, often requiring exponential space, and is difficult to parallelize effectively.
  2. Coefficient Extraction: This technique treats a problem as finding a specific coefficient within a large polynomial or algebraic structure. These methods are highly space-efficient (often requiring only polynomial space) and are naturally parallelizable. Their primary drawback is that they are "sparsity-blind"; they run at the same speed regardless of whether the problem instance has two solutions or two billion.

The authors' goal is to achieve the "best of both worlds": an algorithm that remains space-efficient and parallelizable while running in time proportional to the number of actual solutions.

Methodology: Homomorphic Hashing

The core innovation of this research is the systematic application of Homomorphic Hashing. In algebra, a homomorphism is a map between two structures (such as rings or fields) that preserves operations like addition and multiplication. The authors leverage this property through a four-step strategy:

  1. Circuit Representation: The problem is represented as an algebraic circuit where the final output is the solution (the coefficient to be extracted).
  2. Hashing the Input: A homomorphic hash function is applied to the input gates of the circuit, mapping the large algebraic domain into a significantly smaller one.
  3. Homomorphic Evaluation: Because the hash is homomorphic, evaluating the circuit within this smaller domain produces the hash of the original result.
  4. Collision Management: If the original problem is sparse—meaning most coefficients are zero—the probability of different solutions colliding in the hashed domain is low. This allows the algorithm to extract the correct answer using minimal time and memory.

The paper demonstrates the versatility of this technique across three distinct algebraic domains: Univariate Polynomials (for Subset Sum), Group Algebras (for Linear SAT), and Möbius Algebras (for Set Partition and CNF-SAT).

Key Insights and Technical Contributions

Circuit Transformation

A primary insight of the paper is that one should not merely hash the data, but the entire computation. By transforming the circuit, the entire workload is moved into a lower-dimensional space where computation is significantly cheaper.

Sparsity as a Resource

Traditionally, the bottleneck in coefficient extraction was the domain size (e.g., the target value $t$ in a Subset Sum problem). This paper reframes the bottleneck as the number of distinct reachable sums ($S$). This shift allows the algorithm to treat sparsity as a computational resource to be exploited rather than an incidental property.

The Solomon Algebra

For problems involving sets, such as Set Partition, the authors introduce a sophisticated hashing technique that maps the Möbius algebra of a subset lattice to the "Solomon algebra" of a poset. This represents the paper’s most significant technical contribution to algebraic complexity.

Results and Complexity Bounds

The authors establish new complexity bounds for several classic problems:

  • Subset Sum: The proposed algorithm runs in $O^*(S)$ expected time (where $S$ is the number of distinct sums) using only polynomial space. This is a major improvement over standard sparse DP, which requires $O(S)$ space.
  • Linear SAT: The authors achieve a polynomial-space algorithm that runs in $O^*(2^{rk(A)})$ time, where $rk(A)$ is the rank of the constraint matrix.
  • CNF-SAT: The paper shows that SAT can be solved in time proportional to the number of "prefix projections" ($P$). Specifically, it achieves $O^*(P^2)$ time and $O^*(P)$ space, providing a formal framework for solving structurally sparse SAT instances.

Limitations and Future Work

While the results are mathematically robust, the authors note several limitations. The algorithms are randomized and carry a small probability of error, though this can be mitigated through repetition. Furthermore, the performance gains are strictly dependent on the sparsity of the instance; for "dense" instances where partial solutions are abundant, these algorithms offer no speedup over existing methods. Finally, while the CNF-SAT results are theoretically significant, identifying specific classes of real-world SAT instances with small numbers of projections remains an open area for future empirical research.

Summary updated

BibTeX
@inproceedings{kaski2012homomorphic,
  author = {Petteri Kaski and Mikko Koivisto and Jesper Nederlof},
  title = {{Homomorphic Hashing for Sparse Coefficient Extraction}},
  booktitle = {IPEC},
  year = {2012},
  doi = {10.1007/978-3-642-33293-7\_15},
}
Figure