You are given an undirected graph and two colors, black and white.  write  a program to find the maximum number of nodes that can be colored with black such way that no two connected nodes colored with black. For example below undirected graph ,the maximum number of nodes that can be colored with black would be 3.

Graph coloring backtracking problem

Ref:
https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=129