graph coloring and NP completeness

安稳与你 提交于 2019-12-12 05:57:27

问题


I am having trouble understanding the NP completeness of graph coloring.

If I assume a greedy coloring strategy (http://en.wikipedia.org/wiki/Graph_coloring#Greedy_coloring) with DFS, then I seem to be able to color graphs optimally. Could anyone help me with a counter example?

To be clear, let all nodes be colored -1. Color the start node 1. Proceed in a DFS traversal coloring every node with the minimum integer that is not already assigned to its neighbors. When would this fail to optimally color the graph?


回答1:


DFS greedy coloring will certainly fail on some graphs. The way to come up with a counterexample is to try to write a proof that DFS will color optimally. The part of the proof that you can't quite get to work is the hint for coming up with a counterexample.



来源:https://stackoverflow.com/questions/12023731/graph-coloring-and-np-completeness

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!