CMPUT 671 Hard Problems - PowerPoint PPT Presentation

About This Presentation
Title:

CMPUT 671 Hard Problems

Description:

CMPUT 671 Hard Problems Winter 2002 Joseph Culberson Home Page – PowerPoint PPT presentation

Number of Views:36
Avg rating:3.0/5.0
Slides: 23
Provided by: joecul
Category:
Tags: cmput | cormen | hard | problems

less

Transcript and Presenter's Notes

Title: CMPUT 671 Hard Problems


1
CMPUT 671Hard Problems
  • Winter 2002
  • Joseph Culberson Home Page

2
What are you doing?
3
What are you doing?
What am I doing?
4
What is Hard?
  • Problems and Complexity
  • P, NP, PSPACE between and beyond
  • Worst case, Randomized, Average case

What are you doing?
What am I doing?
5
What is Hard?
  • Problems and Complexity
  • P, NP, PSPACE between and beyond
  • Worst case, Randomized, Average case
  • Instances and Algorithms
  • Some instances may be easy for some algorithms
  • Hard instances for classes of algorithms

What are you doing?
What am I doing?
6
What is Hard?
  • Problems and Complexity
  • P, NP, PSPACE between and beyond
  • Worst case, Randomized, Average case
  • Instances and Algorithms
  • Some instances may be easy for some algorithms
  • Hard instances for classes of algorithms
  • Ensembles and Phase Transitions
  • - Most instances may be easy
  • - Hard instances may be concentrated
  • - Hard random instances for classes of
    algorithms
  • - Generation

What are you doing?
What am I doing?
7
Background
  • Asymptotic notation and algorithm analysis
  • Problems, Complexity Classes, Reductions and
    Completeness (P to NPc)
  • Backtrack Search, Stochastic Search
  • Graphs and some graph theory
  • Probability (as background to random graphs and
    structures)

8
Problems
  • A Problem is a set of instances and queries.
  • An instance is a structure (versus language)
  • Queries are universal
  • e.g. Graph k-coloring
  • Instance A graph G and integer k
  • Query Is G k-colorable?
  • e.g. MST union TSP
  • Instance A weighted graph G, integers B1,B2
  • Query Does G have a spanning tree of weight B1
    or a tour of weight B2? (Set one to 0)

9
Measuring Resources
  • Time
  • Instance I
  • n Size(I) Formally, the number of bits in an
    encoding (logarithmic model) but mostly we will
    use the uniform model, e.g. the number of
    vertices and edges of a graph.
  • T(I) number of steps in computation to answer
    the query. Formally, on a model of computation,
    typically a RAM.

10
Measuring Resources
  • Time (continued)
  • Worst Case
  • T(n) max T(I) size(I) n
  • Average Case
  • A(n) sum T(I) Prob(I) size(I) n
  • Note distribution dependent!
  • Typically all instances of size n equally likely,
    but this may not be representative of the real
    world

11
Measuring Resources
  • SPACE
  • Similar, but measures number of memory cells
    required.
  • Formally, each cell must be of fixed size, e.g.
    number of bits fixed.
  • For certain purposes, e.g. O(log n) memory
    requirements, we exclude size of input memory.
    (Likely not relevant to this course)

12
Asymptotic Notation
13
Types of Problems
  • Optimization
  • Given G find the minimum number of colors
    required to color it.
  • Functional
  • Given G find an optimal coloring
  • Given G and k find a k-coloring if one exists
  • Enumeration and Generation (listing)
  • Decision (Yes/No)
  • Given G and k is there a k-coloring of G?

14
The Class P
  • P is the set of decision problems for which there
    exists a polynomial time algorithm.
  • i.e. O(nk) for some fixed k.
  • n is the size of the input.
  • See Garey and Johnson, Brassard and Bratley,
    Sipser, Cormen et al.

15
The Class NP
  • NP is the set of decision problems for which
    there exists a non-deterministic algorithm that
    solves the yes instances of the problem in
    polynomial time.
  • (GJ, BB) The algorithm non-deterministically
    writes out a solution (certificate) and in time
    polynomial in the input size verifies that the
    answer is yes.
  • E.g. Coloring
  • Certificate cV -gt 1..k
  • verify for each edge e (u,v), c(u) not c(v)

16
Class CO-NP
  • The set of problems whose NO instances are solved
    by a poly-time non-deterministic algorithm the
    complement of NP wrt Yes/No
  • In Language Terms
  • Note that P is in the intersection of NP and
    CO-NP
  • Why?

17
  • We no of know certificate we can use to verify
    that G is not k-colorable in poly-time.
  • The Questions
  • P ? NP ? CO-NP ?
  • The first asks if there is a polynomial time
    deterministic algorithm to solve all NP problems
  • The second asks is there a polynomial time
    non-deterministic algorithm to solve all of CO-NP

18
Reductions
  • Polynomial time many one reduction
    (transformation) from problem P to problem Q
  • fP-gtQ Maps instances
  • x in Y(P) iff f(x) in Y(Q)
  • f is computable by a polynomial time
    deterministic algorithm.

19
Reductions
Example Graph 3-coloring to 3-SAT
Can also add 2-clauses restricting each vertex
to at most one color
20
Class NPc
  • A subclass of NP, Q in NPc iff for every problem
    P in NP there is a polynomial time many reduction
    from P to Q.
  • Cooks theorem showed that SAT is in NPc.
  • Create a set of clauses which model the possible
    execution of the NDTM that solves the problem.

21
Showing a Problem is in NPc
  • To show a problem Q is NP-complete
  • Show Q is in NP, that is, specify a certificate
    that can be verified in polynomial time
  • Choose a problem P in NPc and provide a
    polynomial time reduction from P to Q.
  • The second alone shows it is NP-hard

22
  • Only applies to worst case
Write a Comment
User Comments (0)
About PowerShow.com