V
- the graph vertex typeE
- the graph edge typepublic class SaturationDegreeColoring<V,E> extends Object implements VertexColoringAlgorithm<V>
This is the greedy coloring algorithm using saturation degree ordering. The saturation degree of a vertex is defined as the number of different colors to which it is adjacent. The algorithm selects always the vertex with the largest saturation degree. If multiple vertices have the same maximum saturation degree, a vertex of maximum degree in the uncolored subgraph is selected.
Note that the DSatur is not optimal in general, but is optimal for bipartite graphs. Compared to other simpler greedy ordering heuristics, it is usually considered slower but more efficient w.r.t. the number of used colors. See the following papers for details:
This implementation requires $O(n^2)$ running time and space. The following paper discusses possible improvements in the running time.
VertexColoringAlgorithm.Coloring<V>, VertexColoringAlgorithm.ColoringImpl<V>
Constructor and Description |
---|
SaturationDegreeColoring(Graph<V,E> graph)
Construct a new coloring algorithm.
|
Modifier and Type | Method and Description |
---|---|
VertexColoringAlgorithm.Coloring<V> |
getColoring()
Computes a vertex coloring.
|
public VertexColoringAlgorithm.Coloring<V> getColoring()
getColoring
in interface VertexColoringAlgorithm<V>
Copyright © 2019. All rights reserved.