Lecture #14:0.0.1 NP-Completeness (Chapter 34 — Old Edition — Chapter 36)Discussion here is from the old edition.0.0.2 Preliminaries:Definition 1 An abstract problem Q is a binary relations on a set I of probleminstancesandasetS of problem solutions.Example 2 SHORTEST-PATH : A n instance is a graph G =[V,E] and twovertices. A solution is an ordered sequence of vertices (possibly the empty se-quence if no path exists). A given instance may have more than one solution.Definition 3 A decision problem is a problem having a yes/no (or 0/1} solu-tion. So here the solution set S = {0, 1}.Many problems are of the optimization variety but have a correspondingdecision problem associated with them that come about very naturally. So wewill only consider decision problems from now on.Encodings: An encoding considered here is binary. A set S of abstractobjects is mapped by a mapping e : S 7→ {0, 1}∗. A problem whose instanceset is the set of binary strings is called a concrete problem. We say that analgorithm solves a concrete problem in time O(T (n)) if, when it is provided ainstance i of length n = |i|, it takes time at most O(T (n)).IfT (n)=O(nk)then we say that the problem is polynomial-time solvable. This notion canbe extended to abstract decision problem Q viaamappinge that maps aninstance i ∈ I to a string Q(i) in {0, 1}∗. Meaningless strings are mapped to 0.Complexity Classes: P is the class of concrete decision problems that arepolynomial-time solvable.0.0.3 Formal-Language Framework:Pis a finite set of symbols called an alphabet. A language L overPis anyset of strings made up of symbols inP. ε represents the empty string and φrepresents the empt y language.SoL ⊆P∗whereP∗is the language of allstrings onP.Operations: Union: L1∪ L2; intersection: L1∩ L2; complementation:P∗−L =¯L; concatenation: L = {x1x2: x1∈ L1,x2∈ L2}; Closure orKleene Star: L∗= {ε} ∪ L ∪ L2∪ L3∪ ...,whereLk= L concatenated withitself k times.Algorithm A accepts (rejects) astringx ∈ {0, 1}∗if given input x,thealgorithm outputs A(x) = 1(0).The language accepted by an algorithm Ais the set L = {x ∈ {0, 1}∗: A(x)=1}. Such an algorithm that accepts1L, may not reject x/∈ L.Alanguage L is decided by an algorithm A iff[x ∈ L] ⇒ [A(x)=1]and [x/∈ L] ⇒ [A(x)=0]. So every string is eitheraccepted or rejected. A language L is accepted in polynomial time by analgorithm A if for any n-length string x ∈ L, the algorithm accepts x in timeO(nk) for some fixed k. A language L is decided in polynomial time by analgorithm A if for any n-length string x, the algorithm decides x in time O(nk)for some fixed k.P = {L : there is an algorithm A that decides L in polynomial time} = {L :there is an algorithm A that accepts L in polynomial time}0.0.4 NP:Poly-time veri fication:A verification algorithm is a two-argument algorithm A, where one ar-gument is an input binary string x and the other is a binary string y called acertificate. A two-argument algorithm A verifies an input string x if there isa certificate y such that A(x, y)=1.Thelanguage verified by a verificationalgorithm A is L = {x ∈ {0, 1}∗: ∃y ∈ {0, 1}∗3 A(x, y)=1}.SoA verifies L iffor each x ∈ L,thereisay that A can use in proving that x ∈ L.Also,foranyx/∈ L,thereshouldbenosuchy proving that x ∈ L.Complexity Class NP: is the class of languages that can be verified by apolynomial-time algorithm. So L ∈ NP iff there is polynomial-time algorithmA and a constant c such thatL = {x ∈ {0, 1}∗: ∃y ∈ {0, 1}∗; |y| = O(|x|c) 3 A(x, y)=1}Algorithm A is said to verify language L in poly-time. If L ⊆ P then L ⊆NP since there is a poly-time algorithm to decide L,theverification algorithmsimply ignores the second argument. Hence P ⊆ NP; whether equalit y holds isthe famous problem.Open Question: Is the following true: [L ∈ NP] ⇒ [¯L ∈ NP]?If¯L ∈ NP then we say L is in the complexity class co-NP.Note: P ⊆ NP ∩ co − NP. Again we do not know if equality holds.0.0.5 NP-completeness and Reducibility:NPC is a subset of NP with the property that if an y problem in NPC has (ordoes not have) a poly-time algorithm then every problem in NP does (does not).So these are the hardest problems in NP. Language L1is poly-time reducibleto a language L2(written as L1≤pL2) if there exists a poly-time computablefunction f : {0, 1}∗7→ {0, 1}∗such that for all x ∈ {0, 1}∗[x ∈ L1] ⇔ [f(x) ∈ L2]f is called the reduction function and the poly-time algorithm that computesit is called a reduction algorithm.Lemma 4 [L1≤pL2; L2∈ P] ⇒ [L1∈ P ]20.0.6 NP-completeness:A language L is NP-complete if1. L ∈ NP,and2. L0≤pL for every L0∈ NP.If language satisfies only condition (2) it said to be NP-hard.Theorem 5 If any NP-complete problem is poly-time solvable, then P = NP.If any problem in NP is not poly-time solvable, then all NP-complete problemsare not poly-time solvable.First Problem: Circuit Satisfiability: "Given a boolean combinationalcircuit composed of AND, OR, and NOT gates, (shown below), is it satisfi-able?". We sa y that a one output boolean combinational circuit is satisfiable ithas a truth assignment (= a set of boolean input values) that causes the outputto be 1. For the circuit below: x1=1;x2=1,x3=0is such an assignment.Combinational elements: (nodes of this graph):NOT, AND, OR, NAND, NOR, XOR, AND(3)Combinational circuit is made up of such elements in an acyclic manner. Ex-ample: all lines are directed from left to right.x1x2x3x10x4x5x6x7x8x9Boolean Formula satisfiability:An instance of SAT is a boolean formula φ composed of :31. boolean variables2. boolean connectives: one or two inputs and one output, suc h as AND(∧), OR (∨), NOT (¬), implication (−→ ), if and only if (←→ ); and3. parenthesisExample:φ =((x1→ x2) ∨ ¬((¬x1←→ x3) ∨ x4)) ∧ ¬x2A truth assignment for a boolean formula φ is a set of values for thevariables in φ and a satisfying assignment is a truth assignment that causesit to evaluate to 1. If a satisfying assignment exists for a formula then it issatisfiable. SAT (satisfiability problem) asks if a given formula is satisfiable.For the example formula, x1=0;x2=0;x3=1=x4is a satisfying assignmentand hence φ above is satisfiable.Theorem 6 SAT∈ NPCProof.1. To show that SAT∈ NP:Certificate is the truth assignment that satisfiesthe formula. It is easy to check that the size of the certificate and theprocess of checking that φ
View Full Document