










Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!











Following the same procedure as for time, we can measure the space taken by a non-deterministic machine by taking the minimum over all computation paths. Definition The space complexity of a non-deterministic Turing Machine NT is the function NSpaceNT such that NSpaceNT (x) is the number of cells visited in the shortest accepting path of NT (x) if there is one, otherwise it is the number of steps in the shortest rejecting path. (If not all paths of NT (x) halt, then NSpaceNT (x) is undefined.)
Unlike time, it can easily be shown that non-determinism does not reduce the space requirements very much: Theorem (Savitch) If s(n) ≥ n, then
NSPACE[s] ⊆ SPACE[s^2 ]. NB. Compare this with a similar result for time complexity (see Sipser Theorem 7.10 or Papadimitriou Theorem 2.6): Theorem
NTIME[f ] ⊆
c≥ 1
TIME[cf^ ].
Definition NPSPACE =
k≥ 0
NSPACE[nk^ ]
It follows from Savitch’s Theorem that Corollary PSPACE = NPSPACE Thus, for polynomial space, non-determinism does not add any extra computational power.
Outline (see Sipser Theorem 8.5 for details) Let L be a language in NSPACE[s] Let NT be a non-deterministic Turing machine that decides L with space complexity s Choose an encoding for the computation NT (x) that uses cs(|x|) symbols for each configuration (c is a constant) Let C 0 be the start configuration, and Ce be the accepting configuration Define a Boolean function reach(C, C′, j) which is TRUE iff configuration C′^ can be reached from configuration C in at most 2j^ steps. To decide whether or not x ∈ L we must determine whether or not reach(C 0 , Ce, cs(|x|)) is TRUE
Outline (see Sipser Theorem 8.5 for details) Let L be a language in NSPACE[s] Let NT be a non-deterministic Turing machine that decides L with space complexity s Choose an encoding for the computation NT (x) that uses cs(|x|) symbols for each configuration (c is a constant) Let C 0 be the start configuration, and Ce be the accepting configuration Define a Boolean function reach(C, C′, j) which is TRUE iff configuration C′^ can be reached from configuration C in at most 2j^ steps. To decide whether or not x ∈ L we must determine whether or not reach(C 0 , Ce, cs(|x|)) is TRUE
Outline (see Sipser Theorem 8.5 for details) Let L be a language in NSPACE[s] Let NT be a non-deterministic Turing machine that decides L with space complexity s Choose an encoding for the computation NT (x) that uses cs(|x|) symbols for each configuration (c is a constant) Let C 0 be the start configuration, and Ce be the accepting configuration Define a Boolean function reach(C, C′, j) which is TRUE iff configuration C′^ can be reached from configuration C in at most 2j^ steps. To decide whether or not x ∈ L we must determine whether or not reach(C 0 , Ce, cs(|x|)) is TRUE
Outline (see Sipser Theorem 8.5 for details) Let L be a language in NSPACE[s] Let NT be a non-deterministic Turing machine that decides L with space complexity s Choose an encoding for the computation NT (x) that uses cs(|x|) symbols for each configuration (c is a constant) Let C 0 be the start configuration, and Ce be the accepting configuration Define a Boolean function reach(C, C′, j) which is TRUE iff configuration C′^ can be reached from configuration C in at most 2j^ steps. To decide whether or not x ∈ L we must determine whether or not reach(C 0 , Ce, cs(|x|)) is TRUE
Since polynomial space is so powerful, it is natural to consider more restricted space complexity classes Even linear space is enough to solve SATISFIABILITY To get sublinear space complexity, we disregard the cells containing the input (which we assume are “read-only”) and count only working space.
Definition L = SPACE[log n] NL = NSPACE[log n]
What sort of problems are in L and NL? In logarithmic space we can store a fixed number of counters (up to length of input) a fixed number of pointers to positions in the input string So, L contains all problems requiring only a fixed number of counters/pointers for solving NL contains all problems requiring only a fixed number of counters/pointers for verifying solutions
L = { 0 n 1 n^ | n ≥ 0 } Algorithm:
The first problem defined in this course was REACHABILITY^1 This can be solved by the following nondeterministic algorithm: Define a counter and initialise it to the number of nodes in the graph Define a pointer to hold the “current node” and initialise to the start node While the counter is non-zero — If the current node equals the target node, return yes — Non-deterministically choose a node which can be reached from the current node — Update the pointer to this node and decrement the counter Return no (^1) Also known as PATH