Are Graph Neural Networks Optimal Approximation Algorithms?

Morris Yau, Nikolaos Karalias, Eric Hanqing Lu, Jessica Xu, Stefanie Jegelka

Graph Neural Networks (GNNs) have recently surged in popularity as tools for solving complex Combinatorial Optimization (CO) problems. However, they are often treated as "black-box" heuristics, lacking the rigorous theoretical guarantees of traditional mathematical solvers. This paper bridges that gap, proving that GNNs are not just powerful heuristics—they can theoretically represent the most powerful known polynomial-time approximation algorithms for a massive class of hard problems.

To demonstrate this, the authors introduce OptGNN, a model that learns to solve CO problems in an unsupervised manner, matching or beating traditional solvers while operating significantly faster.

The Challenge of Combinatorial Optimization

Combinatorial Optimization involves finding the best solution from a finite set of possibilities, such as partitioning a network (Max-Cut) or satisfying logical formulas (Max-SAT). Because most of these problems are NP-hard, finding perfect answers quickly is generally considered impossible.

Instead, researchers rely on approximation algorithms. The gold standard for these is Semidefinite Programming (SDP), which provides strong theoretical guarantees on how close an answer is to the true optimum. The central question of this paper is whether GNNs can actually capture these theoretically optimal, SDP-based algorithms.

OptGNN: Bridging GNNs and SDPs

The authors introduce OptGNN, an architecture explicitly designed to mimic the mathematical structure of SDP solvers.

  • Algorithmic Alignment: The researchers demonstrate that the iterative steps of a specific type of SDP solver (the Burer-Monteiro method) mathematically resemble message-passing updates in a GNN. By parameterizing these updates, they create a GNN that learns the optimal way to solve a problem for a specific data distribution.
  • Unsupervised Training: OptGNN does not require a dataset of pre-computed "correct" answers, which are notoriously hard to generate for NP-hard problems. Instead, it trains by minimizing a penalized Lagrangian loss—a mathematical score reflecting how well the current solution satisfies the problem's constraints.
  • Neural Certification: A standout feature of OptGNN is its ability to generate "certificates"—provable lower bounds on the optimal solution—directly from its learned embeddings. This provides users with a clear measure of how much room for improvement remains.
Schematic representation of OptGNN training and inference.

Theoretical Breakthrough: UGC-Optimality

A major contribution of this work is theoretical. Assuming the Unique Games Conjecture (UGC)—a landmark hypothesis in computational complexity—is true, the authors prove that GNNs can represent the best possible polynomial-time algorithms for Maximum Constraint Satisfaction Problems (Max-CSPs).

Furthermore, the authors found that overparameterization acts as an effective optimizer. OptGNN performs better than simply running a standard mathematical optimizer on the same objective, as the extra "neural" parameters help the model navigate complex optimization landscapes more effectively.

Empirical Performance

The researchers evaluated OptGNN on a mix of synthetic graphs (Erdos-Rényi, Barabási-Albert) and real-world benchmarks (ENZYMES, COLLAB, REDDIT), focusing on landmark problems like Maximum Cut and Max-3-SAT.

Maximum Cut: OptGNN consistently outperformed greedy heuristics and proved highly competitive with Gurobi, a top-tier commercial solver. On many datasets, OptGNN achieved cut sizes within 1% of the best-known values, often matching Gurobi's 1.0-second performance in a fraction of the time.

Performance of OptGNN vs. Greedy and Gurobi on Maximum Cut.

Max-3-SAT: When tested on randomly generated logical formulae, OptGNN significantly outperformed other neural baselines and low-rank SDP solvers in minimizing the number of unsatisfied logical clauses.

Generalization: Remarkably, a model trained on one type of graph (e.g., social networks) performed exceptionally well when tested on entirely different graph structures (e.g., biological molecules). This suggests OptGNN captures fundamental optimization principles rather than merely memorizing dataset-specific patterns.

Limitations and Future Directions

While OptGNN represents a significant step forward, the authors note a few areas for future exploration:

  • Embedding Dimensions: The theoretical proofs require the embedding dimension to scale with the number of nodes, but in practice, much smaller, fixed dimensions work well. Bridging this gap between theory and empirical success remains an open question.
  • Rounding Procedures: The current method for turning "soft" continuous neural outputs into "hard" discrete decisions is relatively simple. Learning the rounding procedure itself could yield further improvements.
  • Hybrid Solvers: Integrating OptGNN into exact solver frameworks, like "Branch and Bound," is a highly promising direction. The GNN could provide fast, high-quality bounds to drastically speed up exact solvers.

Summary updated

BibTeX
@inproceedings{yau2024are,
  author = {Morris Yau and Nikolaos Karalias and Eric Hanqing Lu and Jessica Xu and Stefanie Jegelka},
  title = {{Are Graph Neural Networks Optimal Approximation Algorithms?}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=SxRblm9aMs},
}
Figure