
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
The np-completeness of the clique problem in computer science. The author, mike kowalczyk, explains how the clique problem is in np and reduces 3-sat to clique. The document also demonstrates that if a 3-sat instance is satisfiable, then the corresponding clique instance is a 'yes', and vice versa. Essential for students studying algorithms and complexity theory.
Typology: Study notes
1 / 1
This page cannot be seen from the preview
Don't miss anything!
Algorithm Design and Analysis 4/15/
Instructor: Mike Kowalczyk
The decision problem clique is defined to be the following: Input: graph G = (V, E) and an integer k. Output: “yes” if there is a clique of size k in G, “no” otherwise. A clique of size k is k vertices that all have edges going to each other. We would like to show that the clique problem is NP-Complete. We will do this by showing that 3-SAT ≤Pm clique, and clique ∈ NP. Let’s show that clique is in NP first. Nondeterministically create a different branch for every possible subset S ⊆ V of size k. Then each branch checks to see if all
(k 2
possible edges are there for that vertex subset S. If so, it returns “yes”, and “no” otherwise. If there is a clique of size k in G, then some branch will guess the right subset and verify it has all the edges and return “yes”, which makes the whole machine return “yes”. If there is no clique of size k, then all branches return “no” and so the whole machine returns “no”. The number of branhes required is
(n k
, where n is the number of vertices. If the nondeterminstic machine makes 2 branches at every time step, then in n lg n steps, it can get 2n^ lg^ n^ = nn^ branches, and nn^ ≥ n! ≥
(n k
. Each branch checks for at most n^2 edges. So then, it runs in polynomial time in the size of the input. Let’s do the reduction now. We want to reduce 3-SAT to clique. Given a boolean formula φ, we create a graph G = (V, E) as follows. For every clause in φ, we create 3 vertices corresponding to the literals in that clause. We introduce an edge between vertices from different clauses if and only if those two variables are consistent (meaning it’s not the case that one is the negation of the other). As we will see, G has a clique of size m if and only if φ is satisfiable, so the reduction maps φ to (G, m). Now we show that if the instance of 3-SAT is a “yes” then the instance of clique is a “yes” as well. If the 3-SAT instance is a “yes” then there is a truth assignment (true and false values assigned to the variables) such that every clause has a true literal. By selecting a corresonding vertex to a true literal in each clause, then we see that we have a clique in G of size m (where m is the number of clauses), because if there was a missing edge that would mean that our truth assignment effectively set something to be true and false at the same time! Now assume there is a clique of size m where m is the number of clauses. We need to show that there must be a truth assignment that satisfies the above boolean formula. We claim that the truth assignment induced by the labels of the vertices satisfies φ. This assignment is well-defined because every pair of vertices in the clique has an edge, which precludes the possibility of some variable being set to both true and false. Furthermore, since every trio of vertices corresponding to a clause has no edges between those vertices, we must have a vertex from every clause gadget in our clique. This shows that the corresponding clauses are satisfied in φ and φ is satisfied by our assignment. Finally, creating this graph based on an input formula takes only polynomial time (the construction can be carried out by a few simple for loops). We conclude that clique is NP-complete.