On a random walk strategy for the Q2SAT problem

18
On a random walk strategy for the Q2SAT problem K. Subramani

description

On a random walk strategy for the Q2SAT problem. K. Subramani. Topics to be covered. Definitions of 2SAT and Q2SAT problems 2 player games Motivation Related Work The random walk algorithm for 2SAT Analysis of Papadimitriou`s algorithm Prerequisites for coin-flipping to work - PowerPoint PPT Presentation

Transcript of On a random walk strategy for the Q2SAT problem

Page 1: On a random walk strategy for the Q2SAT problem

On a random walk strategy for the Q2SAT problem

K. Subramani

Page 2: On a random walk strategy for the Q2SAT problem

Topics to be covered

1. Definitions of 2SAT and Q2SAT problems2. 2 player games3. Motivation4. Related Work5. The random walk algorithm for 2SAT6. Analysis of Papadimitriou`s algorithm7. Prerequisites for coin-flipping to work8. How Q2SAT meets those prerequisites9. Conclusion

Page 3: On a random walk strategy for the Q2SAT problem

2SAT and Q2SAT

• Given a Boolean formula

where each clause has at most 2 literals from

the variable set {x1, x2, …xn}, the 2SAT

problem is to check whether this formula has

a satisfying assignment.

mCCCC ......321

Page 4: On a random walk strategy for the Q2SAT problem

2SAT and Q2SAT (contd.)

• Given a Boolean formula

and a quantifier string Q(x,y)

where each clause has at most 2 literals from

the variable set {x1, x2, …xn, y1,y2,…yn}, the Q2SAT problem is to check whether the formula Q(x,y) has

a satisfying model

mCCCC ......321

Page 5: On a random walk strategy for the Q2SAT problem

2 player games

1. Let X be the Existential player and Y be the Universal player.2. Assume without loss of generality that all x variablesare existentially quantified and the y variables are universa-lly quantified.3. Each player makes a sequence of moves non-deterministi-cally in the order specified by Q(x,y). 4. A move is a true/false guess.5. If at the end of the moves, the expression evaluates totrue, we say that X has a winning strategy and this

strategy is called a model for Q(x,y)

Page 6: On a random walk strategy for the Q2SAT problem

2 Player games (contd.)

So the QBF problem in general, is to decide whetherthe existential player has a winning strategy.

Page 7: On a random walk strategy for the Q2SAT problem

Motivation

1. Algorithmic elegance.2. How much can a simple strategy net us?3. Deeper understanding of game theory.4. First use of randomization to study QBF feasibility.5. Papadimitriou got a FOCS paper out of his 2SAT random walk algorithm! [Pap91]

Page 8: On a random walk strategy for the Q2SAT problem

Related Work

1. [Pap91] introduced the random walk algorithm for simple 2SAT.2. [WS02] applies the random walk technique to 3SAT problems with good empirical results.3. Even for HornSAT (which is in P), the random walk algorithm does not converge in a polynomial number of steps (analytically). (For a pathological example, see [Ros00].)4. [APT79] solves both 2SAT and Q2SAT in linear time, using connected components of the implication graph.

Page 9: On a random walk strategy for the Q2SAT problem

Related Work (contd.)

5. I am working on strategies which enhance simple random walk with “greed”, i.e., selecting the unsatisified clause with the fewest number of literals to fix. It works for HornSAT, but HornSAT has an extremely simple deterministic algorithm.

Page 10: On a random walk strategy for the Q2SAT problem

The random walk algorithm for 2SAT

1. Start with a random assignment for .2. If all clauses are satisfied stop.3. Pick a clause which is not satisfied.4. Pick one of the 2 literals in this clause at random and `flip´ it.5. Repeat steps (2)-(5) for 2n2 steps.6. Say that the formula is `probably unsatisfiable.´

Page 11: On a random walk strategy for the Q2SAT problem

Analysis

Let us say that the given formula is satisfiable and focus ona specific satisfying assignment T.Let the initial random assignment be T´, which doesnot satisfy Now consider a clause C which is violated by T´.At least one of the 2 literals in C must be true in T.Therefore flipping a literal at random results in T´gettingcloser to T, with probability at least one half. Likewise,T´could be moving away from T, with probability onehalf.

Page 12: On a random walk strategy for the Q2SAT problem

Analysis (contd.)

Let Xi denote the number of flips required by the abovealgorithm, assuming that the current assignment differs from T in exactly i variables. We use theprobability law: E[X] = E[E[X| Y]] (see [Ros00]) to conclude thatE[Xi]= ½ (E[Xi-1]+1)+ ½ (E[X i+1]+1)

Also note that E[X0]=0 and E[Xn]=1+E[X n-1], since ifby chance we start off with the correct assignment, noflips are required, whereas if all variables are incorrect, then a flip must move us in the right direction!

Page 13: On a random walk strategy for the Q2SAT problem

Analysis (contd.)

The above system can be solved to getE[Xn] = n2.Now applying Markov´s law, we can concludethat the probability that more than 2.n2 flipswill be required is less than ½.

Page 14: On a random walk strategy for the Q2SAT problem

Prerequisites for flipping to work

1. A literal must be flippable, i.e., there are exactly 2 values to assign to it. (Y1)2. When a literal is flipped with probability at least one half, we move in the right direction, and with probability at most one half, we move in the wrong direction. (Y2)

Y1 is trivially met in existential first order logic, by allSAT formulas, since every variable is either true or false.However, Y2 fails for even HornSAT!

Page 15: On a random walk strategy for the Q2SAT problem

Why Q2SAT meets the prerequisites

First observe that if Y1 is met by Q2SAT then Y2 istrivially met, since under the current assignment bothliterals have been set incorrectly (assuming that bothvariables are existentially quantified) and with probabilityat least ½, we will move in the right direction by choosingone at random.

Page 16: On a random walk strategy for the Q2SAT problem

Why Q2SAT meets the prerequisites

I have provided a detailed explanation of Page 4 andPage 5 of my paper of how Y1 is met by Q2CNF formulas.The main idea is that Q2SAT problems are guaranteed to have simple models, if satisfiable, i.e.,a model in which each existentially quantified variableis either true, false, or yi or the complement of yi,where yi is a universally quantified variable precedingit.

Page 17: On a random walk strategy for the Q2SAT problem

Why Q2SAT meets the prerequisites

A linear scan of the clause set cuts these choices to preciselytwo. We are now free to use Papadimitriou´s algorithmand the accompanying analysis!

Page 18: On a random walk strategy for the Q2SAT problem

Conclusion

A number of interesting problems are currently open,insofar as randomized approaches are concerned:(a) Boolean equivalence, i.e., given 2 2CNF formulas, do they have the same set of satisfying assignments?(b) UNIQUE2SAT – Does a 2CNF formula have exactly one satisfying assignment?(c) CRITICAL2SAT – Is a 2CNF formula unsatisfiable, but knocking off any clause makes it satisfiable?