Coloring Big Graphs with AlphaGoZero
Jiayi Huang Mostofa Patwary Gregory Diamos


Weighted games of best choice
    Brant Jones
    December 30, 2023
=============================




  Recent innovations in deep reinforcement learning have shown promising potential to develop improved heuristics for complex problems.
  Graph coloring, as a well-known NP-hard problem with clear commercial applications, requires specialized knowledge to design well-performed heuristics for different problems.
  In this paper, we adapt AlphaGoZero with graph embedding to learn better heuristics for graph coloring with zero prior knowledge using high performance computing technologies.
  Key to our approach is the introduction of a novel deep neural network architecture (FastColorNet) that has access to the full graph context and requires O(V) time and space to color a graph with V vertices, which enables scaling to very large graphs that arise in many real applications. We show that our approach can effectively learn new state-of-the-art heuristics for graph coloring.

  
We show that recent innovations in deep reinforcement learning can effectively color very large graphs – a well-known NP-hard problem with clear commercial applications. 
Because the Monte Carlo Tree Search with Upper Confidence Bound algorithm used in AlphaGoZero can improve the performance of a given heuristic, our approach allows deep neural networks trained using high performance computing (HPC) technologies to transform computation into improved heuristics with zero prior knowledge. 
    Key to our approach is the introduction of a novel deep neural network architecture (FastColorNet) that has access to the full graph context and requires O(V) time and space to color a graph with V vertices, which enables scaling to very large graphs that arise in real applications like parallel computing, compilers, numerical solvers, and design automation, among others.


As a result, we are able to learn new state of the art heuristics for graph coloring.
  





§ INTRODUCTION




Current approaches for quickly solving NP-hard optimization problems like graph coloring rely on carefully designed heuristics.  These heuristics achieve good general purpose performance, and are fast enough to scale up to very large problems.  However, the best performing heuristic often depend on the problem being solved. Recently, machine learning methods have shown promising potential to develop improved heuristics for specific application domains <cit.>.   

In order to learn strong heuristics for specialized applications of graph coloring, we need training data that includes solutions that outperform existing heuristics.  However, the extremely large search spaces of even single instances of NP-hard problems like graph coloring presents a significant challenge. Recently, deep reinforcement learning algorithms have found recent success in games like Go, Chess, and Shogi <cit.> with very large search spaces.  These algorithms use deep neural networks to store knowledge learned during self-play. They build on this knowledge using search procedures such as Monte Carlo Tree Search (MCTS) with Upper Confidence Bound (UCB), leading to better solutions with more training. Although they require many training steps to achieve good performance, the inexpensive evaluation of solutions to NP-hard problems enables very fast training.  







In this paper we demonstrate our approach by introducing a framework for learning new heuristics using deep reinforcement learning, depicted in Figure <ref>.
A reinforcement learning algorithm is used to extend the performance of the best existing heuristic on a training set of problems.  
Training is still NP-hard, even on a single problem.  However, high performance computing (HPC) systems can devote large scale computation and significant training time to building stronger heuristics.
The best heuristics discovered during training may be distilled into models that are fast to evaluate (e.g. P-TIME, parallel, etc), and stored in a model zoo.  These heuristics could be periodically downloaded into production tools, which would then be capable of quickly finding good solutions to the same problems that were encountered during training.  We seek to address the following question: “how well do learned heuristics generalize, and for which application domains"?





Our results suggest that a similar approach can be successfully applied to other combinatorial optimization problems.
Additionally, our results can be further improved by using even faster training systems to run deep reinforcement learning on larger datasets of representative problems.
The specific contributions of this paper are as follows:

    
  * We introduce a framework for learning fast heuristics using deep reinforcement learning algorithms inspired by AlphaGoZero <cit.> on HPC systems, which is used to learn new graph coloring heuristics that improve the state-of-the-art accuracy by up to 10%
    
  * We demonstrate how to express the graph coloring problem as a Markov Decision Process in and apply the self-play reinforcement learning algorithm in AlphaGoZero to graph coloring.
    
  * We introduce a new highly optimized neural network FastColorNet in Section <ref> that has access to the full graph context, exposes significant parallelism enabling high performance GPU implementations, and can scale up to very large graphs used in production tools, which have many order of magnitude (∼100K) larger search space than Go.

     


    
    
    












