56 sequentialColoringSimple,
57 sequentialColoringDegree,
70 , m_sequentialColoring()
72 , m_wigdersonColoring()
83 m_searchProcedure = searchProcedure;
91 m_bruteForceProcedure = bruteForceProcedure;
133 : m_coloring(coloringBergerRompel), m_graph(graph), m_colors(
colors), m_alpha(alpha) { }
137 return m_coloring.bergerRompelParameterized(m_graph, m_colors, start, k, m_alpha);
Includes declaration of graph class.
Applies the node coloring approximation specified by Johnson.
Template of base class of node coloring algorithms.
Applies the sequential coloring algorithm to a given graph.
Trivial node coloring which assigns every node a different color.
Applies the node coloring approximation specified by Wigderson.
Basic declarations, included by all source files.
Data type for general directed graphs (adjacency list representation).
Approximation algorithms for the node coloring problem in graphs.
BruteForceProcedure m_bruteForceProcedure
NodeColoringJohnson m_johnsonColoring
bool bergerRompelParameterized(const Graph &graph, NodeArray< NodeColor > &colors, NodeColor &color, int k, double alpha)
NodeColoringBergerRompel()
The constructor.
void setAlpha(double alpha)
Sets the parameter alpha which controls the accuracy of the algorithm.
NodeColoringSimple m_simpleColoring
virtual NodeColor call(const Graph &graph, NodeArray< NodeColor > &colors, NodeColor start=0) override
The actual algorithm call.
NodeColoringSequential m_sequentialColoring
SearchProcedure m_searchProcedure
BruteForceProcedure
Declares the procedure dealing with the brute force coloring.
void setSearchProcedure(SearchProcedure searchProcedure)
Sets the search procedure to find the smallest possible parameter k such as the graph is k-colorable.
void setBruteForceProcedure(BruteForceProcedure bruteForceProcedure)
Sets the brute force procedure.
NodeColoringWigderson m_wigdersonColoring
Approximation algorithms for the node coloring problem in graphs.
Approximation algorithms for the node coloring problem in graphs.
unsigned int NodeColor
Data type of the node colors.
SearchProcedure
Declares the search procedures.
Approximation algorithms for the node coloring problem in graphs.
Approximation algorithms for the node coloring problem in graphs.
Approximation algorithms for the node coloring problem in graphs.
RegisteredArray for nodes, edges and adjEntries of a graph.
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF dynamic library (shared object / DLL),...
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
The namespace for all OGDF objects.
const std::array< Color, 63 > colors
An array of 63 different colors to cycle through.
Wraps the parameterized Berger&Rompel algorithm.
NodeColoringBergerRompel & m_coloring
NodeArray< NodeColor > & m_colors
bool step(int k) override
Performs a step in the search procedure.
SearchWrapperBergerRompel(NodeColoringBergerRompel &coloringBergerRompel, const Graph &graph, NodeArray< NodeColor > &colors, double alpha)
Creates the wrapper.
Wraps the search for the minimum parameter k so that the same code can be reused for all algorithms.