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 Details

    • ColoringAlgoAbstract

      public ColoringAlgoAbstract()
      Default constructor.
  • Method Details

    • 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 is IntGraph, the returned object is IVertexPartition.

      Specified by:
      computeColoring in interface ColoringAlgo
      Type Parameters:
      V - the vertices type
      E - the edges type
      Parameters:
      g - a graph
      Returns:
      a valid coloring with (hopefully) small number of different colors