Table of Contents
Fetching ...

Neural Algorithmic Reasoning for Approximate $k$-Coloring with Recursive Warm Starts

Knut Vanderbush, Melanie Weber

TL;DR

The paper tackles approximate $k$-coloring on graphs, a relaxation of the NP-hard problem of determining $oxed{oldsymbol{oldsymbol{oldsymbol{oldsymbol{oldsymbol{oldsymbol{oldsymbol{oldsymbol{oldsymbol{oxed{ ext{χ}(G)}}}}}}}}}}$, by learning differentiable algorithms with graph neural networks. Building on PI-GCN, it introduces orthogonal initial embeddings and a degree-weighted loss to emphasize dense regions, and augments the approach with recursive warm starts via lightweight greedy methods, yielding Full-GCN, Mod-GCN, and Triple-Color variants. Empirical results show that recursive warm starts substantially improve performance, with Triple-Color excelling on small graphs and Full-GCN scaling better to graphs with $n oughly 1000$; nevertheless, the approach faces limits on highly structured graphs and oversmoothing in dense regimes. The work demonstrates the value of algorithmic alignment for ML-based combinatorial optimization and provides scalable techniques and open-source code that can inform both practical coloring tasks and broader graph-optimization problems.

Abstract

Node coloring is the task of assigning colors to the nodes of a graph such that no two adjacent nodes have the same color, while using as few colors as possible. It is the most widely studied instance of graph coloring and of central importance in graph theory; major results include the Four Color Theorem and work on the Hadwiger-Nelson Problem. As an abstraction of classical combinatorial optimization tasks, such as scheduling and resource allocation, it is also rich in practical applications. Here, we focus on a relaxed version, approximate $k$-coloring, which is the task of assigning at most $k$ colors to the nodes of a graph such that the number of edges whose vertices have the same color is approximately minimized. While classical approaches leverage mathematical programming or SAT solvers, recent studies have explored the use of machine learning. We follow this route and explore the use of graph neural networks (GNNs) for node coloring. We first present an optimized differentiable algorithm that improves a prior approach by Schuetz et al. with orthogonal node feature initialization and a loss function that penalizes conflicting edges more heavily when their endpoints have higher degree; the latter inspired by the classical result that a graph is $k$-colorable if and only if its $k$-core is $k$-colorable. Next, we introduce a lightweight greedy local search algorithm and show that it may be improved by recursively computing a $(k-1)$-coloring to use as a warm start. We then show that applying such recursive warm starts to the GNN approach leads to further improvements. Numerical experiments on a range of different graph structures show that while the local search algorithms perform best on small inputs, the GNN exhibits superior performance at scale. The recursive warm start may be of independent interest beyond graph coloring for local search methods for combinatorial optimization.

Neural Algorithmic Reasoning for Approximate $k$-Coloring with Recursive Warm Starts

TL;DR

The paper tackles approximate -coloring on graphs, a relaxation of the NP-hard problem of determining , by learning differentiable algorithms with graph neural networks. Building on PI-GCN, it introduces orthogonal initial embeddings and a degree-weighted loss to emphasize dense regions, and augments the approach with recursive warm starts via lightweight greedy methods, yielding Full-GCN, Mod-GCN, and Triple-Color variants. Empirical results show that recursive warm starts substantially improve performance, with Triple-Color excelling on small graphs and Full-GCN scaling better to graphs with ; nevertheless, the approach faces limits on highly structured graphs and oversmoothing in dense regimes. The work demonstrates the value of algorithmic alignment for ML-based combinatorial optimization and provides scalable techniques and open-source code that can inform both practical coloring tasks and broader graph-optimization problems.

Abstract

Node coloring is the task of assigning colors to the nodes of a graph such that no two adjacent nodes have the same color, while using as few colors as possible. It is the most widely studied instance of graph coloring and of central importance in graph theory; major results include the Four Color Theorem and work on the Hadwiger-Nelson Problem. As an abstraction of classical combinatorial optimization tasks, such as scheduling and resource allocation, it is also rich in practical applications. Here, we focus on a relaxed version, approximate -coloring, which is the task of assigning at most colors to the nodes of a graph such that the number of edges whose vertices have the same color is approximately minimized. While classical approaches leverage mathematical programming or SAT solvers, recent studies have explored the use of machine learning. We follow this route and explore the use of graph neural networks (GNNs) for node coloring. We first present an optimized differentiable algorithm that improves a prior approach by Schuetz et al. with orthogonal node feature initialization and a loss function that penalizes conflicting edges more heavily when their endpoints have higher degree; the latter inspired by the classical result that a graph is -colorable if and only if its -core is -colorable. Next, we introduce a lightweight greedy local search algorithm and show that it may be improved by recursively computing a -coloring to use as a warm start. We then show that applying such recursive warm starts to the GNN approach leads to further improvements. Numerical experiments on a range of different graph structures show that while the local search algorithms perform best on small inputs, the GNN exhibits superior performance at scale. The recursive warm start may be of independent interest beyond graph coloring for local search methods for combinatorial optimization.
Paper Structure (30 sections, 2 theorems, 27 equations, 10 figures)

This paper contains 30 sections, 2 theorems, 27 equations, 10 figures.

Key Result

Proposition 1

For $d\in(0,\infty)$, let $k_d$ be the smallest positive integer $k$ such that $2k\log(k)>d$. If $p=d/(n-1)$, then $\mathbb{P}(\chi(G(n,p))\in\{k_d,k_d+1\})\rightarrow1$ as $n\rightarrow\infty$.

Figures (10)

  • Figure 1: Suppose we want a proper $4$-coloring of this graph. In the first coloring, each endpoint of the monochromatic edge has degree $4$ and has every color among its neighbors. Therefore, the monochromatic edge cannot be resolved by changing any individual vertex's color. In the second coloring, one endpoint of the monochromatic edge has degree $2$, so we can easily obtain a proper coloring by changing the color of that vertex to blue or yellow. Therefore, it would be wise to incentivize the optimizer to prioritize the second coloring over the first, since it is easier to find a solution from the second coloring. With the original loss function, however, the optimizer does not prioritize either of these colorings over the other.
  • Figure 2: Average loss of hard colorings produced by Mod-GCN, Full-GCN, and Triple-Color on $100$ Erdős-Rényi graphs. Each error bar represents an approximate 95% confidence interval for the true mean. Linear regressions based on the data for $n\in\{110,120,\dots,200\}$ are shown. Every point has an error bar, but some error bars are so small that they are obscured by the point.
  • Figure 3: Average loss of hard colorings produced by Discrete-Color and Full-Color on $1000$ Erdős-Rényi graphs. Each error bar represents an approximate 95% confidence interval for the true mean. Linear regressions based on the data for $n\in\{110,120,\dots,200\}$ are shown. Every point has an error bar, but most error bars are so small that they are obscured by the point.
  • Figure 4: Predicted expected loss of Mod-GCN, Full-GCN, and Triple-Color for $n\in\{500,1000,5000,10000\}$ based on linear regressions on data for $n\in\{110,120,\dots,200\}$ compared to actual average loss. Values in bold are the best among the three algorithms.
  • Figure 5: Performance of coloring algorithms on test graphs in schuetz. In the first table, the final five columns record the loss of the best hard coloring of each graph found by each algorithm, while the column "$k$" records the number of colors used, which is also the true chromatic number of each graph. In the second table, the final four columns record the best upper bound on each graph's chromatic number found by each algorithm; that is, the minimum number of colors for which each algorithm found a proper coloring. According to qudit, the values from schuetz are obtained by running each algorithm $100$ times and taking the best result, so the values from our algorithms are obtained in the same way. Values in bold are the best value in their group of columns. *Different from what was reported in schuetz. For jean, we use a version with three vertices of degree $0$ removed. For cora, citeseer, and pubmed, we convert the original directed graph to an undirected graph, turning double edges in the original graph into a single edge, hence the smaller edge count. **Not recorded due to runtime constraints.
  • ...and 5 more figures

Theorems & Definitions (4)

  • Proposition 1
  • proof
  • Proposition 2
  • proof