com.google.javascript.jscomp.graph
Class GraphColoring.GreedyGraphColoring<N,E>
java.lang.Object
com.google.javascript.jscomp.graph.GraphColoring<N,E>
com.google.javascript.jscomp.graph.GraphColoring.GreedyGraphColoring<N,E>
- Enclosing class:
- GraphColoring<N,E>
public static class GraphColoring.GreedyGraphColoring<N,E>
- extends GraphColoring<N,E>
Greedily assign nodes with high degree unique colors.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GraphColoring.GreedyGraphColoring
public GraphColoring.GreedyGraphColoring(AdjacencyGraph<N,E> graph)
GraphColoring.GreedyGraphColoring
public GraphColoring.GreedyGraphColoring(AdjacencyGraph<N,E> graph,
Comparator<N> tieBreaker)
- Parameters:
tieBreaker
- In case of a tie between two nodes of the same degree,
this comparator will determine which node should be colored first.
color
public int color()
- Description copied from class:
GraphColoring
- Annotates the graph with
GraphColoring.Color
objects using
Annotatable.setAnnotation(Annotation)
.
- Specified by:
color
in class GraphColoring<N,E>
- Returns:
- The number of unique colors need.