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.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.google.javascript.jscomp.graph.GraphColoring
GraphColoring.Color, GraphColoring.GreedyGraphColoring<N,E>
-
-
Field Summary
-
Fields inherited from class com.google.javascript.jscomp.graph.GraphColoring
colorToNodeMap, graph
-
-
Constructor Summary
Constructors Constructor Description GreedyGraphColoring(AdjacencyGraph<N,E> graph)
GreedyGraphColoring(AdjacencyGraph<N,E> graph, java.util.Comparator<N> tieBreaker)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
color()
Annotates the graph withGraphColoring.Color
objects usingAnnotatable.setAnnotation(Annotation)
.-
Methods inherited from class com.google.javascript.jscomp.graph.GraphColoring
getGraph, getPartitionSuperNode
-
-
-
-
Constructor Detail
-
GreedyGraphColoring
public GreedyGraphColoring(AdjacencyGraph<N,E> graph)
-
GreedyGraphColoring
public GreedyGraphColoring(AdjacencyGraph<N,E> graph, java.util.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.
-
-
Method Detail
-
color
public int color()
Description copied from class:GraphColoring
Annotates the graph withGraphColoring.Color
objects usingAnnotatable.setAnnotation(Annotation)
.- Specified by:
color
in classGraphColoring<N,E>
- Returns:
- The number of unique colors need.
-
-