- Immerman–Szelepcsényi theorem
The Immerman–Szelepcsényi Theorem was proven independently by
Neil Immerman andRóbert Szelepcsényi in1987 , for which they shared the1995 Gödel Prize . In its general form the theorem states thatNSPACE = co-NSPACE. In other words, if a nondeterministic machine can solve a problem, it can solve its complement problem (with the "yes" and "no" answers reversed) in the same asymptotic amount of space. No similar result is known for time.Proof
Let "s(n)" ≥ log n be a
space constructible function. Then "NSPACE [s(n)] =co-NSPACE [s(n)] "The first step is to demonstrate that NL=
co-NL . This can be accomplished by taking thest-connectivity problem (known to beNL-complete ), and showing that thecomplement of this problem (calledst-non-connectivity ) is also in
NL.Definition:
st-non-connectivity is an algorithmon graph "G" with "n" vertices that outputs "TRUE" if there is no
path between vertex "s" and "t" and "FALSE" if at least one path exists.st-non-connectivity ={ <"G=,s,t">: there is no path from "s" to "t" in graph "G"}. In order to illustrate that
st-non-connectivity is in NL, one can construct an algorithm that, in logarithmic space, decides whether two given vertices arenot connected. To prove correctness of this algorithm, one must show two things:*If the non-deterministic choices are made "correctly" and "s" and "t" are disconnected, then the algorithm accepts.
*If "s" and "t" are connected, no matter what non-deterministic choices are made the algorithm does not accept.Any reasonable algorithm satisfies the first condition, but satisfying the second condition is worth a
Gödel Prize .Here are the key ideas of the proof of the second condition. For sake of contradiction assume that "s" and "t" are connected but the algorithm accepts. To keep the adversary controlling the non-determinism "honest", the algorithm is designed so that if the non-determinism is uncooperative, the algorithm rejects at the end of the ENUMERATE subroutine. Therefore since we assumed that the algorithm accepts, the non-determinism must have been cooperative, which implies by the design of the algorithm that we should have rejected, a contradiction.
First, define "Ai" as follows:"Ai"={ "v" : there is a path from "s" to "v" of length ≤ "i" }. In other words, "Ai" will include all vertices that are reachable from "s" in "i" orfewer hops. Let "ri" =| "Ai" |. Note that if"t" is not in "An-1", where "n" =| "V" |, then there is no path from "s" to "t" in "G", "i.e." <"G,s,t"> ∈
st-non-connectivity .Lemma: An algorithm can be constructed that given "ri" will enumerate vertices in "Ai" and ACCEPT in logarithmic space. Note that if the given "ri" is larger than the true number of vertices in "Ai", then the algorithm REJECTs; however, if "ri" is less than the true number of vertices in "Ai" the algorithm would ACCEPT but enumerate only a subset of "Ai".
ENUMERATE(s,i,r_i,G) 1: Counter:=0 2: FOR ALL vertices v in G 3: Nondeterministically guess a path of length less than or equal to i from s to v 4: IF path exists 5: Counter:=Counter+1 6: Output v 6: IF Counter>=r_i 7: ACCEPT 8: REJECT
ENUMERATE goes through all vertices of graph "G" in logarithmicspace, since the representation of each vertex and the Counter requiresonly log | "G" | bits and nondeterministically selecting a path alsorequires only logarithmic space.
Now, with ENUMERATE at hand it is possible to compute the actual "ri" in log-space using an algorithm that is based on the principle of
Mathematical induction . When using ENUMERATE as a subroutine, replace ACCEPT in ENUMERATE with RETURN while leaving REJECT as REJECT.Obviously "r0"=1 since "Ai" includes only the vertex "s" itself.
Now, assume "ri" is given. Then "ri+1" = | "Ai+1" "Ai" | + "ri" , where is the
set difference operator. The set difference can be calculated by the following algorithm in log-space:SET-DIFFERENCE (s,i,r_i,G) 1: diff:=0 2: FOR ALL vertices v: 3: ENUMERATE (s,i,r_i,G) 4: IF v is ever output 5: CONTINUE 6: FOR EACH u such that (u,v) is an edge in G 7: ENUMERATE (s,i,r_i,G) 8: IF u is ever output 9: diff:=diff+1 10: BREAK 11: ELSE 12: CONTINUE 13: Output diff
This algorithm goes through all vertices of the graph "G" and ignores the vertices that are of distance of less than or equal to "ri" from "s" (lines 4-5), "i.e." the vertices included in "Ai". In lines 6-9 the algorithm tries to find a vertex "u" in "Ai" directly connected to the vertex "v" outside of "Ai" by simulating ENUMERATE again. If such vertex is found, that means that "v" is not in "Ai" but is in "Ai+1", so it is output and the number of vertices in set difference is recorded. Note that the algorithm does not need to store all of the output of ENUMERATE every time it is called as a sub-routine. In lines 3 and 7 it can only store one vertex at a time and check if "v" and "u" are ever output. Thus, this algorithm runs in logarithmic space.
With this algorithm at hand we can devise an algorithm for
st-non-connectivity consisting of two parts. The first part would compute "rn" by starting with "r0"=1 and then using SET-DIFFERENCE n-1 times. In the second part the algorithm just simulates ENUMERATE with the computed "rn" and if "t" is ever output that means it can be reached from "v", and the algorithm REJECTs.NOT-CONNECTED (G,s,t) 1: r_n:=1; 2: FOR i:=1 TO n 3: r_n:=r_n+SET-DIFFERENCE (s,i,r_n,G) 4: ENUMERATE (s,n,r_n,G) 5: IF t is ever output 6: REJECT 8: ELSE 9: ACCEPT
This algorithm runs in logarithmic space, since we need log | "G" | bits for storing "i and r_n". As was shown above, the ENUMERATE and SET-DIFFERENCE algorithms also run in logarithmic space and again we do not need to store all of the output of ENUMERATE in line 4, but need only to check if "t" is ever output. Thus, NOT-CONNECTED can decide if there exists no path from vertex "s" to "t" in logarithmic space. I.e.
st-non-connectivity is in NL. Since we can reduce each problem in NL tost-connectivity and each problem inco-NL tost-non-connectivity we conclude that NL=co-NL .Now, for "s(n)" ≥ log n we can transform the computations of any non-deterministic Turing Machine "M" on language "L" into a graph of its states and simulate "M" using
st-connectivity algorithm. Analogously we can transform any "co-language" intost-non-connectivity problem.Both of these graphs would have 2"O(s(n))" vertices if "L" ∈ "NSPACE(s(n))". Thus, we can decide both reachability and non-reachability of the "Accept" state in log(2"O(s(n))")="O(s(n))" space and "NSPACE(s(n))=co-NSPACE(s(n))".References
* N.Immerman, "" [http://www.cs.umass.edu/~immerman/pub/space.ps Nondeterministic Space is Closed Under Complementation] ", SIAM J. Comput. 17 1988, pp. 935-938
* R.Szelepcsenyi, ""The method of forcing for nondeterministic automata", Bull. EATCS 33, 1987, pp. 96-100
Wikimedia Foundation. 2010.