Overview of Computational Complexity Theory: Savitch's Theorem, PSPACE, and NL-Completeness

Slide Note
Embed
Share

This lecture delves into Savitch's theorem, the complexity classes PSPACE and NL, and their completeness. It explores the relationship between time and space complexity, configuration graphs of Turing machines, and how non-deterministic space relates to deterministic time. The concept of configuration graphs is explained, showcasing how they determine the acceptance of inputs, and a proof of NSPACE(S(n)) ⊆ DTIME(2^(O(S(n)))) is provided.


Uploaded on Sep 12, 2024 | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. Download presentation by click this link. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

E N D

Presentation Transcript


  1. Computational Complexity Theory Lecture 8: Savitch s theorem; PSPACE and NL-completeness Indian Institute of Science

  2. Recap: Relation between time & space Obs. DTIME(S(n)) DSPACE(S(n)) NSPACE(S(n)). Theorem. NSPACE(S(n)) DTIME(2O(S(n))), if S is space constructible. EXP PSPACE NP co-NP P NL L

  3. Recap: Configuration graph Definition. A configuration of a TM M on input x, at any particular step of its execution, consists of (a) the nonblank symbols of its work tapes, (b) the current state, (c) the current head positions. It captures a snapshot of M at any particular moment of execution. Input head index Work tape head index b1 bS(n) State info Note: A configuration C can be represented using O(S(n)) bits if M uses S(n) log n space on n-bit inputs.

  4. Recap: Configuration graph Definition. A configurationgraph of a TM M on input x, denoted GM,x, is a directed graph whose nodes are all the possible configurations of M on input x. There s an edge from one configuration C1 to another C2, if C2 can be reached from C1 by an application of M s transition function(s). Number of nodes in GM,x = 2O(S(n)), if M uses S(n) space on n-bit inputs

  5. Recap: Configuration graph Definition. A configurationgraph of a TM M on input x, denoted GM,x, is a directed graph whose nodes are all the possible configurations of M on input x. There s an edge from one configuration C1 to another C2, if C2 can be reached from C1 by an application of M s transition function(s). C2 C2 1 1 C1 C1 0 C3 Conf. graph of a DTM Conf. graph of an NTM

  6. Recap: Configuration graph Definition. A configurationgraph of a TM M on input x, denoted GM,x, is a directed graph whose nodes are all the possible configurations of M on input x. There s an edge from one configuration C1 to another C2, if C2 can be reached from C1 by an application of M s transition function(s). M accepts x if and only if there s a path from Cstart to Caccept in GM,x.

  7. Recap: Relation between time & space Obs. DTIME(S(n)) DSPACE(S(n)) NSPACE(S(n)). Theorem. NSPACE(S(n)) DTIME(2O(S(n))), if S is space constructible. Proof. Let L NSPACE(S(n)) and M be an NTM deciding L using S(n) space on length n inputs. On input x, compute the configuration graph GM,x of M and check if there s a path from Cstart to Caccept . Running time is 2O(S(n)).

  8. Recap: PATH is in NL PATH = {(G,s,t) : G is a directed graph having a path from s to t}. Obs. PATH is in NL. EXP PSPACE NP co-NP P NL PATH L

  9. Recap: UPATH is in L UPATH = {(G,s,t) : G is an undirected graph having a path from s to t}. Theorem (Reingold). UPATH is in L. EXP PSPACE Is PATH in L ? more on this later. NP co-NP P NL UPATH L

  10. PSPACE = NPSPACE

  11. Savitchs theorem Theorem. NSPACE(S(n)) DSPACE(S(n)2), where S(n) is space constructible. (So, PSPACE = NPSPACE) Proof. Let L NSPACE(S(n)), and M be an NTM requiring O(S(n)) space to decide L. We ll show that there s a TM N requiring O(S(n)2) space to decide L.

  12. Savitchs theorem Theorem. NSPACE(S(n)) DSPACE(S(n)2), where S(n) is space constructible. (So, PSPACE = NPSPACE) Proof. Let L NSPACE(S(n)), and M be an NTM requiring O(S(n)) space to decide L. We ll show that there s a TM N requiring O(S(n)2) space to decide L. On input x, N checks if there s a path from Cstart to Caccept in GM,x as follows: Let |x| = n.

  13. Savitchs theorem Theorem. NSPACE(S(n)) DSPACE(S(n)2), where S(n) is space constructible. (So, PSPACE = NPSPACE) Proof. N computes m = O(S(n)), the no. of bits required to represent a configuration of M. It also finds out Cstart and Caccept. Then N checks if there s a path from Cstart to Caccept of length at most 2m in GM,x recursively using the following procedure. REACH(C1, C2, i) : returns 1 if there s a path from C1 to C2 of length at most 2i in GM,x; 0 otherwise.

  14. Savitchs theorem Theorem. NSPACE(S(n)) DSPACE(S(n)2), where S(n) is space constructible. (So, PSPACE = NPSPACE) Space constructibility of S(n) used here Proof. N computes m = O(S(n)), the no. of bits required to represent a configuration of M. It also finds out Cstart and Caccept. Then N checks if there s a path from Cstart to Caccept of length at most 2m in GM,x recursively using the following procedure. REACH(C1, C2, i) : returns 1 if there s a path from C1 to C2 of length at most 2i in GM,x; 0 otherwise.

  15. Savitchs theorem Theorem. NSPACE(S(n)) DSPACE(S(n)2), where S(n) is space constructible. (So, PSPACE = NPSPACE) Proof. REACH(C1, C2, i) { If i = 0 check if C1 and C2 are adjacent. Else, for every configurations C, a1 = REACH(C1, C, i-1) a2 = REACH(C, C2, i-1) if a1=1 & a2=1, return 1. Else return 0. }

  16. Savitchs theorem Theorem. NSPACE(S(n)) DSPACE(S(n)2), where S(n) is space constructible. (So, PSPACE = NPSPACE) Proof. REACH(C1, C2, i) { If i = 0 check if C1 and C2 are adjacent. Else, for every configurations C, a1 = REACH(C1, C, i-1) a2 = REACH(C, C2, i-1) if a1=1 & a2=1, return 1. Else return 0. } Require O(S(n)) space

  17. Savitchs theorem Theorem. NSPACE(S(n)) DSPACE(S(n)2), where S(n) is space constructible. (So, PSPACE = NPSPACE) Proof. REACH(C1, C2, i) { If i = 0 check if C1 and C2 are adjacent. Else, for every configurations C, a1 = REACH(C1, C, i-1) a2 = REACH(C, C2, i-1) if a1=1 & a2=1, return 1. Else return 0. } Reuse space

  18. Savitchs theorem Theorem. NSPACE(S(n)) DSPACE(S(n)2), where S(n) is space constructible. (So, PSPACE = NPSPACE) Proof. Space(i) = Space(i-1) + O(S(n)) Space complexity: O(S(n)2)

  19. Savitchs theorem Theorem. NSPACE(S(n)) DSPACE(S(n)2), where S(n) is space constructible. (So, PSPACE = NPSPACE) Proof. Space(i) = Space(i-1) + O(S(n)) Space complexity: O(S(n)2) Time(i) = 2m.2.Time(i-1) + O(S(n)) Time complexity: 2O(S(n) ) 2

  20. Savitchs theorem Theorem. NSPACE(S(n)) DSPACE(S(n)2), where S(n) is space constructible. (So, PSPACE = NPSPACE) Proof. Space(i) = Space(i-1) + O(S(n)) Space complexity: O(S(n)2) Time(i) = 2m.2.Time(i-1) + O(S(n)) Time complexity: 2O(S(n) ) 2 Recall, There s an algorithm with time complexity 2O(S(n)), but higher space requirement. NSPACE(S(n)) DTIME(2O(S(n))).

  21. PSPACE-completeness

  22. PSPACE-completeness Recall, to define completeness of a complexity class, we need an appropriate notion of a reduction. What kind of reductions will be suitable is guided by a complexity question, like a comparison between the complexity class under consideration & another class. Is P = PSPACE ?

  23. PSPACE-completeness Recall, to define completeness of a complexity class, we need an appropriate notion of a reduction. What kind of reductions will be suitable is guided by a complexity question, like a comparison between the complexity class under consideration & another class. Is P = PSPACE ? use poly-time Karp reduction! Definition. A language L is PSPACE-hard if for every L in PSPACE, L pL . Further, if L is in PSPACE then L is PSPACE-complete.

  24. A PSPACE-complete problem Recall, to define completeness of a complexity class, we need an appropriate notion of a reduction. What kind of reductions will be suitable is guided by a complexity question, like a comparison between the complexity class under consideration & another class. Is P = PSPACE ? use poly-time Karp reduction! Example. L = {(M,w,1m) : M accepts w using m space}

  25. Natural PSPACE-complete problem Definition. A quantified Boolean formula (QBF) is a formula of the form Q1x1 Q2x2 Qnxn (x1, x2, , xn) Just a formula on Boolean variables Quantifiers or A QBF is either true or false as all variables are quantified. This is unlike a formula we ve seen before where variables were unquantified/free.

  26. Natural PSPACE-complete problem Example. x1 x2 xn (x1, x2, , xn) The above QBF is true iff is satisfiable. We could have defined SAT as SAT = { x (x) : is a CNF and x (x) is true} instead of SAT = { (x) : is a CNF and is satisfiable}

  27. Natural PSPACE-complete problem Definition. A quantified Boolean formula (QBF) is a formula of the form Q1x1 Q2x2 Qnxn (x1, x2, , xn) Just a formula on Boolean variables Quantifiers or Homework: By using auxiliary variables (as in the proof of Cook-Levin) and introducing some more quantifiers at the end, we can assume w.l.o.g. that is a 3CNF.

  28. Natural PSPACE-complete problem Definition. TQBF is the set of true quantified Boolean formulas. Theorem. TQBF is PSPACE-complete. Proof: Easy to see that TQBF is in PSPACE just think of a suitable recursive procedure. We ll now show that every L PSPACE reduces to TQBF via poly-time Karp reduction

  29. Natural PSPACE-complete problem Definition. TQBF is the set of true quantified Boolean formulas. Theorem. TQBF is PSPACE-complete. Proof: Let M be a TM deciding L using S(n) = poly(n) space. We intend to come up with a poly-time reduction f s.t. x L x is a true QBF f Size of x must be bounded by poly(n), where |x| = n

  30. Natural PSPACE-complete problem Definition. TQBF is the set of true quantified Boolean formulas. Theorem. TQBF is PSPACE-complete. Proof: Let M be a TM deciding L using S(n) = poly(n) space. We intend to come up with a poly-time reduction f s.t. x L x is a true QBF f Idea: Form x in such a way that x is true iff there s a path from Cstart to Caccept in GM,x.

  31. Natural PSPACE-complete problem Definition. TQBF is the set of true quantified Boolean formulas. Theorem. TQBF is PSPACE-complete. Proof: f computes S(n) from n (recall, any poly function S(n) is time constructible). It also computes m = O(S(n)), the no. of bits required to represent a configuration in GM,x.

  32. Natural PSPACE-complete problem Definition. TQBF is the set of true quantified Boolean formulas. Theorem. TQBF is PSPACE-complete. Proof: f computes S(n) from n (recall, any poly function S(n) is time constructible). It also computes m = O(S(n)), the no. of bits required to represent a configuration in GM,x. Then, it forms a semi-QBF i(C1,C2), such that i(C1,C2) is true iff there s a path from C1 to C2 of length at most 2i in GM,x.

  33. Natural PSPACE-complete problem Definition. TQBF is the set of true quantified Boolean formulas. Theorem. TQBF is PSPACE-complete. Proof: f computes S(n) from n (recall, any poly function S(n) is time constructible). It also computes m = O(S(n)), the no. of bits required to represent a configuration in GM,x. Then, it forms a semi-QBF i(C1,C2), such that i(C1,C2) is true iff there s a path from C1 to C2 of length at most 2i in GM,x. The variables corresponding to the bits of C1 and C2 are unquantified/free variables of i

  34. Natural PSPACE-complete problem Definition. TQBF is the set of true quantified Boolean formulas. Theorem. TQBF is PSPACE-complete. Proof: QBF i(C1,C2) is formed, recursively, as follows: (first attempt) i(C1,C2) = C ( i-1(C1,C) i-1(C,C2)) Issue: Size of i is twice the size of i-1 !!

  35. Natural PSPACE-complete problem Definition. TQBF is the set of true quantified Boolean formulas. Theorem. TQBF is PSPACE-complete. Proof: QBF i(C1,C2) is formed, recursively, as follows: (careful attempt) i(C1,C2) = C D1 D2 ( ((D1 = C1 D2 = C) (D1 = C D2 = C2)) i-1(D1,D2) )

  36. Natural PSPACE-complete problem Definition. TQBF is the set of true quantified Boolean formulas. Theorem. TQBF is PSPACE-complete. Proof: QBF i(C1,C2) is formed, recursively, as follows: (careful attempt) i(C1,C2) = C D1 D2 ( ((D1 = C1 D2 = C) (D1 = C D2 = C2)) i-1(D1,D2) ) Note: Size of i = O(S(n)) + Size of i-1

  37. Natural PSPACE-complete problem Definition. TQBF is the set of true quantified Boolean formulas. Theorem. TQBF is PSPACE-complete. Proof: Finally, x = m(Cstart,Caccept)

  38. Natural PSPACE-complete problem Definition. TQBF is the set of true quantified Boolean formulas. Theorem. TQBF is PSPACE-complete. Proof: Finally, x = m(Cstart,Caccept) But, we need to specify how to form 0(C1,C2). Size of x = O(S(n)2) + Size of 0

  39. Natural PSPACE-complete problem Definition. TQBF is the set of true quantified Boolean formulas. Theorem. TQBF is PSPACE-complete. Proof: Finally, x = m(Cstart,Caccept) But, we need to specify how to form 0(C1,C2). Size of x = O(S(n)2) + Size of 0 Remark: We can easily bring all the quantifiers at the beginning in x (as in prenex normal form).

  40. Natural PSPACE-complete problem Definition. TQBF is the set of true quantified Boolean formulas. Theorem. TQBF is PSPACE-complete. Proof: Finally, x = m(Cstart,Caccept) But, we need to specify how to form 0(C1,C2). Size of x = O(S(n)2) + Size of 0 ??

  41. Adjacent configurations Claim. There s an O(S(n)2)-size circuit M,x on O(S(n)) inputs such that for every inputs C1 and C2, M,x(C1, C2) = 1 iff C1 and C2 encode two neighboring configurations in GM,x . Proof. Think of a linear time algorithm that has the knowledge of M and x, and on input C1 and C2 it checks if C2 is a neighbor of C1 in GM,x.

  42. Adjacent configurations Claim. There s an O(S(n)2)-size circuit M,x on O(S(n)) inputs such that for every inputs C1 and C2, M,x(C1, C2) = 1 iff C1 and C2 encode two neighboring configurations in GM,x . Proof. Think of a linear time algorithm that has the knowledge of M and x, and on input C1 and C2 it checks if C2 is a neighbor of C1 in GM,x. Applying ideas from the proof of Cook-Levin theorem, we get our desired M,x of size O(S(n)2).

  43. Size of 0 Obs. We can convert the circuit M,x(C1, C2) to a quantified CNF 0(C1,C2) by introducing auxiliary variables (as in the proof of Cook-Levin theorem). Hence, size of 0(C1,C2) is O(S(n)2). Therefore, size of x = O(S(n)2).

  44. Other PSPACE complete problems Checking if a player has a winning strategy in certain two-player games, like (generalized) Hex, Reversi, Geography etc.

  45. NL-completeness

  46. NL-completeness Recall again, to define completeness of a complexity class, we need an appropriate notion of a reduction. What kind of reductions will be suitable is guided by a complexity question, like a comparison between the complexity class under consideration & another class. Is L = NL ?

  47. NL-completeness Recall again, to define completeness of a complexity class, we need an appropriate notion of a reduction. What kind of reductions will be suitable is guided by a complexity question, like a comparison between the complexity class under consideration & another class. Is L = NL ? poly-time (Karp) reductions are much too powerful for L. We need to define a suitable log-space reduction.

  48. Log-space reductions Log-space TM x f(x) Issue: A log-space TM may not have enough space to write down the whole output f(x) in one shot. unless we restrict |f(x)| = O(log |x|), in which case we re severely restricting the power of the reduction.

  49. Log-space reductions Log-space TM (x, i) f(x)i Issue: A log-space TM may not have enough space to write down the whole output f(x) in one shot. Solution: Have the log-space TM output any bit of f(x).

  50. Log-space reductions Log-space TM (x, i) f(x)i Issue: A log-space TM may not have enough space to write down the whole output f(x) in one shot. Solution: Have the log-space TM output any bit of f(x). Definition: A function f : {0,1}* {0,1}* is implicitly log- space computable if 1. |f(x)| |x|c for some constant c, 2. The following two languages are in L : Lf = {(x, i) : f(x)i = 1} and L f = {(x, i) : i |f(x)|}

More Related Content