|
Open Graph Drawing Framework |
v. 2023.09 (Elderberry)
|
|
|
Go to the documentation of this file.
73 sequentialColoringSimple,
74 sequentialColoringDegree,
82 sequentialColoringSimple,
83 sequentialColoringDegree,
94 , m_sequentialColoring()
95 , m_searchProcedure(SearchProcedure::wigdersonSearch)
106 m_searchProcedure = searchProcedure;
114 m_maxDegreeProcedure = maxDegreeProcedure;
122 m_recursionAnchorProcedure = recursionAnchorProcedure;
130 m_bruteForceProcedure = bruteForceProcedure;
134 NodeColor start = 0)
override;
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);
The namespace for all OGDF objects.
SearchProcedure m_searchProcedure
Includes declaration of graph class.
RecursionAnchorProcedure
Declares the procedure dealing with the recursion anchor coloring.
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
void setMaxDegreeProcedure(MaxDegreeProcedure maxDegreeProcedure)
Sets the procedure of finding maximum degree nodes.
void setBruteForceProcedure(BruteForceProcedure bruteForceProcedure)
Sets the brute force procedure.
MaxDegreeProcedure
Declares procedure to find the maximum degree nodes.
NodeColoringWigderson & m_coloring
Approximation algorithms for the node coloring problem in graphs.
Approximation algorithms for the node coloring problem in graphs.
const std::array< Color, 63 > colors
An array of 63 different colors to cycle through.
NodeColoringSimple m_coloringSimple
NodeArray< NodeColor > & m_colors
void setSearchProcedure(SearchProcedure searchProcedure)
Sets the search procedure to find the smallest possible parameter k such as the graph is k-colorable.
Approximation algorithms for the node coloring problem in graphs.
Approximation algorithms for the node coloring problem in graphs.
RecursionAnchorProcedure m_recursionAnchorProcedure
BruteForceProcedure m_bruteForceProcedure
SearchWrapperWigderson(NodeColoringWigderson &coloringWigderson, const Graph &graph, NodeArray< NodeColor > &colors)
Creates the wrapper.
Doubly linked lists (maintaining the length of the list).
RegisteredArray for nodes, edges and adjEntries of a graph.
Trivial node coloring which assigns every node a different color.
Data type for general directed graphs (adjacency list representation).
Template of base class of node coloring algorithms.
Basic declarations, included by all source files.
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Wraps the Wigderson recursive algorithm.
unsigned int NodeColor
Data type of the node colors.
bool step(int k) override
Performs a step in the search procedure.
Applies the sequential coloring algorithm to a given graph.
int wigdersonFunction(int n, int k) const
Calculates the function for the graph maximum degree specified by Wigderson.
MaxDegreeProcedure m_maxDegreeProcedure
NodeColoringSequential m_sequentialColoring
BruteForceProcedure
Declares the procedure dealing with the brute force coloring.
NodeColoringWigderson()
The constructor.
void setRecursionAnchorProcedure(RecursionAnchorProcedure recursionAnchorProcedure)
Sets the recursion anchor procedure.
Wraps the search for the minimum parameter k so that the same code can be reused for all algorithms.