Size of input:

  • Total number of (binary bits) for encoding the input, for int is
  • ex, Encoding:

Computational tracability:

  • A problem is computational tractable if it admits a polynomial-time algorithm
    • otherwise intraceable
  • Traceable problems:
  • Probably intractable:
    • Hamiltonian path:
    • Subset sum
    • Knapsack:

Polynomial-time reduction:

  • : Problem X polynomial reduces to problem Y if arbitrary instances of problem X can be solved using:
    • Polynomial number of computational steps
    • then polynomial number of calls to oracle that solves problem Y
  • We pay for time to write down instances sent to black box instances of Y must be of polynomial size
  • If we have problem , we can turn it to another problem with polynomial time
    • example: graph is maximum matching problem, add a source node and link to all nodes from A and all nodes from be link to a sink, therefore reduce to polynomial complexity of
  • Purpose. Classify problems according to relative difficulty.
  • Designing algorithms. If and Y can be solved in polynomial-time, then can also be solved in polynomial time.
  • Proving intractability. If and X cannot be solved in polynomial-time, then Y cannot be solved in polynomial time.
  • Establishing equivalence. If and , then

Reduction strategies:

  • Reduction by simple equivalence
    • Independent Set
    • Vertex Cover: Given a graph and an integer ,
      • is there a subset of vertices such that , and for each edge, at least one of its endpoints is in ?
    • Claim: Vertex coverd Independent set
      • proof: we show is an independent set iff

          - Let S be any independent set, consider an arbitrary edge $(u,v)$
          - S is independent $\to u\not \in S$ or $v\not \in S\to u \in V\backslash S$ or $v\in V\backslash S$
          - Thus $V\backslash S$ covers edge $(u,v)$
        
        - - Let be any vertex cover, consider 2 nodes and - Observe that since is a vertex cover - Thus, 2 nodes in are joined by an edge is an independent set
  • Reduction from special case to general case
    • Set cover: Given a set of elements, a collection of subsets of U, and an integer , does there exist a collection of of these sets whose union is equal to ?
    • Claim: Vertex-cover Set-cover
      • Proof: Given a VERTEX-COVER instance , we construct a set cover instance whose size equals the size of the vertex cover instance
      • Construction: Create SET-COVER instance:
      • Set-cover of size iff vertex cover of size
  • Reduction by encoding with gadgets
    • Boolean Stisfiability Problem:
      • Literal: a boolean var, and
      • Clause: A disjunction of literals:
      • Conjuntive Normal Form, CNF: A propositional fornula that is the conjunction of clauses
      • Given CNF formula , does it have a satisfying truth assignment? if yes is satisfiable
        • 2-SAT, 3-SAT, n-SAT: Boolean Satisfaction problem where each clause contains exactly 2 literals
    • Claim: 3-SAT Indepdent-set
      • Given an instance of 3-SAT, we construct an instance of INDEPENDENT-SET that has an independent set of size k iff is satisfiable
      • Construction.
        • G contains 3 vertices for each clause, one for each literal.
        • Connect 3 literals in a clause in a triangle.
        • Connect literal to each of its negations
      • Claim: contains independent set of size iff is satisfiable
  • Transitivity: If and then

Types of problems:

  • A problem can be 1 or combination of these types
    • Decision Problem
      • P-class, polynomial includes:
      • Not known to be in P:
        • HAMILTONIAN CYCLE
        • SUBSET SUM
        • PARTITION
        • KNAPSACK
        • INDEPENDENT SET
        • SET COVER
        • VERTEX COVER
        • SAT
        • 3-SAT
        • and many others
    • Search Problem
    • Optimizatino Problem

Solving and checking:

  • Solving a problem might not be polynomial but checking a possible solution is poly-time
  • Efficient certification:
    • A “checking” algorithm for a decision problem X has a different structure from an algorithm that solves X
    • Certificate: a (possible) solution t
    • Certifier: a checking algorithm
  • An algorithm B is an efficient certifier for a problem X if, for every instance s of X, and for every candidate t
    • B has polynomial running time (in the size of s and t), and
    • B can verify whether t is a solution to s
  • ex:
    • Independent Set
      • Certificate: t is a set of at least k vertices
      • Certifier: verifies that no pair of these vertices are connected to an edge
    • Is a given nb composite
      • certificate is a non-trivial factor t of n
      • certifier is a function to check if t is divisible by n
    • Hamilton Cycle
      • Certificate. A permutation of the n nodes
      • Certifier. Check that the permutation contains each node in V exactly once, and that there is an edge between each pair of adjacent nodes in the permutation
    • Boolean Stisfiability Problem:
      • Certificate. An assignment of truth values to the n boolean variables.
      • Certifier. Check that each clause in s has at least one true literal