130 likes | 153 Views
Discussing NP-complete problems from an encyclopedia, efficient algorithms, space complexity classes, and the impact of Space analysis on algorithms led by Sofya Raskhodnikova.
E N D
LECTURE28 • Last time • Examples of NP-complete problems • Today • Space complexity Intro to Theory of Computation CS 464 Sofya Raskhodnikova Homework 11 due Homework 12 out Extra credit programming assignment
From Garey and Jonhson ``I thought about it for weeks, but I can’t come up with an efficient algorithm. I guess I’m just too dumb.’’ ``We need an efficient algorithm that constructs a design of iThingythat meets the maximum # of requirements at lowest cost.’’
I-clicker question (frequency: AC) • 3SAT • is NP-complete • (1) and (2) are both true • (1) and (2) are both false • (1) is true and (2) is false • (2) is true and (1) is false • At least one of (1) and (2) is an open question
Space analysis If M is a TM and then “M runs in space ” means for every input of length , M on uses at most tape cells. S. Raskhodnikova; based on slides by E. Demaine, C. Leiserson If M is a nondterministicTM that halts on all inputs then is the maximum number of cells M uses on any input of length .
Space complexity classes SPACE() is a class of languages. SPACE()means that some 1-tape TM M that runs in space O() decides A.
Prove: SAT SPACE() M = `` On input , where is a Boolean formula, with variables : For each truth assignment to Evaluate on that truth assignment. Accept if ever evaluates to 1. O.w. reject.’’ If is the input length, M uses space
Space complexity classes NSPACE() is a class of languages. NSPACE()means that some 1-tape nondeterministic TM M that runs in space O() decides A.
Prove: NSPACE() N = `` On input , where is an NFA: Place marker on the start state of M. Repeat times where is the # of states of M: Nondeterministically select . Adjust the markers to simulate M reading Accept if at any point none of the markers are on an accept state. O.w. reject.’’ ={ is an NFA and L If is the input length, N uses nondeterministic space
Savitch’s theorem Theorem. Let be a function, where NSPACE(). Proof: • Let N be an NTM deciding a language A in space. • We give a deterministic TM M deciding A. • More general problem: • Given configurations of N and integer t, decide whether N can go from to in steps on some nondeterministic path. • Procedure CANYIELD
Savitch’s theorem CANYIELD = `` On input : If acceptif or yields in one transition. O.w. reject. If then configs of N with cells: Run CANYIELD(). Run CANYIELD(). If both runs accept, accept Reject.’’ Theorem. Let be a function, where NSPACE(). Proof:
The class PSPACE • PSPACE is the class of languages decidable in polynomial space on a deterministic TM: NSPACE – the same, but for NTMs. By Savitch’s Theorem, P NP PSPACE = NPSPACE EXPTIME