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
public abstract class ColoringAlgoAbstract extends Object implements ColoringAlgo
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
Constructors Constructor Description ColoringAlgoAbstract()
Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <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.
-
-
-
Method Detail
-
computeColoring
public <V,E> VertexPartition<V,E> computeColoring(Graph<V,E> g)
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
-
-