Académique Documents
Professionnel Documents
Culture Documents
From Propositions 27 (p. 272) and Proposition 30 (p. 275), it is the least likely to be in P. Your options are: Approximations. Special cases. Average performance. Randomized algorithms. Exponential-time algorithms that work well in practice. Heuristics (and pray that it works for your thesis ).
Page 312
I thought NP-completeness was an interesting idea: I didnt quite realize its potential impact. Stephen Cook (1998) I was indeed surprised by Karps work since I did not expect so many wonderful problems were NP-complete. Leonid Levin (1998)
Page 313
Page 314
3sat
k -sat, where k Z+ , is the special case of sat. The formula is in CNF and all clauses have exactly k literals (repetition of literals is allowed). For example, (x1 x2 x3 ) (x1 x1 x2 ) (x1 x2 x3 ).
Page 315
3sat Is NP-Complete
Recall Cooks Theorem (p. 295) and the reduction of circuit sat to sat (p. 261). The resulting CNF has at most 3 literals for each clause. This accidentally shows that 3sat where each clause has at most 3 literals is NP-complete. Finally, duplicate one literal once or twice to make it a 3sat formula. So x1 x2 becomes x1 x2 x2 .
Page 316
Page 317
Page 318
Page 319
An Example
Suppose we are given the following 3sat expression (x w g ) (x y z ) . The transformed expression is (x1 w g ) (x2 y z ) (x1 x2 ) (x2 x1 ). Variable x1 appears 3 times. Literal x1 appears once. Literal x1 appears 2 times.
Page 320
2sat Is in NL P
Let be an instance of 2sat: Each clause has 2 literals. NL is a subset of P (p. 229). By Eq. (2) on p. 239, coNL equals NL. We need to show only that recognizing unsatisable expressions is in NL. See the textbook for proof.
Page 321
Page 322
max2sat Is NP-Completea
Consider the following 10 clauses: (x) (y ) (z ) (w) (x y ) (y z ) (z x) (x w) (y w) (z w) Let the 2sat formula r(x, y, z, w) represent the conjunction of these clauses. The clauses are symmetric with respect to x, y , and z . How many clauses can we satisfy?
a Garey,
Page 323
Page 324
Page 325
Page 326
Page 327
Page 328
Page 329
Page 330
naesat
The naesat (for not-all-equal sat) is like 3sat. But there must be a satisfying truth assignment under which no clauses have all three literals equal in truth value. Equivalently, there is a truth assignment such that each clause has one literal assigned true and one literal assigned false.
Page 331
naesat Is NP-Completea
Recall the reduction of circuit sat to sat on p. 261. It produced a CNF in which each clause has 1, 2, or 3 literals. Add the same variable z to all clauses with fewer than 3 literals to make it a 3sat formula. Goal: The new formula (z ) is nae-satisable if and only if the original circuit is satisable.
a Karp
(1972).
Page 332
Page 333
Page 334
a Turing
Award (1985).
Page 335
Undirected Graphs
An undirected graph G = (V, E ) has a nite set of nodes, V , and a set of undirected edges, E . It is like a directed graph except that the edges have no directions and there are no self-loops. Use [ i, j ] to denote the fact that there is an edge between node i and node j .
Page 336
Independent Sets
Let G = (V, E ) be an undirected graph. I V. I is independent if there is no edge between any two nodes i, j I . The independent set problem: Given an undirected graph and a goal K , is there an independent set of size K? Many applications.
Page 337
Page 338
Page 339
Same literal labels that appear in dierent clauses yield distinct nodes.
Page 340
Page 341
Page 342
Page 343
node cover
We are given an undirected graph G and a goal K . node cover: Is there a set C with K or fewer nodes such that each edge of G has at least one of its endpoints (i.e., incident nodes) in C ? Many applications.
Page 344
Page 345
clique
We are given an undirected graph G and a goal K . clique asks if there is a set C with K nodes such that there is an edge between any two nodes i, j C . Many applications.
Page 346
Remarksa
Are independent set and node cover NP-complete if K is a constant? No, because one can do an exhaustive search on all the possible node covers or independent sets (both (n) b k of them, a polynomial). Are independent set and node cover NP-complete if K is a linear function of n? independent set with K = n/3 and node cover with K = 2n/3 remain NP-complete by our reductions.
a Contributed bn
= | V |.
Page 347
clique Is NP-Complete
Corollary 41 (Karp (1972)) clique is NP-complete. be the complement of G, where [x, y ] G if and Let G only if [x, y ] G. . I is a clique in G I is an independent set in G
Page 348
Page 349
A Cut of Size 4
Page 350
Page 351
Page 352
The Proof
Suppose s m clauses are C1 , C2 , . . . , Cm . The boolean variables are x1 , x2 , . . . , xn . G has 2n nodes: x1 , x2 , . . . , xn , x1 , x2 , . . . , xn . Each clause with 3 distinct literals makes a triangle in G. For each clause with two identical literals, there are two parallel edges between the two distinct literals. No need to consider clauses with one literal (why?). For each variable xi , add ni copies of edge [xi , xi ], where ni is the number of occurrences of xi and xi in .
Page 353
.45 08
Page 354
Page 355
308
0
97 ,3 08
3
5,7,
Page 356
Page 357
K = 5m.
Page 358
Page 359
97:0
1, 80
Page 360
Remarks
We had proved that max cut is NP-complete for multigraphs. How about proving the same thing for simple graphs?a How to modify the proof to reduce 4sat to max cut?b All NP-complete problems are mutually reducible by denition.c So they are equally hard in this sense.d
by Mr. Tai-Dai Chou (J93922005) on June 2, 2005. b Contributed by Mr. Chien-Lin Chen (J94922015) on June 8, 2006. c Contributed by Mr. Ren-Shuo Liu (D98922016) on October 27, 2009. d Contributed by Mr. Ren-Shuo Liu (D98922016) on October 27, 2009.
a Contributed
Page 361
max bisection
max cut becomes max bisection if we require that |S | = |V S |. It has many applications, especially in VLSI layout.
Page 362
Page 363
Page 364
bisection width
bisection width is like max bisection except that it asks if there is a bisection of size at most K (sort of min bisection). Unlike min cut, bisection width is NP-complete. We reduce max bisection to bisection width. Given a graph G = (V, E ), where |V | is even, we generate the complement of G. Given a goal of K , we generate a goal of n2 K .
Page 365
Page 366
(1972).
Page 367
Page 368
Page 369
Page 370
Page 371
Page 372
Random tsp
Suppose each distance dij is picked uniformly and independently from the interval [ 0, 1 ]. It is known that the total distance of the shortest tour has a mean value of n for some positive . In fact, the total distance of the shortest tour can be away from the mean by more than t with probability at 2 most et /(4n) !a
a Dubhashi
Page 373
Graph Coloring
k -coloring: Can the nodes of a graph be colored with k colors such that no two adjacent nodes have the same color?a 2-coloring is in P (why?). But 3-coloring is NP-complete (see next page). k -coloring is NP-complete for k 3 (why?). exact-k -coloring asks if the nodes of a graph can be colored using exactly k colors. It remains NP-complete for k 3 (why?).
ak
Page 374
3-coloring Is NP-Completea
We will reduce naesat to 3-coloring. We are given a set of clauses C1 , C2 , . . . , Cm each with 3 literals. The boolean variables are x1 , x2 , . . . , xn . We shall construct a graph G such that it can be colored with colors {0, 1, 2} if and only if all the clauses can be nae-satised.
a Karp
(1972).
Page 375
Page 376
Page 377
Page 378
Page 379
Page 380