Difference between revisions of "Complexity Dojo/Savitch's Theorem"

From Complexity Zoo
Jump to navigation Jump to search
m (1 revision: Complexity zoo import.)
 
(Correct minor error. Citation: wikipedia, rest of sentence)
 
Line 6: Line 6:
 
{{Theorem
 
{{Theorem
 
|Savitch's Theorem|statement=Reachability &isin; {{zcls|s|space}}<math>(\log^2 n)</math>.
 
|Savitch's Theorem|statement=Reachability &isin; {{zcls|s|space}}<math>(\log^2 n)</math>.
|proof=Let <math>G=(V,E)</math> be a directed graph (given in the form of an adjacency matrix <math>A^G</math>), and let <math>n=\left\vert V\right\vert</math>. We shall proceed by building up a predicate <math>\mathrm{Path} : V \times V \times \mathbb{N} \to \{0,1\}</math> such that, for some vertices <math>a,b</math> and natural number <math>i</math>, <math>\mathrm{Path}(a,b,i) = 1</math> if and only if there is a path of length at most <math>2^i</math> connecting <math>a</math> to <math>b</math>. Then, <math>\mathrm{Reachability}(a,b) = \mathrm{Path}(a,b,\left\lceil \log n \right\rceil)</math>, since any path longer than <math>n</math> must visit some vertex twice.
+
|proof=Let <math>G=(V,E)</math> be a directed graph (given in the form of an adjacency matrix <math>A^G</math>), and let <math>n=\left\vert V\right\vert</math>. We shall proceed by building up a predicate <math>\mathrm{Path} : V \times V \times \mathbb{N} \to \{0,1\}</math> such that, for some vertices <math>a,b</math> and natural number <math>i</math>, <math>\mathrm{Path}(a,b,i) = 1</math> if and only if there is a path of length at most <math>2^i</math> connecting <math>a</math> to <math>b</math>. Then, <math>\mathrm{Reachability}(a,b) = \mathrm{Path}(a,b,n)</math>, since any path longer than <math>n</math> must visit some vertex twice.
  
 
To compute <math>\mathrm{Path}(a,b,i)</math>, we shall use a Turing machine <math>M</math> with an input string <math>A^G</math> and two work strings. The first work string will initially contain the a triple <math>(a,b,i)</math>, where <math>a,b</math> are represented as the indices of the vertices. Note that the length of this triple is <math>O(\left\lceil\log n\right\rceil)</math>. During the course of the algorithm, we shall add additional triples of the same form for intermediate problems. We shall see soon that no more than <math>O(\left\lceil \log n \right\rceil)</math> triples will be needed.
 
To compute <math>\mathrm{Path}(a,b,i)</math>, we shall use a Turing machine <math>M</math> with an input string <math>A^G</math> and two work strings. The first work string will initially contain the a triple <math>(a,b,i)</math>, where <math>a,b</math> are represented as the indices of the vertices. Note that the length of this triple is <math>O(\left\lceil\log n\right\rceil)</math>. During the course of the algorithm, we shall add additional triples of the same form for intermediate problems. We shall see soon that no more than <math>O(\left\lceil \log n \right\rceil)</math> triples will be needed.

Latest revision as of 17:34, 12 March 2025

Main Zoo - Complexity Garden - Zoo Glossary - Zoo References - Chris' Complexity Dojo


Major Theorems: Cook-Levin - Savitch's - Ladner's - Blum Speedup - Impagliazzo-Widgerson - Toda's - Natural Proofs

Proof Techniques: Diagonalization


Savitch's Theorem shows that the Reachability problem can be solved in space for a graph with nodes. As a corollary, we can apply the reachability method to show that NSPACESPACE. This in turn gives us immediately that NPSPACE = PSPACE; that is, that for polynomially-bounded space, non-determinism doesn't buy us anything, in contrast to what we suspect about polynomially-bounded time.

Theorem (Savitch's Theorem). Reachability ∈ SPACE.


Proof: Let be a directed graph (given in the form of an adjacency matrix ), and let . We shall proceed by building up a predicate such that, for some vertices and natural number , if and only if there is a path of length at most connecting to . Then, , since any path longer than must visit some vertex twice.

To compute , we shall use a Turing machine with an input string and two work strings. The first work string will initially contain the a triple , where are represented as the indices of the vertices. Note that the length of this triple is . During the course of the algorithm, we shall add additional triples of the same form for intermediate problems. We shall see soon that no more than triples will be needed.

shall work by noting that if for , then the path described has a midpoint . Formally, if and , there exists a node such that . Thus, to compute , will iterate through all vertices (using the second work tape) and check and recursively, using the first work tape as a stack to store which sub-problem we're working on. Since we'll never need more than levels of recursion, we will be able to run this algorithm in space, as claimed. ▪

In and of itself, this theorem hides its true importance. The true power of the theorem comes when we apply it to the configuration graph of an NSPACE machine.

Corollary. For all constructable , NSPACE ⊆ SPACE.


Proof: Let be an NSPACE machine, and let be the number of tapes used by . We start by defining what we mean by a configuration of . We say that a configuration of is a tuple where is a state of , and where are strings over the tape alphabet of . We interpret a configuration as a "snapshot" of during its operation. Thus, given a configuration , we say that is in state Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle q} and that each of the tapes Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle i\in[1..k]} contains the string Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle x_i y_i} , where the read head for that tape is between the two strings.

We can build a graph Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle G_M} where each vertex is a possible configuration of Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle M} , since there are a finite number of possible configurations reachable by a machine with bounded space. For each pair of configurations Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle A, B\in G_M} , there is an edge in Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle G_M} from Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle A} to Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle B} if and only if Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle B} can be reached from Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle A} in one step of computation.

We can do better than simply stating that the configuration graph of Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle M} is finite, though. Given a configuration Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle (q, x_1, y_1, \dots, x_k, y_k)} , the number of choices for Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle q} is limited to Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \left\vert Q\right\vert} where Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle Q} is the set of states for Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle M} . Moreover, by the definition of NSPACE, the total of the lengths of each string Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle x_i,y_i} is bounded by Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle f(n)} . We can partition this length into the various strings with Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle 2k} integers in the range Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle [0..f(n)]} . Thus, the number of choices for each configuration is bounded by Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \left\vert Q\right\vert \left\vert\Sigma\right\vert^{2k\cdot f(n)}} , where Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \Sigma} is the tape alphabet of Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle M} . Finally, the number of possible configurations of Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle M} is bounded by Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle nc^{f(n)}=c^{\log n + f(n)}} for some constant Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle c} depending only on Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle M} .

Thus, we can run the algorithm for Reachability given above on the configuration graph of Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle M} by performing a step of computation on Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle M} whenever the algorithm would check if two verticies are adjacent or not. Performing that check requires space bounded by Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle O(f(n))} . Since there are Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle O(c^{\log n + f(n)})} vertices in the graph, Reachability for the initial and accepting configurations of Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle M} can be computed in space bounded by Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle O(\log^2 (c^{\log n + f(n})) = O(f^2(n) + \log^2 n)} . If Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \log(n) = o(f(n))} , then this means that the space bound is Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle O(f^2(n))} . Finally, note that the algorithm for Reachability given above is deterministic. Hence, NSPACEFailed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle (f(n))} ⊆ SPACEFailed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle (f^2(n))} for all constructable Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle f(n) = \omega(\log n)} , as claimed. ▪

As mentioned before, letting Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle f(n)} in the corollary be a polynomial gives that NPSPACE = PSPACE.