§ THE GRAPH COLORING TASK






r0.45
  

  
    
    < g r a p h i c s >
    
    
    < g r a p h i c s >
 

    (a) 4 colors    
    (b) 3 colors 

  
  A slightly-hard-to-color graph <cit.> is colored with greedy heuristics (static-order, sorted-order, and dynamic-sorted-order heuristics) in (a) and colored optimally in (b).



Graph coloring as illustrated in Figure <ref> is one of the core kernels in combinatorial scientific
computing with many practical applications including parallel
computing, VLSI, and pattern matching <cit.>. It assigns colors to the vertices of a given graph G=(V, E) such that no adjacent vertices are of the 
same color. The objective of the graph coloring problem is to 
minimize the number of colors used, and known to NP-hard to solve 
optimally <cit.>. In fact, graph coloring is 
even NP-hard to approximate in specific scenario <cit.>.

Therefore, linear time greedy algorithms are often used in practice, 
which yield near optimal solutions in practice <cit.>. It is worthwhile to mention that the 
order of vertices used in the greedy coloring algorithm plays an
important role on the quality of the solutions <cit.>.


In this paper, we use matrix C to represent the assignment of colors to graph G where C_i,j 
indicates whether a unique color j is assigned to vertex i in G. The above mentioned greedy coloring heuristics
hence progressively update C, each vertex at a time until all vertices in G are 
assigned colors.  









 §.§ Graph Coloring as a Markov Decision Process


In order to apply deep reinforcement learning to the graph coloring problem, we represent graph coloring as a Markov Decision Process (MDP).  Here, C^(t) encodes the MDP state s^(t) at step t.  Recall that C^(t) represents the assignment of colors to vertices at step t.  The set of actions, A_i, is the set of valid colors that may be assigned to the next vertex i at step t.  All actions are deterministic, and the intermediate reward R_a is the negative total number of colors used so far.


Our goal is to learn π_*(s), the optimal policy mapping from state s^(t) to action a_i, and V(s^(t)) the expected reward of s^(t) while following π_*.

It is important to recognize that unlike games of the Go or Chess, graph coloring heuristics need to support diverse graphs, and different graphs imply different MDPs.  




 §.§ A Zero Sum Game of Graph Coloring


One difference between graph coloring and zero sum games like Go and Chess is the reward.  In graph coloring the most obvious choice of reward is the number of colors used.  In games like Chess and Go, the reward is typically win, lose, or in some cases tie.  In these games it is natural for algorithms to exploit self-play, where the best performing learned algorithm plays against itself.

We experiment with a new reward for graph coloring inspired by self-play.  We use the best learned algorithm so far to color the graph.  We define a new reward for any solution with fewer colors to win, any solution with more colors to lose, and any solution with the same number of colors to tie.  We find that this choice simplifies the design of reward scaling and alpha-beta-pruning, although both reward formats are able to achieve comparable results.



 §.§ Is Graph Coloring Harder Than Go?


To put graph coloring in context with other deep reinforcement learning tasks, we estimate the size of the MDPs in terms of number of states for graph coloring as well as Go and Chess by multiplying the average number of moves by the average number of actions per move on a set of graphs.  Table <ref> shows that even moderately sized graphs imply very large MDPs, and the largest graphs imply MDPs that are several order of magnitude larger than Go.  As we will see, these much larger problems present significant scalability challenges in training and inference.
In addition, graph coloring has a unique challenge of state representation for supporting diverse graphs of different sizes and structures compared to Go that has static-dimension board view. 
In this work, we extend the AlphaGoZero approach with scalable graph embedding to address them.





























§ GRAPH COLORING WITH ALPHAGOZERO







  AlphaGoZero used a deep neural network f_θ with parameters θ to map a representation s of the Go board, pieces, and history to move probabilities and a value,(p,v) = f_θ(s).  
p represents the probability of selecting each move, and v is a scalar estimating the probability of the current player winning from position s. 

This network was trained using a self-play reinforcement learning algorithm that uses a search procedure (MCTS with UCB) to extend the performance of the neural network.  
  This approach of self-play with search can be viewed as generating new (better) labels (π, z) for the current state s, which the neural network can then be trained on, resulting in an even stronger neural network.  
