accelerating random walks wei wei and bart selman

39
Accelerating Random Walks Wei Wei and Bart Selman

Upload: amber-hoover

Post on 06-Jan-2018

225 views

Category:

Documents


2 download

DESCRIPTION

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

TRANSCRIPT

Page 1: Accelerating Random Walks Wei Wei and Bart Selman

Accelerating Random Walks

Wei Wei and Bart Selman

Page 2: Accelerating Random Walks Wei Wei and Bart Selman

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

Page 3: Accelerating Random Walks Wei Wei and Bart Selman

Introduction – theory

On theory side, Papadimitriou (1991) shows unbiased random walk reach a satisfying assignment in O(N2) 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.334N) 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

Page 4: Accelerating Random Walks Wei Wei and Bart Selman

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(N2) flips to propagate dependencies among variables, while in DPLL, unit-propagation takes linear time

Page 5: Accelerating Random Walks Wei Wei and Bart Selman

Overview

Introduction Random Walk Strategies - unbiased random walk

1. on 2SAT formulas2. on 3SAT formulas

- biased random walk1. RWF2. WalkSat

Chain Formulas - binary chains - ternary chains Practical Problems Conclusion and Future Directions

Page 6: Accelerating Random Walks Wei Wei and Bart Selman

Unbiased (Pure) Random Walk Strategy

Procedure RWRepeat

c:= an unsatisfied clause chosen at randomx:= a variable in c chosen at randomflip the value of x

Until a satisfying assignment is found

Page 7: Accelerating Random Walks Wei Wei and Bart Selman

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(n2) steps with high probability (Papadimitriou, 1991)

Page 8: Accelerating Random Walks Wei Wei and Bart Selman

Unbiased RW on any satisfiable 2SAT Formula

T T’

Reach T in O(n2) time with probability going to 1

Page 9: Accelerating Random Walks Wei Wei and Bart Selman

Unbiased RW on 3SAT Formulas

Page 10: Accelerating Random Walks Wei Wei and Bart Selman

Unbiased RW on 3SAT Formulas

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)

Page 11: Accelerating Random Walks Wei Wei and Bart Selman

Biased Random Walk

Procedure RWFRepeat

c:= an unsatisfied clause chosen at randomif 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 randomflip the value of x

Until a satisfying assignment is found

Page 12: Accelerating Random Walks Wei Wei and Bart Selman

Biased Random Walk

Procedure WalkSatRepeat

c:= an unsatisfied clause chosen at randomif there exist a variable x in c with break value = 0flip the value of x (freebie move)else with probability px:= a variable in c chosen at randomflip the value of xwith probability (1-p)x:= a variable in c with smallest break valueflip the value of x

Until a satisfying assignment is found

Page 13: Accelerating Random Walks Wei Wei and Bart Selman

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

Page 14: Accelerating Random Walks Wei Wei and Bart Selman

Binary Chains

Consider formulas F2chain

x1 x2

x2 x3

xn-1 xn

xn x1

Page 15: Accelerating Random Walks Wei Wei and Bart Selman

Binary Chains

Page 16: Accelerating Random Walks Wei Wei and Bart Selman

Binary Chains

We obtain the following theoremTheorem 1. The RW procedure takes n2) steps to find a satisfying assignment of F2chain.

DPLL algorithm’s unit propagation mechanism finds an assignment for F2chain 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 n2) flips to reach a satisfying assignment on these formulas

Page 17: Accelerating Random Walks Wei Wei and Bart Selman

Speeding up Random Walks on Binary Chains

Pure binary chain BCR

Page 18: Accelerating Random Walks Wei Wei and Bart Selman

Speeding up Random Walks on Binary Chains

*: empirical results**: theoretical proof available

Pure binary chain

BCR

RW (n2)** (n2)**

RWF (n2)** (n1.2)*

WalkSat (n2)* (n1.1)*

Page 19: Accelerating Random Walks Wei Wei and Bart Selman

