A graph colouring assigns a colour to every vertex in a graph, with the restriction that two vertices of the same colour cannot be adjacent. A graph is said to be k-colorable if it can be colored in k or fewer colours.
Give an algorithm that will return true if a graph is 2-colorable and false otherwise.
Exercise 15 defined a bipartite graph. Show that a graph is bipartite if and only if it is 2-colorable. Then, using this fact, implement a method that detects whether a graph is bipartite.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here