complement space classes
play

Complement Space Classes Definition coPSPACE = { L : L PSPACE } - PowerPoint PPT Presentation

Complement Space Classes Definition coPSPACE = { L : L PSPACE } Logarithmic Space Complexity coL = { L : L L } Claim: coPSPACE = PSPACE Nabil Mustafa Claim: coL = L All deterministic classes are closed under complement. Computability


  1. Complement Space Classes Definition coPSPACE = { L : L ∈ PSPACE } Logarithmic Space Complexity coL = { L : L ∈ L } Claim: coPSPACE = PSPACE Nabil Mustafa Claim: coL = L All deterministic classes are closed under complement. Computability and Complexity Definition coNSPACE = { L : L ∈ NSPACE } Claim: coNSPACE = NSPACE By Savitch’s theorem – NSPACE = PSPACE Nabil Mustafa Logarithmic Space Complexity Nabil Mustafa Logarithmic Space Complexity The Class coNL UNREACHABILITY is in NL Claim Definition UNREACHABILITY ∈ NL coNL = { L : L ∈ NL } Given a graph G = ( V , E ), | V | = n , and two vertices u and v Immerman-Szelepscenyi Theorem UNREACHABILITY : Is v unreachable from u in G ? coNL = NL Construct a NTM N such that N uses O (log n ) space The following two claims are exactly similar to coNP & NP proofs: If there does not exist a path from u to v , then some sequence of transition rules will halt with an ‘accept’. Claim: A language L is coNL complete iff L is NL complete If there exists a path from u to v , then all sequence of Claim: If L is coNL complete, and L ∈ NL , then coNL = NL transition rules should halt with a ‘reject’. Claim: UNREACHABILITY is coNL complete Once again, it’s not as simple as saying: run the NTM M for Claim: If UNREACHABILITY ∈ NL , then coNL = NL REACHABILITY , and just invert its answer. Nabil Mustafa Logarithmic Space Complexity Nabil Mustafa Logarithmic Space Complexity

  2. A Counting Problem CC Proof of coNL = NL Claim A Counting Problem If CC ∈ NL , then UNREACHABILITY ∈ NL CC : Given G = ( V , E ) and a vertex u , count the number of vertices reachable from v in G . Set sum = number of nodes reachable from u Set counter = 0 Have not formally described TM for non-boolean functions For each vertex t � = v in G For a TM it is obvious: Guess if t is reachable from u Put the output on the work-tape before halting. If the guess is that t is reachable Write-only output tape space does not matter. Guess a path from u to t Verify that that path is correct. For a NTM it is less clear: If verification fails at any stage, halt with ‘reject’ The NTM ends in many ways, with possibly different answers If verification succeeds, increment counter. So, what could be a consistent definition of the output? If counter = sum, ‘accept’ A NTM N computes a non-boolean function f iff Otherwise, ‘reject’ All sequences that halt with an ‘accept’ must have the same Claim output string All other sequences must halt with a ‘reject’ state The above algorithm uses O (log n ) non-deterministic space Nabil Mustafa Logarithmic Space Complexity Nabil Mustafa Logarithmic Space Complexity Proof of coNL = NL CC ∈ NL Claim Remember our objective: If v is not reachable from u , at least one sequence should CC ∈ NL result in an ‘accept’ If v is reachable, all sequences should result in a reject Proof. Assume v is not reachable from u . We know that REACHABILITY is in NL ∃ sequence of guesses that identify vertices connected to u CC is just summing up REACHABILITY over all vertices: ∃ guesses which verify correctly the connecting path from u Therefore counter gets incremented: sum times. Set counter = 0 The NTM halts with an accept. For each vertex t in G Correctness: If, not counting v , there are already sum Guess a path from u to t connected vertices, this implies that v is not reachable from u . Verify that that path is correct. Assume v is reachable from u . If verification fails at any stage, halt with ‘reject’ No matter what we guess, we never incorrectly say a vertex t If verification succeeds, increment counter. is reachable when it is not Output counter Therefore, even if we guess the connected vertices correctly, counter will become at most sum − 1. Problem? All paths reject! Only works if every vertex is Correctness: Therefore, we always reject. reachable. Nabil Mustafa Logarithmic Space Complexity Nabil Mustafa Logarithmic Space Complexity

  3. CC ∈ NL CC ∈ NL Let T i be the count of vertices reachable from u in at most i steps. Claim Claim CC ∈ NL If we know T i , we can compute T i +1 . Proof. CC is just summing up REACHABILITY over all vertices carefully: Set T i +1 = 0 Set counter = 0 For each vertex t in G For each vertex t in G Set counter = 0 , r = 0 Guess if t is reachable from u For each vertex s in G If the guess is that t is reachable Guess if s ∈ T i Guess a path from u to t If the guess is that s ∈ T i Verify that that path is correct. Guess a path of length i from u to s If verification fails at any stage, halt with ‘reject’ Verify that the path is correct If verification succeeds, increment counter. If verification fails at any stage, halt with ‘reject’ Output counter If verification succeeds, counter++. If ( s , t ) ∈ E , set r = 1 Problem? All paths with subsets of reachable vertices guessed If counter � = T i , halt with ‘reject’ correctly give different answers (including the correct one!) If r = 1, increment T i +1 Nabil Mustafa Logarithmic Space Complexity Nabil Mustafa Logarithmic Space Complexity CC ∈ NL UNREACHABILITY ∈ NL Note that T n − 1 is the answer to problem CC . Construct T i inductively UNREACHABILITY T 0 = 1 – just u itself. We now give the ‘certificate’-based proof of the previous theorem. To compute T i +1 , we only need T i We know that if UNREACHABILITY ∈ NL then NL = coNL Can’t afford to keep all T j , only T i to compute T i +1 Reuse the space for computing each T i +1 The algorithm described is correct. UNREACHABILITY Each path that halts with ‘accept’ gives the same answer. CLAIM: UNREACHABILITY ∈ NL Pretty easy to see that we check for each type of failure. we only need to show O ( log − n ) space Algorithm A such that Proof given nicely in Papadimitriou’s book. ∃ polynomial sized certificate and Space used is O (log n ) A ( < G , s , t >, u ) = 1 iff t is not reachable from s in G . Re-use space over T i , so consider space for each T i Nabil’s Note: These are unedited slides of Laiq. Use constant number of vertex indices – O (log n ) Use constant number of counters – O (log n ) Nabil Mustafa Logarithmic Space Complexity Nabil Mustafa Logarithmic Space Complexity

  4. UNREACHABILITY ∈ NL - PROOF Let C i be the set of vertices reachable from s in at most i steps UNREACHABILITY ∈ NL - PROOF vertices are labeled from 1 to n so that each could be our Algorithm will use following 2 procedures represented by log-n bits. Given | C i | , certify if v / ∈ C i (1) The certificate only sequence of vertices from s to v (for v ∈ Given | C i | , certify if | C i | = c (2) C i ) NOTE: (2) will be applied iteratively to find Max-Size of sets Certificate could be checked using read-once Access C 1 , C 2 , C 3 , ..., C n and then will use (1) to certify that t / ∈ C n first vertex of sequence should be s . for s > 0, v j − 1 and v j should have an edge. v k = v (last vertex should be v ) certificate is at most polynomial sized. Nabil Mustafa Logarithmic Space Complexity Nabil Mustafa Logarithmic Space Complexity PROOF - UNREACHABILITY / ∈ NL PROOF - UNREACHABILITY / ∈ NL Given | C i − 1 | , certify if v / ∈ C i Procedure-1 Given | C i | , certify if v / ∈ C i Similar to previous procedure Certificate here is the list of certificates for every u ∈ C i Certificate here is the list of | C i − 1 | certificates certifying u ∈ sorted in ascending order of Vertex labels C i − 1 for every u ∈ C i − 1 The Algorithms checks The Algorithms checks Each certificate is valid Each certificate is valid u’s label (whose certificate is given) is larger than previous u’s label (whose certificate is given) is larger than previous vertex’s label vertex’s label no certificate is provided for v verify no certificate is given for v or Neighbor of v total number of certificate = | C i | total number of certificates = | C i | if v / ∈ C i then certificate will be accepted since v ∈ C i iff ∃ u ∈ C i − 1 such that u = v or u is neighbor if v ∈ C i then there won’t be | C i | certificate for | C i | vertices of v . other than v so the procedure provides correct results Nabil Mustafa Logarithmic Space Complexity Nabil Mustafa Logarithmic Space Complexity

  5. PROOF - UNREACHABILITY / ∈ NL Given | C i − 1 | , certify if | C i | = c The certificate that | C i | = c will have n certificates There is a certificate for every u ∈ C i There is a certificate for every u / ∈ C i Algorithm will verify all certificates and count the certificates for u ∈ C i Accepts if count = c Nabil Mustafa Logarithmic Space Complexity

Recommend


More recommend