Table of Contents
Fetching ...

Graph Neural Networks as Ordering Heuristics for Parallel Graph Coloring

Kenneth Langedal, Fredrik Manne

TL;DR

This paper addresses the graph coloring problem, an NP-hard task, by replacing traditional vertex ordering heuristics with a GraphSAGE-based GNN that outputs vertex priorities for greedy coloring. The authors propose a two-stage training regime—supervised imitation of existing orderings and a genetic optimization step—to achieve competitive coloring quality while delivering favorable runtimes on multicore hardware, including graphs with over $10^9$ edges. Results show that a 2-layer GNN can outperform classic orderings in quality while running between their execution times, and deeper GNNs further improve color efficiency, with strong parallel scalability demonstrated on large instances. A tailored C-GNN implementation enables runtime performance that rivals fast heuristics, indicating a practical path for integrating ML-based orderings into parallel graph coloring pipelines and opening avenues for further improvements via deeper networks and broader training regimes.

Abstract

The graph coloring problem asks for an assignment of the minimum number of distinct colors to vertices in an undirected graph with the constraint that no pair of adjacent vertices share the same color. The problem is a thoroughly studied NP-hard combinatorial problem with several real-world applications. As such, a number of greedy heuristics have been suggested that strike a good balance between coloring quality, execution time, and also parallel scalability. In this work, we introduce a graph neural network (GNN) based ordering heuristic and demonstrate that it outperforms existing greedy ordering heuristics both on quality and performance. Previous results have demonstrated that GNNs can produce high-quality colorings but at the expense of excessive running time. The current paper is the first that brings the execution time down to compete with existing greedy heuristics. Our GNN model is trained using both supervised and unsupervised techniques. The experimental results show that a 2-layer GNN model can achieve execution times between the largest degree first (LF) and smallest degree last (SL) ordering heuristics while outperforming both on coloring quality. Increasing the number of layers improves the coloring quality further, and it is only at four layers that SL becomes faster than the GNN. Finally, our GNN-based coloring heuristic achieves superior scaling in the parallel setting compared to both SL and LF.

Graph Neural Networks as Ordering Heuristics for Parallel Graph Coloring

TL;DR

This paper addresses the graph coloring problem, an NP-hard task, by replacing traditional vertex ordering heuristics with a GraphSAGE-based GNN that outputs vertex priorities for greedy coloring. The authors propose a two-stage training regime—supervised imitation of existing orderings and a genetic optimization step—to achieve competitive coloring quality while delivering favorable runtimes on multicore hardware, including graphs with over edges. Results show that a 2-layer GNN can outperform classic orderings in quality while running between their execution times, and deeper GNNs further improve color efficiency, with strong parallel scalability demonstrated on large instances. A tailored C-GNN implementation enables runtime performance that rivals fast heuristics, indicating a practical path for integrating ML-based orderings into parallel graph coloring pipelines and opening avenues for further improvements via deeper networks and broader training regimes.

Abstract

The graph coloring problem asks for an assignment of the minimum number of distinct colors to vertices in an undirected graph with the constraint that no pair of adjacent vertices share the same color. The problem is a thoroughly studied NP-hard combinatorial problem with several real-world applications. As such, a number of greedy heuristics have been suggested that strike a good balance between coloring quality, execution time, and also parallel scalability. In this work, we introduce a graph neural network (GNN) based ordering heuristic and demonstrate that it outperforms existing greedy ordering heuristics both on quality and performance. Previous results have demonstrated that GNNs can produce high-quality colorings but at the expense of excessive running time. The current paper is the first that brings the execution time down to compete with existing greedy heuristics. Our GNN model is trained using both supervised and unsupervised techniques. The experimental results show that a 2-layer GNN model can achieve execution times between the largest degree first (LF) and smallest degree last (SL) ordering heuristics while outperforming both on coloring quality. Increasing the number of layers improves the coloring quality further, and it is only at four layers that SL becomes faster than the GNN. Finally, our GNN-based coloring heuristic achieves superior scaling in the parallel setting compared to both SL and LF.
Paper Structure (15 sections, 1 equation, 5 figures, 4 tables, 2 algorithms)

This paper contains 15 sections, 1 equation, 5 figures, 4 tables, 2 algorithms.

Figures (5)

  • Figure 1: Supervised training results with a varying number of layers. The top three plots show loss, F1-scores, and coloring quality for labels generated with the SL heuristic. Similarly, the bottom three plots shows the same for labels generated with the SD heuristic. The coloring plots also includes dashed lines indicating how many colors LF and SL used.
  • Figure 2: Performance profile for the entire dataset. The y-axis shows the fraction of instances solved using no more than $k$ additional colors compared to the best solution, where $k$ increases along the x-axis. At $k=0$, the value corresponds to the fraction of instances where the heuristic found the best solution. The number after GNN represents the number of layers in the model.
  • Figure 3: Accumulated results for all validation instances. The top figure shows results for sequential runs and the bottom for parallel ones. The parallel runs use parallel ordering and JP, using the whole machine. The x-y coordinates correspond to the total number of colors and time used by each algorithm. The number after GNN represents the number of layers in the model. Note that the number of colors used is the same regardless of whether the sequential or parallel version is used and that the axes are cropped and do not start from zero.
  • Figure 4: Performance profile for the entire dataset including repeated application of Culberson. Each heuristic includes a C version that represents the original coloring followed by five iterations of Culberson. The y-axis shows the fraction of instances solved using no more than $k$ additional colors compared to the best solution, where $k$ increases along the x-axis. The number after GNN represents the number of layers in the model.
  • Figure 5: Accumulated results for all validation instances using repeated application of Culberson with the parallel implementation. The x-y coordinates correspond to the total number of colors and time used. Subsequent marks of the same type, from left to right, correspond to repeated colorings. The number after GNN represents the number of layers in the model. Notice that the y-axis is cropped and does not start from zero.