(boolean[][] graph, int[] color)
| 19 | // check if the colored |
| 20 | // graph is safe or not |
| 21 | static boolean isSafe(boolean[][] graph, int[] color) |
| 22 | { |
| 23 | // check for every edge |
| 24 | for (int i = 0; i < V; i++) |
| 25 | for (int j = i + 1; j < V; j++) |
| 26 | if (graph[i][j] && color[j] == color[i]) |
| 27 | return false; |
| 28 | return true; |
| 29 | } |
| 30 | |
| 31 | /* This function solves the m Coloring |
| 32 | problem using recursion. It returns |