This process is then repeated in a policy iteration procedure.  


In this section we show how AlphaGoZero can be adapted and applied to graph coloring.  
We use a deep neural network f_θ with parameters θ to map a representation s of the graph state and coloring history to next-color probabilities and a value, (,v) = f_θ(s).  
p represents the probability of selecting each valid color next, and v is a scalar estimating the probability of finding a better final solution than the current best heuristic from position s.  
We use MCTS+UCB to search for better labels (π, z) as shown in Figure <ref>, which the neural network can then be trained on, resulting in an even stronger neural network.  
This process is then repeated in a policy iteration procedure.  


The two biggest differences between our approach and AlphaGoZero are: i) we need our neural network to find single good solutions to many graphs of different sizes and structures, whereas AlphaGoZero needs to handle different opponents on the same board, and ii) our biggest graphs are much bigger (i.e. up to several order of magnitude) than Go both in terms of number of MDP states and number of moves.  
It was also not obvious to us a-priori what are the appropriate representations of self-play and zero-sum value for graph coloring.  In spite of these challenges, we are able to achieve strong results.







 §.§ Monte Carlo Tree Search




Following the implementation in <cit.>, Monte-Carlo tree search uses the neural network f_θ as a guide.   The search tree stores a prior probability P(s, a), a visit count N(s, a), and a state action-value Q(s, a) at each edge (s, a).  Starting from the root state, the next move is selected that maximizes the upper confidence bound 
Q(s, a) + U(s, a) until a leaf node s_l is reached as shown in the Selection panel of Figure <ref>.  The leaf node s_l is expanded as shown in the Expansion panel of Figure <ref>, and is evaluated by the neural network to compute (P(s_l,*), V(s_l)) = f_θ(s_l), corresponding to the Simulation panel of Figure <ref>. Each edge visited during this process is updated to increment its visit count N(s, a) and set its action-value to the mean value Q(s, a) = (Q(s, a) * N(s, a) + V(s_l))/(N(s, a) + 1).  This is shown in the Backpropagation panel of Figure <ref>.  



 §.§ Upper Confidence Bound


A core issue in reinforcement learning search algorithms is maintaining the balance between the exploitation of moves with high average win rate and the exploration of moves with few simulations.   
We follow the variant of UCB used in <cit.> for computing U(s, a) and handling this tradeoff.




    U(s, a) = c * P(s, a) * √(∑_i=b^MN(s,b)))/1 + N(s, a)




Here M is the number of available actions at the current state, and c is the exploration factor hyperparameter, typically set between 0.1 and 3.0.  
The combined MCTS+UCB algorithm initially focuses on moves with high prior probability and low visit count (exploration), and eventually prefers moves with high Q(s, a) value (exploitation). 




 §.§ Self-Play



To generate labels (π, z) for each move in a new graph G, the graph is first colored by running the neural network of best learned heuristic so far over the entire graph, producing a baseline score χ(G).
MCTS+UCB is then used to color the same graph and produce a comparing score.
The existing search tree along the selected move is reused for the next move and new search probabilities π are computed.
Sampling is used for the first several moves to encourage exploration (controlled by a hyperparameter), then max decoding is used for subsequent moves.  
We use alpha-beta-pruning <cit.> to abort plays early that are clearly won or clearly lost compared to the baseline score χ(G).  
Results from self play are stored as tuples (G, C, π, z), one for each move. The neural network is trained by sampling moves uniformly from a replay buffer <cit.> of the most recent moves.  The replay buffer stores a single copy of the graph for all moves on that graph to save memory.  It also lazily materializes a cache of embeddings for the same reason.  

Games of Go typically end after a few hundred moves, but some of our graphs have millions of nodes.
Running MCTS all the way to the end for each move is not feasible.
Furthermore, given the computational cost of training deep neural networks, it is only feasible to train on about 1 billion moves in a reasonable amount of time, even on high performance clusters of accelerators.
For example, AlphaGoZero trained on a TPU cluster for about 1.4 billion moves. Given graphs with tens of millions of nodes, this would only allow training on about 100 games of self-play.
To scale for very large graphs, we add two additional techniques to the self-play algorithm.

  
  * Limited-Run-Ahead. We restrict the MCTS to a limited number of future moves that is typically set to several hundred.
    To evaluate z, we compare the score of the baseline after run-ahead-limit with the score produced by MCTS.
  
  * Move-Sampling. To generate more diversity of labels, we only choose a subset of all moves sampled uniformly from all moves in all graphs in the training set to apply MCTS and to produce training samples.
    After choosing a move, we run MCTS for several consecutive moves to avoid resetting the search.
    We use a fast (smaller) model to fast-forward to the next sampled move.



