Efficient Graph Coloring with Neural Networks: A Physics-Inspired Approach for Large Graphs
Lorenzo Colantonio, Andrea Cacioppo, Federico Scarpati, Stefano Giagu
TL;DR
This work tackles the NP-hard graph coloring problem by introducing a physics-inspired graph neural network that optimizes a differentiable Potts-energy objective. By training on Erdos–Rényi graphs and quiet-planting with known colorings, the model learns to minimize conflicts and break color-symmetry via an overlap term, then iteratively colors graphs with a noise-scheduled forward pass. Empirical results show favorable energy scaling and faster convergence than simulated annealing across a broad range of connectivities, and the approach scales to very large graphs on GPUs while preserving performance. The combination of a differentiable energy objective, planted supervision, and parallelizable GNNs demonstrates a promising route to scalable, high-quality graph coloring in practical settings.
Abstract
The graph coloring problem is an optimization problem involving the assignment of one of q colors to each vertex of a graph such that no two adjacent vertices share the same color. This problem is NP-hard and arises in various practical applications. In this work, we present a novel algorithm that leverages graph neural networks to tackle the problem efficiently, particularly for large graphs. We propose a physics-inspired approach that leverages tools used in statistical mechanics to improve the training and performance of the algorithm. The scaling of our method is evaluated for different connectivities and graph sizes. Finally, we demonstrate the effectiveness of our method on a dataset of Erdos-Renyi graphs, showing its applicability also in hard-to-solve connectivity regions where traditional methods struggle.
