DSatur

DSatur is a graph colouring algorithm put forward by Daniel Brélaz in 1979. Similarly to the greedy colouring algorithm, DSatur colours the vertices of a graph one after another, adding a previously unused colour when needed. Once a new vertex has been coloured, the algorithm determines which of the remaining uncoloured vertices has the highest number of colours in its neighbourhood and colours this vertex next. Brélaz defines this number as the degree of saturation of a given vertex. The contraction of the term "degree of saturation" forms the name of the algorithm. DSatur is a heuristic graph colouring algorithm, yet produces exact results for bipartite, cycle, and wheel graphs. DSatur has also been referred to as saturation LF in the literature.

Pseudocode
Let the "degree of saturation" of a vertex be the number of different colours being used by its neighbors. Given a simple, undirected graph $$G$$ compromising a vertex set $$V$$ and edge set $$E$$, the algorithm assigns colors to all of the vertices using color labels $$1,2,3,...$$. The algorithm operates as follows:


 * 1) Let $$v$$ be the uncolored vertex in $$G$$ with the highest degree of saturation. In cases of ties, choose the vertex among these with the largest degree in the subgraph induced by the uncolored vertices.
 * 2) Assign $$v$$ to the lowest color label not being used by any of its neighbors.
 * 3) If all vertices have been colored, then end; otherwise return to Step 1.

Step 2 of this algorithm assigns colors to vertices using the same scheme as the greedy colouring algorithm. The main differences between the two approaches arises in Step 1 above, where vertices seen to be the most "constrained" are coloured first.

Example
Consider the graph $$G=(V,E)$$ shown on the right. This is a wheel graph and will therefore be optimally colored by the DSatur algorithm. Executing the algorithm results in the vertices being selected and colored as follows. (In this example, where ties occur in both of DSatur's heuristics, the vertex with lowest lexicographic labelling among these is chosen.)


 * 1) 	Vertex $$g$$ (color 1)
 * 2) 	Vertex $$a$$ (color 2)
 * 3) 	Vertex $$b$$ (color 3)
 * 4) 	Vertex $$c$$ (color 2)
 * 5) 	Vertex $$d$$ (color 3)
 * 6) 	Vertex $$e$$ (color 2)
 * 7) 	Vertex $$f$$ (color 3)

This gives the final three-colored solution $$\mathcal{S} = \{\{g\}, \{a, c, e\}, \{b, d, f\}\}$$.

Performance
The worst-case complexity of DSatur is $$O(n^2)$$, where $$n$$ is the number of vertices in the graph. This is because the process of selecting the next vertex to colour takes $$O(n)$$ time, and this process is carried out $$n$$ times. The algorithm can also be implemented using a binary heap to store saturation degrees, operating in $$O((n+m)\log n)$$, or $$O(m+n\log n)$$ using Fibonacci heap, where $$m$$ is the number of edges in the graph. This produces much faster runs with sparse graphs.

DSatur is known to be exact for bipartite graphs, as well as for cycle and wheel graphs. In an empirical comparison by Lewis in 2021, DSatur produced significantly better vertex colourings than the greedy algorithm on random graphs with edge probability $$p=0.5$$, while in turn producing significantly worse colourings than the recursive largest first algorithm.