Package com.jgalgo.alg.color
Class ColoringAlgoAbstract
java.lang.Object
com.jgalgo.alg.color.ColoringAlgoAbstract
- All Implemented Interfaces:
ColoringAlgo
- Direct Known Subclasses:
ColoringDSatur
,ColoringGreedy
,ColoringRecursiveLargestFirst
Abstract class for coloring algorithms.
The class implements the interface by solving the problem on the index graph and then maps the results back to the original graph. The implementation for index graphs is abstract and left to the subclasses.
- Author:
- Barak Ugav
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<V,
E> VertexPartition <V, E> computeColoring
(Graph<V, E> g) Assign a color to each vertex of the given graph, while minimizing the number of different colors.
-
Constructor Details
-
ColoringAlgoAbstract
public ColoringAlgoAbstract()Default constructor.
-
-
Method Details
-
computeColoring
Description copied from interface:ColoringAlgo
Assign a color to each vertex of the given graph, while minimizing the number of different colors.If
g
isIntGraph
, the returned object isIVertexPartition
.- Specified by:
computeColoring
in interfaceColoringAlgo
- Type Parameters:
V
- the vertices typeE
- the edges type- Parameters:
g
- a graph- Returns:
- a valid coloring with (hopefully) small number of different colors
-