34-3 Graph coloring

Mapmakers try to use as few colors as possible when coloring countries on a map, as long as no two countries that share a border have the same color. We can model this problem with an undirected graph G=(V,E)G = (V, E) in which each vertex represents a country and vertices whose respective countries share a border are adjacent. Then, a kk-coloring is a function c:V{1,2,,k}c: V \to \{1, 2, \dots, k \} such that c(u)c(v)c(u) \ne c(v) for every edge (u,v)E(u, v) \in E. In other words, the numbers 1,2,,k1, 2, \dots, k represent the kk colors, and adjacent vertices must have different colors. The graph-coloring problem is to determine the minimum number of colors needed to color a given graph.

a. Give an efficient algorithm to determine a 22-coloring of a graph, if one exists.

b. Cast the graph-coloring problem as a decision problem. Show that your decision problem is solvable in polynomial time if and only if the graph-coloring problem is solvable in polynomial time.

c. Let the language 3-COLOR\text{3-COLOR} be the set of graphs that can be 33-colored. Show that if 3-COLOR\text{3-COLOR} is NP-complete\text{NP-complete}, then your decision problem from part (b) is NP-complete\text{NP-complete}.

To prove that 3-COLOR\text{3-COLOR} is NP-complete\text{NP-complete}, we use a reduction from 3-CNF-SAT\text{3-CNF-SAT}. Given a formula ϕ\phi of mm clauses on nn variables x1,x2,,xnx_1, x_2, \dots, x_n, we construct a graph G=(V,E)G = (V, E) as follows. The set VV consists of a vertex for each variable, a vertex for the negation of each variable, 55 vertices for each clause, and 33 special vertices: TRUE\text{TRUE}, FALSE\text{FALSE}, and RED\text{RED}. The edges of the graph are of two types: "literal" edges that are independent of the clauses and "clause" edges that depend on the clauses. The literal edges form a triangle on the special vertices and also form a triangle on xi,¬xix_i, \neg x_i, and RED\text{RED} for i=1,2,,ni = 1, 2, \dots, n.

d. Argue that in any 33-coloring cc of a graph containing the literal edges, exactly one of a variable and its negation is colored c(TRUE)c(\text{TRUE}) and the other is colored c(FALSE)c(\text{FALSE}). Argue that for any truth assignment for ϕ\phi, there exists a 33-coloring of the graph containing just the literal edges.

The widget shown in Figure 34.20 helps to enforce the condition corresponding to a clause (xyz)(x \vee y \vee z). Each clause requires a unique copy of the 55 vertices that are heavily shaded in the figure; they connect as shown to the literals of the clause and the special vertex TRUE\text{TRUE}.

e. Argue that if each of xx, yy, and zz is colored c(TRUE)c(\text{TRUE}) or c(FALSE)c(\text{FALSE}), then the widget is 33-colorable if and only if at least one of xx, yy, or zz is colored c(TRUE)c(\text{TRUE}).

f. Complete the proof that 3-COLOR\text{3-COLOR} is NP-complete\text{NP-complete}.

(Omit!)