1 / 11

CS 155, Programming Paradigms Fall 2014, SJSU nondeterminism

CS 155, Programming Paradigms Fall 2014, SJSU nondeterminism. Jeff Smith. NP and nondeterminism. The definition of NP depends on the notion of nondeterminism And it’s easiest to define nondeterminism in terms of the state of a computation

Download Presentation

CS 155, Programming Paradigms Fall 2014, SJSU nondeterminism

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CS 155, Programming ParadigmsFall 2014, SJSUnondeterminism Jeff Smith

  2. NP and nondeterminism • The definition of NP depends on the notion of nondeterminism • And it’s easiest to define nondeterminism in terms of the state of a computation • here, the term state includes information like the values of variables and other memory contents • so the closest CS 154 concept is instantaneous description (ID) rather than state.

  3. Models of nondeterminism • There are several useful models of nondeterministic computation. • In each model, we think of computation as proceeding from state to state. • All of these models are equivalent -- they describe the same class of (nondeterministic) algorithms.

  4. Nondeterministic Turing machines • Nondeterministic Turing machines: a transition function gives the possible successors of a given ID • control may pass to any of the successors. • This model is what we’ll use to show that there’s a hardest problem in NP.

  5. Unbounded parallelism and decision trees • In unbounded parallelism, each successor state is assigned to a newly allocated processor • In decision trees, states are represented as tree nodes, • where state T is a child of state U iff T can be reached from U by a single decision.

  6. Nondeterministic time complexity • In each of the three models above, it's natural to define (nondeterministic) time complexity to be the length of a shortest accepting computation. • This is a natural concept in each model. • To define the length of the input, we use the length of the string that represents the instance.

  7. Guessing and verifying • In the guessing and verifying model, a solution is guessed in a preliminary guessing phase • where each guess takes O(1) time, • and must select from a bounded set of possible choices. • The solution is then verified deterministically • This is the model we'll use most.

  8. Verifying without guessing • Sometimes this model is taken to have only a guessing phase • The sequence of guesses is replaced by a bit string called the certificate • which is the input to the verification process • CLRS takes this approach, on p.1064 • note that they need to stipulate that the certificate has polynomial length • corresponding to a polynomial number of guesses

  9. Time complexity of guessing and verifying • Time complexity in the guess-and-verify model is computed as always … • Except that if verification fails, the time complexity is irrelevant • formally, it’s taken to be O(1) in this case • note that this gives an asymmetry between success and failure

  10. Defining the class NP • The class NP = {P | P has a nondeterministic polynomial-time solution algorithm}. • Its membership does not depend on which model of nondeterminism is used to define it. • a polynomial-time algorithm in one model takes polynomial time in every other model • So this definition of NP now gives us a precise definition of NP-completeness.

  11. NP-completeness • The hardest problems in NP are the problems P such that Q α P for every Q in NP. • Such problems are called NP-complete. • It’s not obvious that such problems exist • but they do! • If an NP-complete problem is in P, then P=NP. • it’s not known whether this is the case • that is, we don’t know whether these apparently hard problems are actually hard

More Related