Presentation is loading. Please wait.

Presentation is loading. Please wait.

Clique Cover Cook’s Theorem 3SAT and Independent Set

Similar presentations

Presentation on theme: "Clique Cover Cook’s Theorem 3SAT and Independent Set"— Presentation transcript:

1 Clique Cover Cook’s Theorem 3SAT and Independent Set
These slides are based on the Lecture Notes by David Mount for the course CMSC 451 at the University of Maryland. The Copyright notice is as follows: Copyright, David M. Mount, 2008 Dept. of Computer Science, University of Maryland, College Park, MD, These lecture notes were prepared by David Mount for the course CMSC 451, Design and Analysis of Computer Algorithms, at the University of Maryland. Permission to use, copy, modify, and distribute these notes for educational purposes and without fee is hereby granted, provided that this copyright notice appear in all copies.

2 3-Colorability Well known to be NP-complete
Given a graph G, can each of its vertices be labeled with one of 3 different colors, such that no two adjacent vertices have the same label. Arises in partitioning problems, Where two objects cannot be assigned to the same set of partitions.

3 3-Colorability Planar graphs can be colored with 4 colors
Polynomial algorithm Determining whether 3 colors are possible is “hard” No known polynomial algorithm for 3 colors.

4 3-Colorable

5 Clique Given a graph G= (V,E) we say that a subset of vertices V' forms a clique if for every pair of vertices u, v in V', the edge (u,v) is in E. A subgraph induced by V' is a complete graph.

6 Clique Cover (CCov) problem
Given a graph G = (V, E) and an integer k, can we partition the vertex set into k subsets of vertices V1, V2, V3,..., Vk such that each Vi is a clique of G and Arises in applications of clustering Put an edge between two nodes if they are similar enough to be clustered in the same group. Is it possible to cluster all the vertices in k groups?

7 Clique Cover (size = 3)‏

8 How to prove CCov NP-complete?
Assume that you have access to a subroutine CCov(G,k) returns true if G has a CCov of size k. Try to write a polynomial-time subroutine for 3Col(G) which is allowed to call CCov(G,k) Reduce G to (G’, k) in polynomial time Call the subroutine for CCov(G’,k) 3Col(G) if and only if CCov(G’,k)

9 3Col and CCov: what is similar?
Both 3Col and CCov involve partitioning vertices into groups CCov: into k groups 3Col: into 3 color groups For two vertices u and v to be in the same group In CCov: u and v has to be adjacent In 3Col: u and v should NOT be adjacent

10 Reduction: 3Col to CCov Given graph G for which we want to determine 3-colorability (G is an instance of 3Col)‏ Produce G' which is a complement of G G' is a graph on the same vertex set, but (u,v) is an edge of G' if and only if it is not an edge of G Call Ccov(G', 3)‏ (G',3) is an instance of CCov

11 3-Colorable G’: Coverable by 3-cliques G: 3-colorable

12 Recall: To prove a problem Q to be NP- complete, we pick a known NP-complete problem P, and show P is polynomial-time reducible to Q. We need at least one known NP-complete problem to start the ball rolling!

13 Boolean Satisfiability Theorem
SAT (Boolean Satisfiability Theorem): Given a boolean formula, is there some way to assign truth values (0/1, false/true) to variables of the formula, such that the formula evaluates to true (1). A boolean formula is a logical formula which consists of variables xi and the logical operators, negation ( x ), boolean-or (x V y) and boolean-and (x Λ y) E.g. is satisfiable (evaluates to true) if x1=1, x2=0 and x3=0

14 Cook’s Theorem Cook’s Theorem: SAT is NP-complete Complicated proof
Requires background infor on Turing machines We will not cover

15 3SAT 3SAT: A restricted version of SAT which is the problem of determining whether a formula in 3-CNF is satisfiable 3-CNF (3-conjunctive normal form): boolean-and of clauses where each clause is the boolean-or of exactly 3 literals A literal is a variable or its negation E.g.

16 3SAT Proof of Cook’s theorem can be modified to prove that 3SAT is also NP-complete.

17 Independent Set (IS) Now that we know 3SAT is NP-complete, we can use it to prove other problems are NP- complete Independent Set (IS): Given an undirected graph G=(V,E) and an integer k, does G contain a subset V’ of k vertices such that no two vertices in V’ are adjacent to one another.

18 IS IS (shown in blue) of size 4.

19 Is IS NP-complete? Is IS in NP?
Certificate consists of k vertices in V’ Verify for each pair of vertices, u,v that there is no edge between them Verifiable in polynomial time

20 Is IS NP-complete? Is IS NP-hard?
Show that some known NP-complete problem (3SAT) is reducible to IS in polynomial time. 3SAT yes F (G,k) Reduction IS no F: boolean formula in 3-CNF

21 3SAT IS What is to be selected? Requirements: Restrictions:
3SAT: which variables are assigned true IS: which vertices are to be placed in V’ Requirements: 3SAT: Each clause must contain at least one literal whose value is true V’ must contain at least k vertices Restrictions: 3SAT: If x is assigned true then x must be false and vice versa. IS: If u is selected to be in V’, then vertices adjacent to u cannot be in V’

22 3SAT IS Given F (3-CNF), create G and set k
Create one vertex in G for each literal that appears in F The vertices are grouped into clause clusters. Assigning true to a literal from some clause corresponds to selecting a vertex to place in V’ Set k to be the number of clauses Forces IS to pick one vertex from each clause—thus one literal from each clause is true connect all vertices in the same clause cluster to each other to avoid IS selecting two literals from the same clause Put an edge between each literal and its negation To avoid IS placing both in V’ (to avoid assigning true to both)

23 Create one vertex in G for each literal that appears in F

24 connect all vertices in the same clause cluster to each other

25 Put an edge between each literal and its negation

26 Put an edge between each literal and its negation

27 Put an edge between each literal and its negation
k = 4

Download ppt "Clique Cover Cook’s Theorem 3SAT and Independent Set"

Similar presentations

Ads by Google