

















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
Some concept of Data Structures and Algorithm are Permutation, Representation, Implemented, Algorithm Design, Dynamic Programming, Graph Data Structures, String Processing, General Trees. Main points of this lecture are: Satisfiability, Subroutine, Decision Problem, Salesman, Traveling, Efficient Algorithm, Calls, Polynomial Number, Instance, Answers
Typology: Slides
1 / 25
This page cannot be seen from the preview
Don't miss anything!


















Suppose we are given a subroutine which can solve the traveling salesman decision problem in, say, linear time. Give an efficient algorithm to find the actual TSP tour by making a polynomial number of calls to this subroutine.
Now suppose my reduction translates G to Y in O(P (n)):
The second argument is the idea we use to prove problems hard!
Consider the following logic problem: Instance: A set V of variables and a set of clauses C over V. Question: Does there exist a satisfying truth assignment for C? Example 1: V = v 1 , v 2 and C = {{v 1 , v 2 }, {v 1 , v 2 }} A clause is satisfied when at least one literal in it is TRUE. C is satisfied when v 1 = v 2 =TRUE.
Satisfiability is known/assumed to be a hard problem. Every top-notch algorithm expert in the world has tried and failed to come up with a fast algorithm to test whether a given set of clauses is satisfiable. Further, many strange and impossible-to-believe things have been shown to be true if someone in fact did find a fast satisfiability algorithm.
Instance: A collection of clause C where each clause contains exactly 3 literals, boolean variable v. Question: Is there a truth assignment to v so that each clause is satisfied? Note that this is a more restricted problem than SAT. If 3 -SAT is NP-complete, it implies SAT is NP-complete but not visa- versa, perhaps long clauses are what makes SAT difficult?! After all, 1 -Sat is trivial!
If none of the original variables in a clause are TRUE, there is no way to satisfy all of them using the additional variable:
(F, F, T ), (F, F, T ),... , (F, F, F )
But if any literal is TRUE, we have n − 3 free variables and n − 3 remaining 3 -clauses, so we can satisfy each of them. (F, F, T ), (F, F, T ),... , (F, T, F),... , (T, F, F ), (T, F, F ) Any SAT solution will also satisfy the 3 -SAT instance and any 3 -SAT solution sets variables giving a SAT solution, so the problems are equivallent.
Note carefully the direction of the reduction. We must transform every instance of a known NP-complete problem to an instance of the problem we are interested in. If we do the reduction the other way, all we get is a slow way to solve x, by using a subroutine which probably will take exponential time. This always is confusing at first - it seems bass-ackwards. Make sure you understand the direction of reduction now - and think back to this when you get confused.
Instance: A graph G = (V, E), and integer k ≤ V Question: Is there a subset of at most k vertices such that every e ∈ E has at least one vertex in the subset?
Here, four of the eight vertices suffice to cover. It is trivial to find a vertex cover of a graph – just take all the vertices. The tricky part is to cover with as small a set as possible. Docsity.com
For each clause, we create three new vertices, one for each literal in each clause. Connect these in a triangle. At least two vertices per triangle must be in the cover to take care of edges in the triangle, for a total of at least 2 C vertices. Finally, we will connect each literal in the flat structure to the corresponding vertices in the triangles which share the same literal. v1 v1 v2 v2 v3 v3 v4 v
v3 v
v1 v4 v1 v
Any cover of G must have at least N + 2C vertices. To show that our reduction is correct, we must show that:
Every SAT defines a cover and Every Cover Truth values for the SAT! Example: V 1 = V 2 = T rue, V 3 = V 4 = F alse.
v1 v1 v2 v2 v3 v3 v4 v
v3 v
v1 v4 v1 v
As you can see, the reductions can be very clever and very complicated. While theoretically any N P -complete problem can be reduced to any other one, choosing the correct one makes finding a reduction much easier.
3 − Sat ∝ V C
As you can see, the reductions can be very clever and complicated. While theoretically any NP-complete problem will do, choosing the correct one can make it much easier.