Description:

  • Decision problem

P:

  • Stands for “polynomial time.”
  • Represents the class of problems that can be solved by a deterministic Turing Machine in polynomial time
  • ex:

NP:

  • Stands for “nondeterministic polynomial time.”
  • Represents the class of problems where a solution can be verified in polynomial time on a non-deterministic Turing machine
  • Meaning it is hard to find solution but checking a potential solution is easy
  • ex: Factoring
    • Suppose that X is a problem in P.
    • By definition, there exists a poly-time algorithm A that solves X.
    • Certificate:
    • Certifier

NP-Hard:

  • A problem Y (probably not in NP) with the property that for every problem X in NP,
    • If P ≠ NP, then NP-hard problems could not be solved in polynomial time.
    • All NP-complete problems are also NP-hard
    • There are decision problems that are NP-hard but not NP-complete (halting problem)
    • SAT can be reduced to the halting problem
  • Halting Problem

NP-Complete:

  • A problem is NP-complete if it is both:
    • In NP: A solution can be verified in polynomial time.
    • NP-hard: Any problem in NP can be reduced to it in polynomial timete
  • A problem Y in NP with the property that for every problem X in NP,
  • theorem Suppose Y is an NP-Complete problem. Then Y is solvable in poly-time iff
  • ex:
    • Hamilton Cycle
    • Boolean Stisfiability Problem
      • Prove 3-SAT is NP Complete: Suffices to show that CIRCUIT-SAT 3-SAT since 3-SAT is in NP
        • Let be any circuit.
        • We associate a variable with each node of the circuit
        • If node is labeled with , and its only entering edge is from node : we add two clauses , and .
        • If node is labeled with , and its two entering edges are from nodes and , we add the following clauses: , and ,
        • If node is labeled with , and its two entering edges are from nodes and : we add the following clauses: , and .
        • For a source that has been labeled with a constant value, we add a clause with the single variable or
        • For the output node o, we add the single-variable clause
      • example of reduction:
        • Create an instance of 3-SAT with 6 variables: , corresponding to 6 circuit elements
        • Make circuit compute correct values at each node
          • add 2 clauses:
          • add 3 clauses:
          • add 3 clauses:
        • Hard-coded input values and output value
          • add 1 clause:
          • add 1 clause:
        • Final step: turn clauses of length into clauses of length exactly 3
      • Suppose that the given circuit K is satisfiable. The satisfying assignment to the circuit inputs can be propagated to create values at all nodes in K. This set of values clearly satisfies the constructed 3-SAT instance.
      • Suppose that the constructed 3-SAT instance is satisfiable, with a satisfying. Look at the values of the variables corresponding to the circuit K’s inputs, and claim that these values constitute a satisfying assignment for the circuit K. This is because the 3-SAT clauses ensure that the values assigned to all nodes of K are the same as what the circuit computes for these nodes.
    • Independent Set
    • Subset Sum Problem
    • Knapsack Problem
    • Circuit Satisfiability Problem
  • Proving NP-compleness:
    • Given an NP-complete problem, how to prove that a problem Y is NP-complete.
      • Step 1. Show that Y is in NP.
      • Step 2. Choose an NP-complete problem X.
      • Step 3. Prove that
    • Justification. If X is an NP-complete problem, and Y is a problem in NP with the property that then Y is NP-complete.
    • Proof. Let W be any problem in NP. Then
      • By transitivity, . Hence Y is NP-complete
    • Refined strategy:
      • Step 1: Prove that X ∈ NP.
      • Step 2. Choose a problem Y that is known to be NP-complete.
      • Step 3. Consider an arbitrary instance s(Y) of problem Y, and show how to construct, in polynomial time, an instance s(X) of problem X that satisfies the following properties:
        • (a) If s(Y) is a YES-instance of Y, then s(X) is a YES-instance of X.
        • (b) If s(X) is a YES-instance of X, then s(Y) is a YES-instance of Y