Abstract
Constraint Satisfaction Problems (CSPs) lie at the heart of complexity theory and find application in a plethora of prominent tasks ranging from cryptography to genetics. Classical approaches use Hopfield networks to find approximate solutions while recently, modern machine-learning techniques like graph neural networks have become popular for this task. In this study, we employ the known mapping of MAX-2-SAT, a class of CSPs, to a spin-glass system from statistical physics, and use Glauber dynamics to approximately find its ground state, which corresponds to the optimal solution of the underlying problem. We show that Glauber dynamics outperforms the traditional Hopfield-network approach and can compete with state-of-the-art solvers. A systematic theoretical analysis uncovers the role of stochastic fluctuations in finding CSP solutions: even in the absence of thermal fluctuations at $T=0$ a significant portion of spins, which correspond to the CSP variables, attains an effective spin-dependent non-zero temperature. These spins form a subspace in which the stochastic Glauber dynamics continuously performs flips to eventually find better solutions. This is possible since the energy is degenerate, such that spin flips in this free-spin space do not require energy. Our theoretical analysis leads to deterministic solvers that effectively account for such fluctuations, thereby reaching state-of-the-art performance.
1. Introduction
Constraint Satisfaction Problems (CSPs), such as MAX-K-SAT, are NP-hard optimization problems foundational to computer science, cryptography, and logistics. A classic physics-based approach maps the CSP to an Ising model where the ground state (lowest energy) corresponds to the optimal solution. Traditionally, continuous Hopfield networks are used to find this ground state. However, Hopfield networks rely on a "mean-field" approximation—they track the average state of the spins but ignore their random fluctuations. Consequently, in the rough, complex energy landscapes typical of CSPs, these deterministic solvers easily get trapped in sub-optimal local minima. This study investigates whether systematically including statistical fluctuations can yield superior physics-inspired CSP solvers.
2. Methods
We map MAX-2-SAT instances to an Ising model and simulate Glauber dynamics—a stochastic process where spins flip based on local magnetic fields and temperature. To understand the efficacy of this approach, we perform a systematic cumulant expansion of the master equation governing the system, resulting in three deterministic solvers:
- Mean-Field (G-mf): Tracks only the mean magnetization (mathematically equivalent to traditional Hopfield networks).
- Variance Solver (G-var): Tracks mean and individual spin variances, accounting for local fluctuations.
- Covariance Solver (G-cov): Tracks mean, variance, and pairwise correlations between spins.
These solvers were evaluated on synthetic random MAX-2-SAT instances across varying clause densities ($\alpha = M/N$).
3. Results and Discussion
3.1 Performance and Energy Dynamics
Simulated Glauber dynamics (G-sim) and the derived variance/covariance solvers significantly outperform traditional Hopfield networks. As shown in Figure 1, Glauber-based methods reach lower energy states (fewer violated constraints, $N_{vc}$) more effectively than the mean-field approach across various clause densities.
3.2 The Role of Free Spins at $T=0$
A critical insight of this work is that fluctuation-aware solvers perform optimally at absolute zero temperature ($T=0$). Unlike mean-field solvers, which require artificial intermediate temperatures to avoid premature freezing, the variance and covariance solvers leverage "free spins." These are variables experiencing a net-zero local field due to the high degeneracy of the MAX-2-SAT energy landscape.
As illustrated in Figure 3, these free spins continue to flip even at $T=0$, allowing the system to navigate flat energy plateaus and eventually find pathways to lower energy states. The variance solver (G-var) effectively captures this "free spin" dynamics deterministically, matching the performance of full stochastic simulations.
3.3 Benchmarking against State-of-the-Art
The proposed solvers match or slightly outperform modern approximate solvers, including quantum-inspired mean-field algorithms (MF-AOA), Semidefinite Programming (SDP-skew), and Graph Neural Networks (RUN-CSP). For large-scale instances ($N=400$), these physics-inspired methods drastically outperform traditional heuristics like WalkSAT.
4. Conclusion
By incorporating beyond-mean-field fluctuations, we have developed deterministic solvers that effectively navigate the degenerate landscapes of CSPs. These methods achieve state-of-the-art performance, particularly at $T=0$, by leveraging inherent problem symmetries. Future work will extend these principles to $K \geq 3$-SAT and explore the use of covariance information for targeted cluster updates.
Summary updated