Limited-run-ahead. We restrict the MCTS to a limited number of future moves that is typically set to several hundred.
To evaluate z, we compare the score of the baseline after run-ahead-limit with the score produced by MCTS.

Move-sampling. To generate more diversity of labels, we only choose a subset of all moves sampled uniformly from all moves in all graphs in the training set to apply MCTS and to produce training samples.
After choosing a move, we run MCTS for several consecutive moves to avoid resetting the search.
We use a fast (smaller) model to fast-forward to the next sampled move.



In order to handle very large graphs, we add two additional techniques to the self-play algorithm: i) limited-run-ahead, and ii) move-sampling.  

Games of Go typically end after a few hundred moves, but some of our graphs have millions of nodes.  Running MCTS all the way to the end for each move is not feasible.  So we use a limited-run-ahead technique to restrict the MCTS to a limited number of future moves that is typically set to several hundred.  To evaluate z, we compare the score of the baseline after the run-ahead-limit with the score produced by the MCTS.   

Given the computational cost of training deep neural networks, it is only feasible to train on about 1 billion moves in a reasonable amount of time, even on high performance clusters of accelerators.  For example, AlphaGoZero trained on a TPU cluster for about 1.4 billion moves.  Given that some graphs have tens of millions of vertices, this would only allow training on about 100 games of self-play.  To allow for more diversity of labels, we use move-sampling, where we only choose a subset of all moves sampled uniformly from all moves in all graphs in the training set to apply MCTS and to produce training samples.  After choosing a move, we run MCTS for several consecutive moves to avoid resetting the search tree.  We use a faster (smaller) model to fast-forward to the next sampled move.




 §.§ FastColorNet





Heuristics are used in place of exact solvers because they are fast. In order to compete, we need a neural network that can keep up.  This leaves us with the following goals:


  * Scalability.
Fast graph coloring heuristics run in linear O(V) or O(E + V log V) time, enabling scaling to big graphs. For example, some graphs in SuiteSparse have over 10 million vertices.


  * Full Graph Context.
We expect different graphs to require different coloring strategies, so our network needs information about the structure of the graph being colored.


FastColorNet accomplishes both goals by i) using a scalable message passing algorithm for computing node embeddings that can capture the global graph structure, and ii) performing a dynamically sized softmax that assigns a probability of selecting each of the valid colors for the current node.  



The complete FastColorNet architecture is shown in Figure <ref>.  The network takes graph embeddings and a few simple features such as the number of vertices in the graph as inputs. It predicts V, the expected result of coloring the remainder of the graph, and P, a distribution over available colors for the current node.  Note that P is variably sized.  FastColorNet is trained end-to-end from V and P labels to embeddings.  It used stochastic selection of embeddings and an extension of truncated back propagation through time to keep the computational requirement to color each vertex constant for both training and inference.

We note that FastColorNet represents the first architecture that we were able to design that fulfills all of these requirements while being able to consistently fit the V and P labels produced by the MCTS.  We believe that there is room for future work to significantly improve the accuracy of this model with more extensive architecture search.



  §.§.§ Graph Embeddings


R0.5


  0.5
    
  




In order to compute V, information G and C is required.  Simply passing G and C would be prohibitively expensive and be unable to generalize to instances of G and C with different sizes. We provide information to FastColorNet through graph embeddings, which are defined per vertex, and are intended to learn relevant local and global information about G and C.


Designing graph embeddings that capture local and global graph structure is challenging given the large ranges of sizes and structures that must be supported with a fixed size vector <cit.>.  
Our design is inspired by  <cit.>'s work extending message passing algorithms such as loopy belief propagation to graph embeddings.  

