I honestly did not understand your solution. Aren't their any 3rd party libraries which can help in this regards?


Finding a valid 3-coloring of a graph

In graph theory, the 3-colorability problem is a special case of graph coloring or graph labeling. It is a NP-complete problem. The goal is as follows: Given an undirected graph G, find an assignment of colors to the nodes out of three colorss so that no adjacent nodes have the same color. Applications of the 3-colorability problem can be found in scheduling tasks or in social networks.
Subscribe to algorithm