121 std::array<std::array<int, V>, V>
graph = {
122 std::array<int, V>({0, 1, 1, 1}), std::array<int, V>({1, 0, 1, 0}),
123 std::array<int, V>({1, 1, 0, 1}), std::array<int, V>({1, 0, 1, 0})};
126 std::array<int, V> color{};
128 backtracking::graph_coloring::graphColoring<V>(
graph, m, color, 0);
void graphColoring(const std::array< std::array< int, V >, V > &graph, int m, std::array< int, V > color, int v)
Recursive utility function to solve m coloring problem.
bool isSafe(int v, const std::array< std::array< int, V >, V > &graph, const std::array< int, V > &color, int c)
Utility function to check if the current color assignment is safe for vertex v.