Like structure2vec <cit.>, we start from near-zero initialized embeddings and run loopy belief propagation using a learned transfer function 𝒯.  Intuitively, neighboring vertices exchange messages which are processed by transfer function 𝒯.  After enough iterations, this series of messages is likely to converge to a consensus.  
Like <cit.>, we seek to avoid running back propagation through the entire graph each time an embedding is used, and instead take a sampling approach.  Using an analogy of truncated back propagation <cit.> applied to graphs, we apply back propagation only along a random walk ending at each referenced vertex embedding.  

We represent the transfer function 𝒯 as a neural network with weights that are learned using back propagation through the embeddings.  We experimented with several architectures for the 𝒯 and found training to be more stable with an LSTM than the fully connected network in <cit.>.

During inference, we compute embeddings for each vertex by iteratively applying the transfer function to vertices.  This approach naturally allows batching up to the size of the graph, making it extremely compute intensive and suitable for GPU or distributed acceleration. The total amount of computation required can be controlled by the number of iterations.  In our experiments we run for three iterations. The algorithm is described in Algorithm <ref>.








  §.§.§ Inputs and Outputs


FastColorNet predicts (, v) for the next move, and is trained on labels (π, z) from the MCTS.  Recall that V can be one of the following labels (win, tie, lose), and that π has one entry for each valid color that has already been assigned in addition to a label corresponding to allocating a new color. 
The loss is the sum of individual cross entropy losses: 





    L(, , z, v) = ^T log() + z^T log(v)







Graph context shown in the middle of Figure <ref> contains the following one-hot encoded values (the number of vertices in G, the total number of assigned colors, the number of vertices that have already been colored) concatenated with multi-hot encoded set of valid colors for the current vertex.





Problem context shown in the bottom of Figure <ref> contains the embeddings of vertices that have just been colored, and vertices are scheduled to be colored next, in order.  Problem context is zero padded at the beginning and end of the graph.  The number of vertices included in the problem context is a hyperparameter that we typically set to 8 in experiments.




Possible colors context shown in the left of Figure <ref> contains the embeddings of fixed size sets of vertices that have been colored with each of the possible colors.  Possible colors context is zero padded if not enough vertices have been assigned to fill out a complete set for one of the possible colors.  The set size is a hyperparameter that we typically set to 4 in experiments.





  §.§.§ V-Network



r0.4


    < g r a p h i c s >

The V-Network estimates the outcome of the coloring problem from the current state using embedding information about the recently colored nodes as well as information about the graph.




The V network architecture shown in Figure <ref> maps from the graph context and the problem context to the expected outcome of the coloring problem.  The vertex embeddings in the problem context are stored in a sequence corresponding to the order that vertices are colored.  We use a sequence-to-sequence model to exploit locality in this sequence, followed by a pooling operation over the sequence to summarize this information.  We typically use stacks of residual 1-D convolution layers for the sequence-to-sequence model. This local information is then concatenated together with the global graph context and fed into a deep stack of fully connected relu layers with residual connections between each layer.  The result is fed into a softmax, which selects the label from the (win, lose, or tie) outcomes.  







  §.§.§ P-Network


The P-Network architecture is shown in Figure <ref>.  It computes the probability of assigning each of the valid color choices to the current vertex, using the global graph context, the problem context, and local context for each possible color. 
We draw inspiration from pointer-networks <cit.> and represent colors with the embeddings of vertices that have previously been assigned the same colors.  In this analogy, the P-Network selects a pointer to a previously colored node rather than directly predicting a possible color.  However, our approach is different than pointer networks because it considers a set of pointers at a time with the same color rather than a single pointer.  It is also different because it considers a fixed set of possible colors instead of all previously encountered vertices.  These changes are important to exploit locality among nodes with the same color, boosting accuracy, and to bound the computational requirement for very large graphs to linear time in the order of the graph rather than quadratic time for pointer networks.  
In order to support a dynamic number of possible colors, each color is first processed independently, producing an unnormalized score.  This score is then post processed by a sequence-to-sequence model that incorporates dependencies on the other possible colors.  The final scores are normalized by a softmax operation.  







 §.§ High Performance Training System



r0.3



    < g r a p h i c s >

The AI POD architecture, containing up to 300 tightly integrated GPUs with high bandwidth access to training data.




The computational requirements of training our networks on even a single large graph are vast.  In order to perform experiments quickly, we built a highly optimized training system.  The system uses tightly integrated compute nodes composed of commodity off-the-shelf GPUs, high performance networking, and high bandwidth IO system designed to serve training data.  




