Some N P problems Computer scientists have studied many N P problems, that is, problems that can be solved nondeterministically in polynomial time. Traditionally complexity question are studied as languages: the cases that satisfy the stated conditions are described by strings in some language L, while those that do not are in L. We need to rephrase our intuitive understanding of the problem in terms of a language.
The class N P The class N P is the set of all languages that are polynomially decidable by a nondeterministic Turing machine. A nondeterministic algorithm operates in two phases : 1. Nondeterministically guess a solution (called a certificate) 2. Check whether the solution solves the problem (called verification) The second phase is called a verification algorithm and must take polynomial time.
SAT problem Example: Reconsider the SAT problem Suppose that a conjunctive normal form expression has length n, with m different literals (variable or negation of a variable): (x 1 x 2 ) (x 3 x 4 ) } {{ } n Since m < n, we take n as the problem size. We encode the conjunctive normal form expression as a string for a Turing machine: Σ = {x,,, (, ),, 0, 1} and the subscript of x is encoded as binary number: (x1 x 10) (x11 x100)
Example (continued): Since the subscript cannot be larger than m, the maximum length of any subscript is log 2 m. So, the the maximum encoded length of an n-symbol conjuctive normal form expression is O(nlogn) O(n 2 ). The next step is to nondeterministically create a certificate (assignments for the variables). This can be done in O(n) time (binary decision tree with 2 n leaves and O(n) height). The verification algorithm takes O(n 3 ) time: we check if the certificate makes the expression true (the encoded problem is O(n 2 ) and for each of the n variables we have to go through the entire encoded problem). SAT N P.
The CLIQUE problem Example: CLIQUE problem Let G = (V, E) be an undirected graph with vertices v 1, v 2,..., v n. A k-clique is a subset V k 2 V, such that there is an edge between every pair of vertices v i, v j V k. The clique problem is to decide if, for a given k, G has a k-clique. A deterministic search can examine all the elements of 2 V (exponential time-complexity). A nondeterministic algorithm guesses the correct subset (creating a certificate) and verifies the solution in deterministic polynomial time. CLIQUE N P.
N P problems There are many other such problems and all share the same characteristics: 1. All problems are in N P and have simple nondeterministic solutions. 2. All problems have deterministic solutions with exponential time complexity. One way to unify different cases is to see if we can reduce them to each other, in the sense if one is tractable, the others will tractable also. Cook-Karpe thesis: A problem that is in P is called tractable.
Polynomial time reduction Definition A language L 1 is said to be polynomial-time reducible to another language L 2 if there exists a deterministic Turing machine by which any w 1 in the alphabet of L 1 can be transformed in polynomial time to a w 2 in the alphabet of L 2 in such a way that w 1 L 1 if and only if w 2 L 2.
Polynomial time reduction Example: SAT problem is polynomial-time reducible to 3SAT. A restricted type of SAT is the 3SAT problem, in which each clause can have at most three literals: e 1 = (x 1 x 2 x 3 x 4 ) We introduce a new variable z and construct e 2 = (x 1 x 2 z) (x 3 x 4 z) If e 1 is true, one of the x 1, x 2, x 3, x 4 must be true. If x 1 x 2 is true, we choose z = 0, and e 2 is true. If x 3 x 4 = 1, we can choose z = 1 to satisfy e 2. Conversely, if e 2 is true, e 1 must also be true, so for satisfiability, e 1 and e 2 are equivalent. We run once through the expression (length n) and add new variables. The reduction runs in O(n).
Polynomial time reduction Example: 3SAT problem is polynomial-time reducible to CLIQUE. Consider e = (x 1 x 2 x 3 ) ( x 1 x 2 x 3 ) ( x 1 x 2 x 3 ) (x 1 x 2 x 3 ) We draw a graph in which each clause is represented by a group of three vertices and each literal is associated with one of the vertices. For each vertex in a group, we put an edge to all vertices of the other groups, unless the two associated literals are complements. Notice that the subgraph with ( x 2 ) 1, (x 3 ) 2, (x 3 ) 3, (x 1 ) 4 is a 4-clique and that x 2 = x 3 = x 1 = 1 is a variable assignment that satisfies e. It can be shown that the 3SAT problem can be satisfied if and only if the associated graph has a k-clique. The reduction can be done in deterministically polynomial time.
Polynomial time reduction The point of these polynomial time reductions is that we can now look at a given problem in several ways: Suppose we conjecture that SAT is tractable. If this is difficult to prove, we might try the simpler 3SAT case. If this does not work either, we can try to find an efficient algorithm for the CLIQUE problem. If any of the options can be shown to be tractable, we can claim that SAT is tractable.
N P-completeness and an open question There are a number of problems that are central to complexity study and are such that, if we completely understood one of them, we would understand the major issue involved in tractability. Definition A language L is said to be N P-complete if L N P and every L 1 N P is polynomial-time reducible to L. It follows from this definition that if L is N P-complete and polynomial-time reducible to L 1, then L 1 is also N P-complete. If we can find one deterministic polynomial-time algorithm for any N P-complete language, then every language in N P is also in P, that is, P = N P.
N P-completeness and an open question Do efficient algorithms exists for such problems? None have been found yet. This puts N P-completeness in the center of the question of the tractability of many important problems. The next result is known as Cook s theorem. Theorem The SAT problem is N P-complete. For every configuration sequence of a Turing machine one can construct a conjunctive normal form expression that is satisfiable if and only if there is a sequence of configurations leading to acceptance.
N P-completeness and an open question If we accept Cook s theorem, we immediately have a number of N P-complete problems: We have shown that SAT can be reduced to 3SAT, and that 3SAT can be reduced to CLIQUE. Therefore, 3SAT and CLIQUE are both N P-complete. There are many more problems that are known to be N P-complete. Efficient algorithms for any of these have been tried to find, so far without success. This leads us to conjecture that P N P, and that many important problems are intractable. P versus N P remains the fundamental open problem in computer science.
References LINZ, P. An introduction to Formal Languages and Automata. Jones and Bartlett Learning, 2012.