Presentation is loading. Please wait.

Presentation is loading. Please wait.

Accelerating Random Walks Wei Wei and Bart Selman.

Similar presentations


Presentation on theme: "Accelerating Random Walks Wei Wei and Bart Selman."— Presentation transcript:

1 Accelerating Random Walks Wei Wei and Bart Selman

2 Introduction – local search  Local Search methods have become viable alternative to backtrack style methods  For SAT, the first local methods are based on greedy hill-climbing search  Later, random walk style methods (WalkSat and its variants) provide great improvements — these methods combine a random walk strategy with a greedy bias

3 Introduction – theory  On theory side, Papadimitriou (1991) shows unbiased random walk reach a satisfying assignment in O(N 2 ) on an arbitrary satisfiable 2SAT formula  Schoening (1999) shows a series of short unbiased random walk on a 3-SAT problem will find a solution in O(1.334 N ) flips  Parkes (CP 2002) shows empirically for random 3-sat, when clause/variable <2.65, unbiased RW finds a solution in linear flips. Otherwise, it appears to take greater than polynomial time

4 Introduction - practice  Random walk style methods are successful in randomly generated instances, as well as in a bunch of real-world domains  However, they are generally less effective in highly structured domains compared to DPLL  One of the reasons is random walk needs O(N 2 ) flips to propagate dependencies among variables, while in DPLL, unit-propagation takes linear time

5 Overview  Introduction  Random Walk Strategies - unbiased random walk 1. on 2SAT formulas 2. on 3SAT formulas - biased random walk 1. RWF 2. WalkSat  Chain Formulas - binary chains - ternary chains  Practical Problems  Conclusion and Future Directions

6 Unbiased (Pure) Random Walk Strategy Procedure RW Repeat c:= an unsatisfied clause chosen at random x:= a variable in c chosen at random flip the value of x Until a satisfying assignment is found

7 Unbiased RW on any satisfiable 2SAT Formula  If a 2SAT formula of n variables is satisfiable, a satisfying assignment will be reached by Unbiased RW in O(n 2 ) steps with high probability (Papadimitriou, 1991)

8 Unbiased RW on any satisfiable 2SAT Formula T T’ Reach T in O(n 2 ) time with probability going to 1

9 Unbiased RW on 3SAT Formulas

10  RW is heavily biased away from the solution under consideration  Exponential number of flips required to reach the solution  In practice, pure RW performs poorly on hard random 3SAT formula (Parkes, CP2002)

11 Biased Random Walk Procedure RWF Repeat c:= an unsatisfied clause chosen at random if there exist a variable x in c with break value = 0 flip the value of x (freebie move) else x:= a variable in c chosen at random flip the value of x Until a satisfying assignment is found

12 Biased Random Walk Procedure WalkSat Repeat c:= an unsatisfied clause chosen at random if there exist a variable x in c with break value = 0 flip the value of x (freebie move) else with probability p x:= a variable in c chosen at random flip the value of x with probability (1-p) x:= a variable in c with smallest break value flip the value of x Until a satisfying assignment is found

13 Chain Formulas  To understand the behavior of pure and biased RW procedures on SAT instances, we introduce Chain Formulas  These formulas have long chains of dependencies between variables  They demonstrate the extreme properties of RW style algorithms

14 Binary Chains  Consider formulas F 2chain x 1  x 2 x 2  x 3 … x n-1  x n x n  x 1

15 Binary Chains

16  We obtain the following theorem Theorem 1. The RW procedure takes  n 2 ) steps to find a satisfying assignment of F 2chain.  DPLL algorithm’s unit propagation mechanism finds an assignment for F 2chain in linear time.  Our experiments and theoretic analysis show that adding a greedy bias to random walk does not help in this case: both RWF and WalkSat takes  n 2 ) flips to reach a satisfying assignment on these formulas

17 Speeding up Random Walks on Binary Chains Pure binary chain BCR

18 Speeding up Random Walks on Binary Chains * : empirical results ** : theoretical proof available Pure binary chain BCR RW  (n 2 ) ** RWF  (n 2 ) **  (n 1.2 ) * WalkSat  (n 2 ) *  (n 1.1 ) *

19 Formulas of Different Sizes and Redundancy Rates Redundant rate = # redundant clauses / n