This system is organized into AI PODs.
Dense compute nodes with 10 1080Ti or 2080Ti GPUs are connected using FDR Infiniband.  A high performance IO node uses an SSD array to serve training data to the compute nodes at up to 7 GB/s.  Collectively the POD can sustain 3.12 single-precision PFLOP/s when running a single large training job.  When configured using 2080Ti GPUs, a single pod can sustain 32.1 mixed-precision PFLOP/s. In total we use up to 300 GPUs for training. 



We use data-parallelism for training on multiple GPUs using synchronous stochastic gradient descent with MPI for communication.  FastColorNet is designed to have high enough compute intensity to enable high GPU efficiency with a small batch size of 1-4 per GPU.  Using the entire AI POD requires a maximum batch size of 1200. The MCTS is completely data-parallel, with each data-parallel worker generating independent samples from different graphs.  Data parallelism is also used within a single GPU for inference to batch model evaluations for different graphs.  












§ EMPIRICAL ANALYSIS OF RESULTS



We applied this reinforcement learning process to train FastColorNet on a diverse set of commonly studied graph coloring problems, including synthetic Erdős–Rényi (ER) <cit.> and Watts–Strogatz (WS) <cit.> (sometimes called small-world) graphs, as well as the SuiteSparse collection <cit.>.  Graph sizes varied from 32 vertices to 10 million vertices.

A single 1080Ti GPU was able to train FastColorNet on about 300,000 mini-batches of 4 moves in one day for a medium size graph with 512 vertices.   We use Adam optimizer for training with a fixed learning rate of 0.001, and did not use learning rate annealing or explicit regularization. We experimented with a variety of architectures for different datasets.  The best performing model architectures are described in the Appendix.





















  














To assess performance over a range of graph sizes, 
Figure <ref> shows how the number of required colors grows with the graph size for the small-world test set

.
FastColorNets in this experiment were trained on similar small-world graphs using the same graph generator parameters.  FastColorNet significantly improves on the best baseline.  









To explore how learning policies improve with more computation in training, Figure <ref> shows the performance improvement of FastColorNet on ER graphs as a function of the number of policy iteration steps.  Performance matches the best heuristic in under 20 steps, and significantly exceeds it in under 100 steps.  

























Table <ref> shows the performance of FastColorNet on test sets of different sizes from different application domains.  Test sets have 20 graphs each, representing 32K-16M moves. 



The FCN-train results show that our reinforcement learning pipeline can find solutions that improve on those found by heuristics by 5%-10%.  

FCN-test shows generalization performance to new graphs from the same domain (e.g. from circuits, linear programming, etc).   Performance is also 1%-2% better than the heuristics, showing the potential to improve performance through domain specialization.  FCN-gen is trained on random graphs. It improves on the unordered heuristic (it itself is unordered), but loses to the other heuristics.  
We expect that there is actually more headroom to further improve these results with more training.  Additionally, SuiteSparse domains actually exhibit a fair amount of diversity, e.g. the circuit category includes circuit layout problems as well as electrical simulation of circuits.





































§ RELATED WORK


Deep RL for Games.




Reinforcement learning has been researched for decades for games <cit.>.

Mnih et al. proposed DQN, a combination of deep neural network and q-learning with experience replay, to achieve human-level performance on Atari games <cit.>.
More recently, Deepmind published a series of AlphaGo algorithms for more complex game Go and defeated human experts <cit.>.
They apply MCTS to explore the large MDP state space while balancing explore and exploit by using UCB for decision selection.
In addition, alpha-beta-pruning <cit.> is also adopted to reduce tree search space.


Our approach for graph coloring takes the similar one of AlphaGoZero.
Furthermore, in order to learn for much bigger problems compared to the relatively small one of Go, we apply other innovations to make our solution scalable and computational efficiently.



