1 / 143

Lecture 6: Computational Complexity

Lecture 6: Computational Complexity. 虞台文. 大同大學資工所 智慧型多媒體研究室. Content. Time-Bounded Turing Machine Rate of Growth Functions Time-Bound Simulations P and NP NP –Completeness Bounded Halting Problems Some Important NP -Complete Problems. Lecture 6: Computational Complexity.

Download Presentation

Lecture 6: Computational Complexity

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. Lecture 6: Computational Complexity 虞台文 大同大學資工所 智慧型多媒體研究室

  2. Content • Time-Bounded Turing Machine • Rate of Growth Functions • Time-Bound Simulations • P and NP • NP –Completeness • Bounded Halting Problems • Some Important NP-Complete Problems

  3. Lecture 6: Computational Complexity Time-Bounded Turing Machine 大同大學資工所 智慧型多媒體研究室

  4. Not Solvable Solvable Computational Effectiveness for Solvable Problems Can such a problem, e.g., TSP, be solved in any practical sense?

  5. ├ ├ ├ ├ Yields in t Steps iff iff such that and

  6. Let T: N N be a function. Let L  be a language, and let be a k-tape TM with 0  . We say that MdecidesL in time T if the following holds: ├ for some t  T(|w|); ├ for some t  T(|w|); Time-Bounded TM • w L  • w L 

  7. TIME(T) We say that L is decidable in time T if there is some k-tape TM (k > 0) that decidesL in time T. The class of all languagesdecidable in time T is denoted by

  8. Head # w # Head # Y/N # >L # >L # # # RYR RNR Absolute Time Bound (2n + 4) n • |w|+1 writing steps • |w|+3 head-moving steps erase w(write ‘#’) write ‘Y’ or ‘N’

  9. Lecture 6: Computational Complexity Rate of Growth Functions 大同大學資工所 智慧型多媒體研究室

  10. Time-Bound Notations • Upper Bound • Lower Bound • Exact Bound

  11. Fact: Time-Bound Notations • Upper Bound • Lower Bound • Exact Bound

  12. Lemma

  13. For a, we need to prove and . Lemma Pf) c Therefore, we have to find c(exercise) such that

  14. Lemma Pf) Since f = O(nd), we only need to show that nd= O(nd+1), which is trivially satisfied because nd nd+1 for all n 0. Suppose that nd+1 = O(nd), Then, nnd = nd+1  cnd for n  n0. But for any c, when n > c, nd+1  cnd. 

  15. Theorem

  16. Theorem Pf) Because f = O(nd), we only need to prove that nd = O(rn), i.e., k terms

  17. Theorem Pf) Because f = O(nd), we only need to prove that nd = O(rn), i.e., Hence, nd = O(rn). Let

  18. Lecture 6: Computational Complexity Time-Bound Simulations 大同大學資工所 智慧型多媒體研究室

  19. Not Solvable Solvable Time-Complexities on TMs The complexities to solve problems on different TMs are different.

  20. Theorem 1 where

  21. Theorem 2 where

  22. Conclusions • A polynomial algorithm of any TM can be simulated using some polynomial algorithms of other TM’s. • In the following, we consider two classes of problems: • Polynomial algorithms (P) • Exponential algorithms (NP) ?

  23. Lecture 6: Computational Complexity P and NP 大同大學資工所 智慧型多媒體研究室

  24. Definition (P ) That is, Pdenotes the class of all languages that are decided by TM’s in some polynomial time bounds.

  25. Does have solution in 0 and 1? 0-1 Example: (Integer Programming) Matrix formulation: Given A and b, is there any binary vector x such that

  26. No answer! Given A and b, is there any binary vector x such that Example: (Integer Programming) A b x Encode: Language

  27. No answer! Given A and b, is there any binary vector x such that Example: (Integer Programming) Language Language Yes, it is. Fact:

  28. For all , ├ Definition MacceptsL in nondeterministic timeT if the following holds for some u, v*,  , and t T(|w|). We say that L is acceptable in nondeterministic timeT if there is an NTM that acceptsL in nondeterministic time T.

  29. What is the difference between TIME(T) and NTIME(T)? Definition The class of languages acceptable in nondeterministic time T.

  30. Definition (NP ) That is, NPdenotes the class of all languages that are accepted by NTM’s in some nondeterministic polynomial time bounds.

  31. Definition (Step Counting Function) f : NN is a step-counting function if  a k-tape Turing machine M such that for all w*, M halts in exactly f(|w|) steps on input w, i.e., for some u1, …, uk, v1, …, vk * and a1, …, ak.

  32. Exercise Given d >0, there exists a polynomial p of degree dbeing a step counting function.

  33. See text for the proof. Theorem 3 Let L be a language accepted in time T1 by a NTM M1=(K1, 1, 1, s1) whereT1 is a step counting function.  A k2-tape DTM M2=(K2, 2, 2, s2) decides L in time T2 where

  34. Polynomial Balanced Languages Let L *$*be a language, where $. Then, L is said to be polynomial balanced if there exists a polynomial p such that

  35. Theorem 4 Let L * be a language, $ and ||2. L NP iff L’ *$*such that where L’ is a polynomial balanced language.

  36. Let L * be a language, $ and ||2. L NP iff L’ *$*such that where L’ is a p.b.l. M: >$(1) M’: M’’: . . . >RNR >RNR M’’ Theorem 4 Pf) “” L’ is a p.b.l.  Polynomial p s.t. x$yL’ only if |y|  p(|x|). • k–tape DTM M’ that decides L’ in time q (a polynomial). L’P To prove L NP, we construct an NTM M based on M’ to accept L as follows:

  37. Let L * be a language, $ and ||2. L NP iff L’ *$*such that where L’ is a p.b.l. M: >$(1) M’: M’’: . . . >RNR >RNR M’’ Theorem 4 M can be accept L in nondeterministic time p + q. Hence, L NP. Pf) “” L’ is a p.b.l.  Polynomial p s.t. x$yL’ only if |y|  p(|x|). • k–tape DTM M’ that decides L’ in time q (a polynomial). L’P To prove L NP, we construct an NTM M based on M’ to accept L as follows:

  38. Let L * be a language, $ and ||2. L NP iff L’ *$*such that where L’ is a p.b.l. Theorem 4 Pf) “” We shall show that L’ = {x$Y(x) : x  L, |Y(x)|  p(|x|)}, where p is a polynomial, such that L’P, i.e.,  a DTMM’can decidesL’ in polynomial time. Y(x)=? M’ =?

  39. Let L * be a language, $ and ||2. L NP iff L’ *$*such that where L’ is a p.b.l. . . . ├M ├M ├M Theorem 4 Pf) “” Since LNP, an NTM M that accept L in nondeterministic time q (a polynomial). Let  be the encoding function that encodes TM’s and their memory configurations in {I, c}*. That is, given xL, we have such that Let Y(x)be the set of all strings where M is the NTM that accepts L.

  40. Let L * be a language, $ and ||2. L NP iff L’ *$*such that where L’ is a p.b.l. Theorem 4 Pf) “”  q(|x|) to be discussed constant accept in time q input length

  41. Let L * be a language, $ and ||2. L NP iff L’ *$*such that where L’ is a p.b.l. Theorem 4 Pf) “”  q(|x|)

  42. Let L * be a language, $ and ||2. L NP iff L’ *$*such that where L’ is a p.b.l. Theorem 4 Pf) “” Polynomial of |x|

  43. Let L * be a language, $ and ||2. L NP iff L’ *$*such that where L’ is a p.b.l. Theorem 4 Pf) “” Let L’ is polynomial balanced.

  44. Let L * be a language, $ and ||2. L NP iff L’ *$*such that where L’ is a p.b.l. Theorem 4 Pf) “” ? Let L’ is polynomial balanced.

  45. Let L * be a language, $ and ||2. L NP iff L’ *$*such that where L’ is a p.b.l. Theorem 4 Pf) “” • We now show that L’P by designing a DTM M’ which decides L’ as follows: • Check the syntax of the input string • To verify the following things: • Is Cj a configuration of M? • C0 = (s, #x#)? • Ct = (h, uv)? • If rejected, print out ‘N’ then halt. This steps requires O(n) time. • Check Cj├M Cj+1, j= 0, …, t1 by consulting (M). If rejected print out ‘N’ and then halt. This steps requires O(n2). • Therefore, L’P.

  46. Example (Integer Programming BNP )

  47. Example (Integer Programming BNP ) No answer

  48. P  NP NP  P Show and P NP How to show? Is P = NP ? Trivial (why?) Difficult No answer, now.

  49. 2 1 3 5 8 4 7 6 Example (TSPNP ) TSPF Find the shortest tour t.

  50. 2 1 3 5 8 4 7 6 t is a bijection E.g., Example (TSPNP ) TSPF Find the shortest tour t. It is not language decision problem. Rather, it is a problem of function evaluation.

More Related