Formulas of Different Sizes and Redundancy Rates

Redundant rate = # redundant clauses / n

Page 20: Accelerating Random Walks Wei Wei and Bart Selman

WalkSat vs. RWF

Page 21: Accelerating Random Walks Wei Wei and Bart Selman

Empirically Determine Optimal Redundancy Rate

Page 22: Accelerating Random Walks Wei Wei and Bart Selman

Ternary Chains

Page 23: Accelerating Random Walks Wei Wei and Bart Selman

Ternary Chains

Consider formulas F3chain, low(i) x1

x2

x1 x2 x3

…xlow(i) xi-1 xi

xlow(n) xn-1 xn

*These formulas are inspired by Prestwich [2001]

Page 24: Accelerating Random Walks Wei Wei and Bart Selman

Ternary Chains

Page 25: Accelerating Random Walks Wei Wei and Bart Selman

Theoretical Results

Function low(i) Expected Running time of pure RW

i-2 ~ Fib(n)

i/2 O(n . nlog n)

log i O(n2 . (log n)2)

1 O(n2)

Page 26: Accelerating Random Walks Wei Wei and Bart Selman

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

Page 27: Accelerating Random Walks Wei Wei and Bart Selman

Decomposition of RW110101 111111

110101010101

110001010001

100001

111001110001

101001111001

111111111101

110101010101

110001100001

111001110001

110101

010001

101001111001111101111111

110111010111

110111100111

111111110111

111101

111001

101001111001111101111111

110111 111111

111101 111111

Page 28: Accelerating Random Walks Wei Wei and Bart Selman

Recurrence Relations

Therefore, we haveE(f(zi)) = (E(f(zlow(i)) + E(f(zi) + 1)/3

+ (E(f(zi-1) + E(f(zi) + 1)/3

+ 1/3 E(f(zi)) = E(f(zlow(i)) + E(f(zi-1) + 3

Page 29: Accelerating Random Walks Wei Wei and Bart Selman

Recurrence Relations

Solving this recurrence for different low(i)’s, we get Function low(i) E(f(zi))

i-2 Fib(i)

i/2 ilog i

log i i . (log i)2

1 i

From this table, it is easy to get the complexity results shown

Page 30: Accelerating Random Walks Wei Wei and Bart Selman

Theoretical Results

Function low(i) Expected Running time of pure RW

i-2 ~ Fib(n)

i/2 O(n . nlog n)

log i O(n2 . (log n)2)

1 O(n2)

Page 31: Accelerating Random Walks Wei Wei and Bart Selman

Empirical Results: Unbiased Random Walks

Page 32: Accelerating Random Walks Wei Wei and Bart Selman

Empirical Results: Biased and Unbiased Random Walks

Page 33: Accelerating Random Walks Wei Wei and Bart Selman

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 graph2. It generates transitive closure of the graph, deduces through

binary and hyper-resolutions, and removes assigned variables3. It removes transitively redundant links to keep the number of

edge minimal4. It translates the graph back to binary clauses

Page 34: Accelerating Random Walks Wei Wei and Bart Selman

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

Page 35: Accelerating Random Walks Wei Wei and Bart Selman

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 15 26 42 = 0.2 85 98 100 = 1.0 13 33 64

Page 36: Accelerating Random Walks Wei Wei and Bart Selman

Optimal Redundancy Rate

Time vs Redundancy Rate Flips vs Redundancy Rate

WalkSat(noise=50) on dlx2_cc_bug01.cnf from SAT-1.0 Suite

Page 37: Accelerating Random Walks Wei Wei and Bart Selman

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

Page 38: Accelerating Random Walks Wei Wei and Bart Selman

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

Page 39: Accelerating Random Walks Wei Wei and Bart Selman

Future Directions

It should be possible to develop preprocessor to uncover other type of dependencies, for example, in graph coloring problem, etcx1 x4 , x2 x5 , x3 x6, …

x1 x4 x7 x10, …