Package org.jgrapht.alg.interfaces
Class VertexColoringAlgorithm.ColoringImpl<V>
- java.lang.Object
-
- org.jgrapht.alg.interfaces.VertexColoringAlgorithm.ColoringImpl<V>
-
- Type Parameters:
V
- the graph vertex type
- All Implemented Interfaces:
Serializable
,VertexColoringAlgorithm.Coloring<V>
- Enclosing interface:
- VertexColoringAlgorithm<V>
public static class VertexColoringAlgorithm.ColoringImpl<V> extends Object implements VertexColoringAlgorithm.Coloring<V>, Serializable
Default implementation of the coloring interface.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ColoringImpl(Map<V,Integer> colors, int numberColors)
Construct a new vertex coloring.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<Set<V>>
getColorClasses()
Get the color classes.Map<V,Integer>
getColors()
Get the color map.int
getNumberColors()
Get the number of colors.String
toString()
-
-
-
Method Detail
-
getNumberColors
public int getNumberColors()
Get the number of colors.- Specified by:
getNumberColors
in interfaceVertexColoringAlgorithm.Coloring<V>
- Returns:
- the number of colors
-
getColors
public Map<V,Integer> getColors()
Get the color map.- Specified by:
getColors
in interfaceVertexColoringAlgorithm.Coloring<V>
- Returns:
- the color map
-
getColorClasses
public List<Set<V>> getColorClasses()
Get the color classes. A subset of vertices assigned to the same color is called a color class; every such class forms an independent set. This method returns a partitioning of the vertices in the graph in disjoint color classes.- Specified by:
getColorClasses
in interfaceVertexColoringAlgorithm.Coloring<V>
- Returns:
- a list of color classes
-
-