# One Model, Any CSP: Graph Neural Networks as Fast Global Search Heuristics for Constraint Satisfaction

Source: [One Model, Any CSP: Graph Neural Networks as Fast Global Search Heuristics for Constraint Satisfaction](<https://www.sota2.com/research/paper/68fa6d4e1e209131cea38fb5>)

Collection index: [llms.txt](<https://www.sota2.com/research/llms.txt>)

Data updated: 2025-10-26T00:30:35.914Z

Authors: Jan T\\"onshoff, Berke Kisin, Jakob Lindner, Martin Grohe

Published: 2022-08-22T12:09:19.000Z

## Abstract

We propose a universal Graph Neural Network architecture which can be trained as an end-2-end search heuristic for any Constraint Satisfaction Problem (CSP). Our architecture can be trained unsupervised with policy gradient descent to generate problem specific heuristics for any CSP in a purely data driven manner. The approach is based on a novel graph representation for CSPs that is both generic and compact and enables us to process every possible CSP instance with one GNN, regardless of constraint arity, relations or domain size. Unlike previous RL-based methods, we operate on a global search action space and allow our GNN to modify any number of variables in every step of the stochastic search. This enables our method to properly leverage the inherent parallelism of GNNs. We perform a thorough empirical evaluation where we learn heuristics for well known and important CSPs from random data, including graph coloring, MaxCut, 3-SAT and MAX-k-SAT. Our approach outperforms prior approaches for neural combinatorial optimization by a substantial margin. It can compete with, and even improve upon, conventional search heuristics on test instances that are several orders of magnitude larger and structurally more complex than those seen during training.

## Recorded benchmark results

A research result applies to its stated dataset, split, metric and evaluation configuration. Compare like-for-like settings, preserve the metric's unit and direction, and distinguish paper-reported results from independent reproduction. The best result recorded here is not a claim of exhaustive, current global coverage.

- [MaxCut on GSET (\|V\|=800)](<https://www.sota2.com/research/sota/maxcut-on-gset-v-800.md>): MaxCut; GSET (\|V\|=800); Average Gap to Best Known Cut: 1.22.

- [MaxCut on GSET (\|V\|=1K)](<https://www.sota2.com/research/sota/maxcut-on-gset-v-1k.md>): MaxCut; GSET (\|V\|=1K); Average Gap to Best Known Cut: 2.44.

- [MaxCut on GSET (\|V\|\>=3K)](<https://www.sota2.com/research/sota/maxcut-on-gset-v-3k.md>): MaxCut; GSET (\|V\|\>=3K); Average Gap to Best Known Cut: 51.63.

- [MaxCut on GSET (\|V\|=2K)](<https://www.sota2.com/research/sota/maxcut-on-gset-v-2k.md>): MaxCut; GSET \|V\|=2K; Average Gap to Best Known Cut: 13.11.

- [Graph Coloring on Graph-Coloring-5 n=50 (test)](<https://www.sota2.com/research/sota/graph-coloring-on-graph-coloring-5-n-50-test.md>): Graph Coloring; Graph-Coloring-5 n=50 (test); Instance Solved Rate: 79.17.

- [Graph Coloring on Graph-Coloring-5 n=100 (OOD)](<https://www.sota2.com/research/sota/graph-coloring-on-graph-coloring-5-n-100-ood.md>): Graph Coloring; Graph-Coloring-5 n=100 (OOD); Instance Solved (%): 34.83.

- [Graph Coloring on Graph-Coloring-10 n=100 (test)](<https://www.sota2.com/research/sota/graph-coloring-on-graph-coloring-10-n-100-test.md>): Graph Coloring; Graph-Coloring-10 n=100 (test); Instance Solved Percentage: 0.

- [Graph-Coloring on Graph-Coloring-10 OOD n=200](<https://www.sota2.com/research/sota/graph-coloring-on-graph-coloring-10-ood-n-200.md>): Graph Coloring; Graph-Coloring-10 OOD n=200; Instance Solved Rate: 0.

- [Graph Coloring on Graph Coloring 5 Colors n=50](<https://www.sota2.com/research/sota/graph-coloring-on-graph-coloring-5-colors-n-50.md>): Graph Coloring; Graph Coloring 5 Colors n=50; Solved Instances Rate: 79.17.

- [Graph Coloring 5 Colors, n=100](<https://www.sota2.com/research/sota/graph-coloring-5-colors-n-100.md>): Graph Coloring; Graph Coloring 5 Colors, n=100; Success Rate: 34.83.

- [Graph Coloring on Graph Coloring 10 Colors, n=100](<https://www.sota2.com/research/sota/graph-coloring-on-graph-coloring-10-colors-n-100.md>): Graph Coloring; Graph Coloring 10 Colors, n=100; Success Rate: 0.

- [Graph Coloring on Graph Coloring 10 Colors, n=200](<https://www.sota2.com/research/sota/graph-coloring-on-graph-coloring-10-colors-n-200.md>): Graph Coloring; Graph Coloring 10 Colors, n=200; Success Rate: 0.

## Original sources and implementation

[Original paper](<https://arxiv.org/abs/2208.10227>)

[PDF](<https://arxiv.org/pdf/2208.10227.pdf>)
