Beruflich Dokumente
Kultur Dokumente
0 1
Clause i
Theorem 9.8
To Begin
Arguably the most important decision in designing an NP-completeness proof is, from which NP-complete problem to start. However, there are no easy rules here. Always start with 3SAT, an extremely versatile problem which can be easily reduced to a surprising range of NP-complete problems. So what does reduction mean?
Reducible Definition We say that language L1 is reducible to L2 if there is a function R from strings to strings computable by a deterministic Tuning machine is Space O(log n) such that for all input x the following is true : x L1 if and only if R(x) L2 . R is called a reduction from L1 to L2.
That problem is NP-complete. We infer a reduction from (3)SAT to that problem Circuit-SAT Cook's Theorem. Circuit-SAT P NP=P
In 3SAT we are given a set of clause with three literals in each, and we are asked whether there is a truth assignment T such that no clause has all three literals true. 3-SAT {() | = Ck , Ck clause, |Ck|3 , true k=1 assignment true}
n
Based on 3-SAT, in no clause are all three literals equal in truth values, which means NAEST. { truth assignment Ci literals true false} Circuit-SAT Reduce NAESAT. C Circuit :
g7 O g6 v
g4 g1 x1 g2
g5
x2
g3
x3
(x1g1) (g1x1) and (x1g1) = (x1 v g1) and (g1x1) = (g1 v x1) So (x1g1) (g1x1) = (x1 v g1) (g1 v x1)
g1x1
g1 g2 h Equal to (g1 g2 h) (h g1 g2) And (g1 g2 h) = (g1 g2) v h = (g1 v g2 v h) -> Has three literals And (h g1 g2) = h v (g1 g2) = (h v g1) ( h v g2) (g1 v g2 v h) = true
g 1 g 2
h F F F
v=(g1 v g2 v h) T T T
F(T)
h v
x1 g2 x 2
F(T)
g1
v=(g1 v g2 v h) T T T T
Theorem 9.8 : 3-COLORING is NPcomplete (P198) that we are asked to color the vertices of a given graph with k colors such Suppose
that no two adjacent nodes have the same color. This classical problem is called kCOLORING. When k=2 it is quite easy to solve. For k=3 , it is 3-COLORING.
1 0 2 0 0 2
3-Coloring : {(G),K : G=(V,E) be an undirected graph there each vertex can be colored in K(0,1,2) and no adjacent vertex has some color.}
Theorem 9.8 3-COLORING is NP-complete Proof: We are given a set of clauses C1,,Cm each with three literals, involving the three variables x1,,xn, and we are asked whether there is a truth assignment on the variables such that no clause has all literals true, or all liter false. We construct a graph G, and argue that it can be colored with colors {0,1,2} if and only if all clauses can take diverse values. Each clauses Ci is represented by a triangle, [Ci1, Ci2, Ci3]. We claim that G can be colored with colors {0,1,2} if and only if the given instance of NAESAT is satisfiable.
Ci2
Ci1
CI3
If Cij takes the color 1 we think that the variable is true, otherwise it is false and takes the color 0.
Proof: How can the clause triangles be colored? If all literals in a clause are all true, then the corresponding triangle cannot be colored, since color 1 will be adjacent; so the overall graph is not 3-colorable. Similarly if all literal are false. This completes the proof of one direction.
1 1 2 0
0
2
For the other direction, suppose that a satisfying (in the NAESAT sense) truth assignment exists, we color node a by color 2, and the variable triangles in the way that reflects the truth assignment. And for any clause, we can color the clause triangle as follows: We pick two literals in it with opposite truth values and color the vertices corresponding to them with available color among {0,1}; we then color the third node 2.
X =1 i
Xi=0
a=2
x1:1
1:0
x2:0
2:1
3:0
x3:1
x2:1
x 1:1
2:0
2:0
x3:2
3:2
x 1:1
x3
Bipartite graph : A bipartite graph (or bigraph) is a graph whose vertices can be divided into two disjoint sets U and V such that every edge connects a vertex in U to one in V; that is, U and V are independent sets. Equivalently, a bipartite graph is a graph that does not contain any odd-length cycles. Bipartite {(G) | G=(V,U,E) be an undirected graph there exist two disjoint sets U,V of nodes which only connected to the node of the opposite set.}
Testing bipartiteness : If a bipartite graph is connected, its bipartition can be defined by the parity of the distances from any arbitrarily chosen vertex v: one subset consists of the vertices at even distance to v and the other subset consists of the vertices at odd distance to u. Thus, one may efficiently test whether a graph is bipartite by using this parity technique to assign vertices to the two subsets U and V, separately within each connected component of the graph, and then examine each edge to verify that it has endpoints assigned to different subsets.
V = {0,2,4} U = {1,3,5}
Testing Algorithm : Base on the idea from previous slide, we use BFS (Breadth-First Search) which has running time O(V+E) on G(V,E). Consider below graph and the start search vertex is x1. For BFS, the search order would be :
2st round 4st round x5 x2 x6 x1 x3 x7 3st round x3 x9 6st round x8 5st round
1st round
Mapping from Bipartite Graph to 2-Coloring : Based on the introduction on Bipartite, we can regard Bipartite Graph Testing is polynomial problem. So once we treat value{0,1} in Bipartite Graph to be color K{0,1}, we can use the algorithm BFS to verify whether a Graph is 2-Coloring satisfiable which means the 2-Coloring is Polynomial.
Reference