RL/ML for Combinatorial Optimization.
Recently, reinforcement learning has been applied for combinatorial optimization.
Bello et al. combined pointer networks <cit.> with actor and critic network to optimize Traveling Salesman Problem (TSP) <cit.>, which does not make good use of graph structure and is not generalized to arbitrary size graphs. 
In <cit.>, a Q-learning framework is introduced for greedy algorithms to learn over MVC, MAXCUT and TSP problems using structure2vec <cit.> graph embedding.
This algorithm cannot be directly applied to graph coloring since the reward design and state representation for colored graphs is non trivial in its problem formulation.
Both algorithms only evaluated on small graphs and are not scalable to big graphs, which are typical in real applications.
In contrast, our approach is easy to scale to train on bigger graphs to solve bigger problems.




Graph Coloring.
Graph coloring are being studied for several decades due to its usefulness in many practical applications, including linear algebra,
parallel computing, resource assignment and register allocation 
<cit.>. Graph coloring problem is known as NP-Hard and so its approximation is <cit.>. 
Heuristics are therefore been used widely, which includes greedy
algorithms, finding independent sets, local search and population
based algorithms <cit.>. An in-depth 
experimental study has been presented in <cit.>,
which demonstrated that greedy coloring algorithm with
appropriate vertex ordering gives close to optimal coloring
in reasonable time on wide range of applications. In this paper,
we used the implementation of <cit.> 
when comparing our reinforcement based technique. 
Several variations of graph coloring (e.g. 
star and acyclic coloring) and heuristics algorithms are 
studied in 
<cit.>.







§ CONCLUSIONS


Our results demonstrate that deep reinforcement learning can be applied to large scale problems of clear commercial importance: such as the well-known graph coloring problem.
The MCTS+UCB algorithm used in AlphaGoZero defeated state of the art heuristics by a large margin.
The learned heuristics generalized to new graphs in the same application domain, and are fast enough to color very large graphs.







thebibliography[1]
  #1
    
    


  


unsrt

  




§ APPENDIX







 §.§ Dataset


We use both synthetic random graphs and real-world graphs in our study.
We generate random graphs using both Erdos–Rényi (ER) and Watts-Strogatz (WS) models.
We implemented a random graph generator using ER model to generate graphs for training with edge probability of 0.5.
For WS graphs, also called small-world graphs, we set average degree K to be 4 and rewiring probability β to 0.5. 
For real-world graphs, we take them from SuiteSparse.









 §.§ Embedding Features












Diverse types of embedding are used for learning the global and local graph structures, as well as the current state of the coloring progress.
We use multiple one-hot encoding and a multi-hot encoding for capturing the current node information and the current coloring situation.
These features are fed into the embedding network listed in Algorithm <ref> to learn and produce the node embeddings. Details of the embedding setting are listed in Table <ref>.



 §.§ Hyperparameters


Our configuration performed well across tasks.  The resnet stack in the V-Network in Figure <ref> included 3 layers with hidden dimensions of 512 units.  The resnet stack in the P-Network in Figure <ref> included 5 layers with hidden dimsions of 512 units.  Batch normalization was used between all residual layers.  The layers labeled seq2seq in are implemented with stacks of Conv1D with residual connections and batch normalization between all layers.  The number of Conv1D layers for all seq2seq operations includes 3 layers with 128 channels each and a filter size of 7.   We did not use regularization in any experiment.  We used the ADAM optimizer with a learning rate of between 0.0001 and 0.001.









 §.§ Baseline Graph Coloring Heuristics


We implemented several well known graph coloring heuristics <cit.> for comparison.
When a vertex is selected for coloring, a valid color with smallest color ID is assigned to it.
The difference among these heuristics is the vertex order for coloring, described as follow:
r0.35
  

  


    < g r a p h i c s >


The AI POD architecture.

  

  



  
  * Static-Ordered (Unordered): This heuristic colors the vertices in the order of the node ID without any sorting.
  
  * Sorted-Ordered (Ordered): We first sort the vertices from largest degree to smallest degree, then color the node with the sorted order.
  
  * Dynamic-Sorted-Ordered (Dynamic-Ordered): In this heuristic, the order of vertices for coloring is based on the dynamic degree. Initially, a vertex's dynamic degree is same as its degree. At any time, a uncolored vertex with the largest dynamic degree is selected for coloring, then all is neighbors' dynamic degrees decrease by one.




 §.§ AI POD System


Figure <ref> shows the system configuration of the high-performance AI PODs we use in the training task.
It contains up to 300 tightly integrated GPUs with high bandwidth access to training data.