20 WalkSat vs. RWF

21 Empirically Determine Optimal Redundancy Rate

22 Ternary Chains

23  Consider formulas F 3chain, low(i) x 1 x 2 x 1  x 2  x 3 … x low(i)  x i-1  x i … x low(n)  x n-1  x n *These formulas are inspired by Prestwich [2001]

24 Ternary Chains

25 Theoretical Results Function low(i)Expected Running time of pure RW i-2~ Fib(n)  i/2  O(n. n log n )  log i  O(n 2. (log n) 2 ) 1O(n 2 )

26 Proof  The proofs of these claims are quite involved, and are available at http://www.cs.cornell.edu/home/selman/weiwei.pdf  But the intuition behind the proofs are simple. Namely, each RW process on these formulas can be decomposed into a bunch of components, which are in turn solved by solving a series of recurrence relations

27 Decomposition of RW 110101  111111 110101 010101010101 110001 010001 100001 111001 110001 101001 111001 111111 111101 110101 010101010101 110001 100001 111001 110001 110101 010001 101001 111001 111101 111111 110111 010111 110111 100111 111111 110111 111101 111001 101001 111001 111101 111111 110111  111111 111101  111111

28 Recurrence Relations  Therefore, we have E(f(z i )) = (E(f(z low(i) ) + E(f(z i ) + 1)/3 + (E(f(z i-1 ) + E(f(z i ) + 1)/3 + 1/3  E(f(z i )) = E(f(z low(i) ) + E(f(z i-1 ) + 3

29 Recurrence Relations  Solving this recurrence for different low(i)’s, we get Function low(i)E(f(z i )) i-2  Fib(i)  i/2  i log i  log i  i. (log i) 2 1  i i From this table, it is easy to get the complexity results shown

30 Theoretical Results Function low(i)Expected Running time of pure RW i-2~ Fib(n)  i/2  O(n. n log n )  log i  O(n 2. (log n) 2 ) 1O(n 2 )

31 Empirical Results: Unbiased Random Walks

32 Empirical Results: Biased and Unbiased Random Walks

33 Practical Problems  Brafman’s 2-Simplify method is an ideal tool to help us discover long-range dependencies  It simplifies a CNF formula in the following steps: 1.It constructs an implication graph from binary clauses, and collapses strongly connected components in this graph 2.It generates transitive closure of the graph, deduces through binary and hyper-resolutions, and removes assigned variables 3.It removes transitively redundant links to keep the number of edge minimal 4.It translates the graph back to binary clauses

34 Practical Problems 1.constructs an implication graph from binary clauses, and collapses strongly connected components in this graph 2.generates transitive closure of the graph, deduces through binary and hyper-resolutions, and removes assigned variables 3.steps through the redundancy removal steps, and removes each implied link with probability (1-  ) 4.translates the graph back to binary clauses

35 Practical Problems Number of instance WalkSat (noise = 0.5) solved (SSS-SAT-1.0 by Velev) Formulas<40 sec<400 sec<4000 sec  = 0.0 152642  = 0.2 8598100  = 1.0 133364

36 Optimal Redundancy Rate Time vs Redundancy Rate Flips vs Redundancy Rate WalkSat(noise=50) on dlx2_cc_bug01.cnf from SAT-1.0 Suite

37 Related Work  Cha and Iwama (1996) studied the effect of adding clauses during local search process. But they focus on resolvents of unsat clauses at local minima, and their selected neighbors. Our results suggested long range dependencies may be more important to uncover

38 Conclusions  We show how to speed up random walk style algorithms – introduce constraints that capture long range dependencies  In our formal analysis of ternary chains, we show performance of RW varies from exponential to polynomial depending on the range of dependency links. We identify a sub-case that is solvable in poly-time by unbiased RW  In binary chain, we show with added implied clauses, biased RW becomes almost as effective as unit-propagation  We use practical problems to validate our approach

39 Future Directions  It should be possible to develop preprocessor to uncover other type of dependencies, for example, in graph coloring problem, etc  x 1   x 4,  x 2   x 5,  x 3   x 6, … x 1  x 4  x 7  x 10, …


Download ppt "Accelerating Random Walks Wei Wei and Bart Selman."

Similar presentations


Ads by Google