Algorithms Lecture 22 Beyond NP PSPACE Complexity classes

Algorithms Lecture 22

Beyond NP: PSPACE

Complexity classes • P – problems that can be solved efficiently (i. e. , in polynomial time) • NP – problems where (existence of) a correct solution can be verified efficiently – co. NP – problems where non-existence of a solution can be verified efficiently • PSPACE – problems that can be solved using polynomial space • P NP PSPACE – We believe all inclusions are strict (though we can’t prove it)

P PSPACE • Proof: an algorithm that runs in polynomial time can use only polynomial space • Note: an algorithm that uses polynomial space might use exponential time (or even unbounded time)

NP PSPACE • Fix some L NP. We know there is a poly-time verifier V such that x L w V(x, w)=1 – |w| = poly(|x|) • Define A(x): exhaustively search for w such that V(x, w)=1 • A can be implemented using polynomial space

Reductions • Can still talk about reductions like before • L’ is (poly-time) reducible to L if there is a function f that can be computed in polynomial time such that x L’ iff f(x) L • If L’ is reducible to L and L PSPACE then L’ PSPACE

PSPACE-completeness • “The hardest problems in PSPACE” • Defined analogously to NP-completeness • L is PSPACE-complete if L PSPACE and every L’ PSPACE is reducible to L

QSAT

QSAT • Given a Boolean formula on n variables, determine if x 1 x 2 x 3 … (x 1, …, xn) = 1 • Note: SAT asks if x 1 x 2 x 3 … (x 1, …, xn) = 1 – SAT is (trivially) reducible to QSAT • QSAT is not believed to be in NP – How would you verify that a QSAT formula is true?

QSAT PSPACE • Use a recursive algorithm A: If = x 1 x 2 … (x 1, …, xn) Output A( x 2 … (0, …, xn)) A( x 2 … (1, …, xn)) • What is the space complexity of this algorithm?

Analyzing the algorithm • Key point: space can be re-used! • S(n) ≤ S(n-1) + p(n) for some polynomial p • S(n) = n p(n), which is polynomial

PSPACE-completeness • QSAT is PSPACE-complete • Can prove other problems PSPACE complete by reducing QSAT to them

Two-player games

Two-player games • Consider games with – Perfect information (both players know the state of the game; no randomness) – Polynomially many moves until the game ends – Efficient way to determine the winner at the end of the game

Two-player games • Many questions related to (two-player) games are in PSPACE – E. g. , does the first player have a guaranteed win? – E. g. , is a given position a guaranteed win for player 2? • Whether these questions are PSPACEcomplete depends on the rules of the game – Whether or not QSAT can be reduced to some game depends on the details of the game

Competitive facility location • Game is specified by a graph G, where vertices are associated with values • Players alternately select one vertex per turn, and get the value of that vertex – The set of all selected vertices must always be an independent set • Formally: given G and a bound B, is there a strategy for P 2 that guarantees P 2 payoff ≥ B? • Can view as competition between businesses

Games and QSAT • Similar algorithm as before solves competitive facility location in poly-space • Natural connection between games and QSAT – E. g. , first player has a guaranteed win iff move 1 move 2 … player 1 wins – Any game (of the form we consider) can be reduced to QSAT

PSPACE-completeness • Reduce QSAT to competitive facility location – Assume (without loss of generality) an odd number of variables, and that no clause contains a variable and its negation • Intuition: players move by assigning values to variables; player 2 wins if some clause is unsatisfied – Want to design the game to force players to process variables in order

PSPACE-completeness • Given x 1 x 2 x 3 … xn (x 1, …, xn) – k clauses • Add vertices to G for xi and xi, connected by an edge – Only one of these can be chosen • Assign value cn+1 -i to nodes xi and xi (c = k+2), and set B = cn-1 + cn-3 … + c 2 + 1 – Players lose if they select nodes out of order – Values can be represented using poly-many bits

PSPACE-completeness • So far, player 2 can get value B-1 • Add one node per clause, each with value 1 – Connect each such node with the nodes corresponding to the literals in the clause • Player 2 wins iff there is a clause that is unsatisfied at the end
- Slides: 20