73 sequentialColoringSimple,
74 sequentialColoringDegree,
82 sequentialColoringSimple,
83 sequentialColoringDegree,
94 , m_sequentialColoring()
106 m_searchProcedure = searchProcedure;
114 m_maxDegreeProcedure = maxDegreeProcedure;
122 m_recursionAnchorProcedure = recursionAnchorProcedure;
130 m_bruteForceProcedure = bruteForceProcedure;
155 return std::ceil(std::pow(n, 1.0 - (1.0 / (
static_cast<double>(k) - 1.0))));
194 : m_coloring(coloringWigderson), m_graph(graph), m_colors(
colors) { }
198 return m_coloring.wigdersonCaller(m_graph, m_colors, start, k);
Includes declaration of graph class.
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.
Basic declarations, included by all source files.
Data type for general directed graphs (adjacency list representation).
Doubly linked lists (maintaining the length of the list).
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.
bool wigdersonCaller(const Graph &graph, NodeArray< NodeColor > &colors, NodeColor &color, int k)
Calls initially the recursive algorithm of Wigderson.
RecursionAnchorProcedure m_recursionAnchorProcedure
RecursionAnchorProcedure
Declares the procedure dealing with the recursion anchor coloring.
MaxDegreeProcedure m_maxDegreeProcedure
NodeColoringSimple m_coloringSimple
virtual NodeColor call(const Graph &graph, NodeArray< NodeColor > &colors, NodeColor start=0) override
The actual algorithm call.
void setMaxDegreeProcedure(MaxDegreeProcedure maxDegreeProcedure)
Sets the procedure of finding maximum degree nodes.
bool wigdersonRecursive(const Graph &graph, NodeArray< NodeColor > &colors, NodeColor &color, int k, NodeArray< int > °reesOriginal, List< node > &nodesToBeColored)
Calls the recursive algorithm of Wigderson to find a feasible graph coloring.
void setBruteForceProcedure(BruteForceProcedure bruteForceProcedure)
Sets the brute force procedure.
MaxDegreeProcedure
Declares procedure to find the maximum degree nodes.
SearchProcedure m_searchProcedure
NodeColoringSequential m_sequentialColoring
void setRecursionAnchorProcedure(RecursionAnchorProcedure recursionAnchorProcedure)
Sets the recursion anchor procedure.
BruteForceProcedure
Declares the procedure dealing with the brute force coloring.
NodeColoringWigderson()
The constructor.
int wigdersonFunction(int n, int k) const
Calculates the function for the graph maximum degree specified by Wigderson.
BruteForceProcedure m_bruteForceProcedure
void setSearchProcedure(SearchProcedure searchProcedure)
Sets the search procedure to find the smallest possible parameter k such as the graph is k-colorable.
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 search for the minimum parameter k so that the same code can be reused for all algorithms.
Wraps the Wigderson recursive algorithm.
NodeArray< NodeColor > & m_colors
NodeColoringWigderson & m_coloring
bool step(int k) override
Performs a step in the search procedure.
SearchWrapperWigderson(NodeColoringWigderson &coloringWigderson, const Graph &graph, NodeArray< NodeColor > &colors)
Creates the wrapper.