COMS 482: unofficial class blog


Lecture 28: PSPACE

Posted in Class Notes by Elliott Back on April 4th, 2005. [Del.icio.us]

PSPACE = {x | x has a polynomial space algorithm}

Given T = c1 ^ c2 ^ … ^ ck where each clauses ci is an OR-clause with 3 terms (an instance of 3-SAT) , does there exist and x1 for all x2 does there exist an x3 for all x4 … for all xn-1 such that T is true? This is called quantified 3-SAT (QSAT), an is a kind of alternation thatsshows up in many game AI questions. I.e., is there a move for me such that for all of my opponents’ next move there is another good move for me such that … etc.

One idea for QSAT–try all truth assignments. Define: pw = polynomial time algorithm given an “oracle” for w. What if you need a solution to an NP-complete problem? Sometimes there are special characteristics of a problem that allows a solution. Sometimes we can define a provably good approximation solution!

Look at vertex cover. Given G, k, is there a vertex cover of size <= k? So, there are n choose k possible vertex covers. We could try them all, but… that’s a lot of options. To check a vertex cover, try each edge e, see if at least one endpoint is in the cover, and repeat. This takes O(n2) time.

Claim: “If G has n nodes, with max-degree d, and if there is a vertex cover of size k, then G has at most k*d edges.”

k*d is better than O(n2). Let s be the vertex cover with |s| = k. There are at most d edges from each vertex in S, there are at most k*d places where S touches some edge either once or twice. |E| <= # touches <= k*d, so trying all the possibilities is no longer O(n choose k * k * (n-1)) but rather O(nk+1 * k).

Observe that any graph with more than k*(n-1) edges cannot have a vertex cover of size k, and if there is a vertex cover of size k and we completely remove a vertex from the cover, then the remaining graph has a vertex cover of size k-1.

Find(G, k):
    if G has no edges return false
    if G has more than k*(n-1) edges return false
    choose e = (u, v)
        s1 = find(G - {u}, k-1)
        s2 = find(G - {v}, k-1)
        if s1 and s2 fail, then return false
        if(s1) return s1 + {u}
        if(s2) return s2 + {v}

This algorithm is O(k*n*2k+1). The proof is left as an exercise to the reader.

This entry was posted on Monday, April 4th, 2005 at 7:13 pm and is tagged with , , , , , , , , , , , , , , , , , , , . You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback.

Leave a Reply

Please take time to enjoy the archives: May 2005 (1) April 2005 (11) March 2005 (11) February 2005 (15) January 2005 (7)

Fresh, related resources:

Supplied by Google Blog Search