Are Graph Neural Networks Optimal Approximation Algorithms?

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

TL;DR

This paper demonstrates that Graph Neural Networks (GNNs) aren't just powerful heuristics—they can actually capture the most potent polynomial-time approximation algorithms known to science. By parameterizing semidefinite programming (SDP) solvers into a new architecture called OptGNN, the authors prove that GNNs can achieve optimal worst-case approximation guarantees for a broad class of problems, assuming the truth of the Unique Games Conjecture.

What Problem Does This Paper Address?

Combinatorial Optimization (CO)—finding the best solution from a finite set of possibilities—is the backbone of everything from logistics to drug discovery. However, most interesting CO problems (like Max-Cut or Max-3-SAT) are NP-hard, meaning we can't solve them exactly in a reasonable timeframe for large inputs.

Researchers typically choose between two paths:

  1. Classical Approximation Algorithms: These use heavy math like Semidefinite Programming (SDP) to provide provable "worst-case" guarantees, but they are often slow and don't "learn" from previous problems.
  2. Neural CO: GNNs are trained to solve these problems quickly by learning patterns in data, but they often lack theoretical guarantees and can fail on "hard" instances.

The authors ask a fundamental question: Can we design a GNN architecture that is both efficient and theoretically optimal?

Methods

The authors bridge the gap between deep learning and optimization theory by showing that Projected Gradient Descent (PGD) on a specific type of SDP relaxation is mathematically equivalent to a message-passing algorithm.

The OptGNN Architecture

Instead of using a standard GNN (like a GCN or GAT), the authors designed OptGNN. Its layers are built to emulate the gradient updates of an SDP solver.

  • Message Passing as Optimization: In OptGNN, each node's embedding represents a fractional solution. The "messages" passed between nodes are derived from the gradient of a penalized Lagrangian objective.
  • Learnable Weights: Unlike a fixed mathematical solver, OptGNN uses learnable weight matrices ($M_t$) at each layer. This allows the model to adapt its optimization strategy to the specific distribution of graphs it sees during training.
  • Unsupervised Training: The model is trained by minimizing the penalized SDP objective directly, meaning it doesn't need "ground truth" labels (which are expensive to compute).
  • Rounding: At inference time, the continuous node embeddings are converted into discrete (0/1) solutions using randomized hyperplane rounding.
Figure 1: Schematic representation of OptGNN. During train- ing, OptGNN produces node embeddings v using message passing updates on the graph G. These embeddings are used to compute the penalized objective Lp(v; G). OptGNN is trained by minimizing the average loss over the training set. At inference time, the fractional solutions (embeddings) v for an input graph G produced by OptGNN are rounded us- ing randomized rounding.

Datasets

The authors evaluated OptGNN across a massive range of benchmarks:

  • Synthetic Graphs: Erdős-Rényi, Barabási-Albert, and Watts-Strogatz models.
  • Hard Instances: "Forced RB" instances, which are specifically designed to be difficult for Vertex Cover solvers.
  • Real-World Data: The TU-dataset collection (including ENZYMES, PROTEINS, and COLLAB) and REDDIT social network graphs.
  • Classic Benchmarks: The GSET benchmark for Max-Cut.

Key Insights and Ideas

  • The UGC Connection: The Unique Games Conjecture (UGC) is a famous hypothesis in complexity theory. It implies that for many problems, SDP-based algorithms provide the best possible approximation ratio achievable in polynomial time. By proving a GNN can represent these algorithms, the authors establish a "theoretical ceiling" for GNN performance.
  • Overparameterization Helps: The authors found that making the message-passing steps "learnable" (overparameterizing the gradient descent) allows the GNN to outperform the very algorithms it was designed to emulate.
  • Neural Certificates: Because OptGNN is rooted in SDP theory, the authors developed a way to extract "dual certificates" from the learned embeddings. This provides a provable lower bound on how good the optimal solution could possibly be, a feature missing from most neural CO methods.

Key Results

OptGNN consistently matched or outperformed both classical heuristics and state-of-the-art neural baselines across Max-Cut, Min-Vertex-Cover, and Max-3-SAT.

  • Max-Cut: OptGNN significantly outperformed greedy algorithms and was competitive with the industry-standard solver Gurobi, while being much faster on large graphs.
Table 1: Performance of OptGNN, Greedy, and Gurobi 0.1s, 1s, and 8s on Maximum Cut. For each approach and dataset, we report the average cut size measured on the test slice. Here, higher score is better. In parentheses, we include the average runtime in milliseconds for OptGNN.
  • Max-3-SAT: OptGNN outperformed other neural baselines like ErdosGNN and was significantly better than directly applying Autograd to the SDP objective, proving that the GNN architecture itself provides a superior optimization landscape.
Table 2: Average number of unsatisfied clauses for Max-3-SAT on random instances with N = 100 variables and clause ratios r = 4.00, 4.15, 4.30. Standard deviation of the ratio over the test set is reported in superscript. In parentheses, we report the average time per instance on the test set in seconds.
  • Generalization: A model trained on small Erdős-Rényi graphs performed remarkably well on large, real-world social network graphs, suggesting it learns a general optimization principle rather than just memorizing patterns.

Limitations and Future Work

  • Rounding Limitations: While the GNN produces excellent fractional solutions (embeddings), the final performance is still tied to the quality of the rounding procedure. The authors suggest that designing "neural rounding" could be a fruitful next step.
  • Rank vs. Efficiency: The theoretical optimality holds when the embedding dimension is large (proportional to the number of nodes), but in practice, researchers use much smaller dimensions for speed. Exploring this trade-off further is necessary.
  • Integration: The authors envision OptGNN being used as a "warm-start" or a heuristic provider inside exact solvers like Gurobi to speed up global search.

Summary updated

BibTeX
@inproceedings{yau2024are,
  author = {Morris Yau and Nikolaos Karalias and Eric 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