[5] Question Bank Problem FIVE

Question: Now consider this problem, called 3-COLORABILITY, on an arbitrary graph G = (V, E). We need to decide if there exists a coloring c of the vertices of V (i.e. an assignment to each vertex of one of the colors red, green and blue) such that, for every (u, v) belongs to E, c(u) != c(v). Show that this problem is NP-complete. Hint: construct a reduction from 3-SAT; think of the colors as "True", "False" and "Undetermined".

Solution:
3-Colorability problem:
3-Colorability problem is the problem that given an arbitrary graph G = (V, E), decide if there exists a coloring c of the vertices of V such that for every edge (u, v) E, c(u) != c(v).

3-SAT problem:
3-SAT problem is the problem of deciding the satisfiability of a formula L in conjunctive normal form with k clauses and input variables x1, x2, …, xn where each clause is limited to at most three literals whether some assignment p makes it true.

Claim: the 3-Colorability problem is NP-complete.
3-Colorability is in NP because we could verify any solution in polynomial time:
Certificate: for each node a color from {1, 2, 3}
Certifier: Check if, for each edge (u, v), the color of u is different from that of v.

Reduction:
Start with 3-SAT formula P with n variables x1, x2, …, xn and m clauses C1, C2, …, Cm.
Then we create a graph G based on some rules.
For every variable xi, create 2 nodes in G, one for xi and another for ¬xi. Connect these nodes by an edge.
Create 3 special nodes, T, F, U, joined in a triangle:
Connect every variable node to B:
Connect every clause in the formula like this, which is called a gadget:

Properties:

  1. Each of xi and ¬xi must get different colors which will never be U.
  2. T, F, U must get different colors.
  3. The top node on the gadget is colorable if and only if its terms get the true color, otherwise the top node can’t be colored any color of those three.

Hence, any 3-coloring of this graph defines a valid assignment to 3-SAT formula P.

Suppose there is a satisfying assignment. We get a 3-colorability of G by:

  1. Coloring T, F, U arbitrarily with three different colors.
  2. If xi = true, color xi with the same color as T and ¬xi with the color of F. If xi = false, do the opposite.
  3. Extend this coloring into the clause gadget.

Hence, the graph is 3-Colorability if and only if the formula it is derived from is satisfiable. Until now, we proved we can reduce a 3-SAT problem to a 3-Colorability problem. Therefore, the 3-Colorability problem is NP-complete.

你可能感兴趣的:([5] Question Bank Problem FIVE)