Accelerating Random Walks Wei Wei and Bart Selman Dept. of Computer Science Cornell University.

Slides:



Advertisements
Similar presentations
UIUC CS 497: Section EA Lecture #2 Reasoning in Artificial Intelligence Professor: Eyal Amir Spring Semester 2004.
Advertisements

Propositional and First Order Reasoning. Terminology Propositional variable: boolean variable (p) Literal: propositional variable or its negation p 
Proofs from SAT Solvers Yeting Ge ACSys NYU Nov
Methods of Proof Chapter 7, second half.. Proof methods Proof methods divide into (roughly) two kinds: Application of inference rules: Legitimate (sound)
Technion 1 Generating minimum transitivity constraints in P-time for deciding Equality Logic Ofer Strichman and Mirron Rozanov Technion, Haifa, Israel.
Lecture 22: April 18 Probabilistic Method. Why Randomness? Probabilistic method: Proving the existence of an object satisfying certain properties without.
Department of Computer Science & Engineering
1 Backdoor Sets in SAT Instances Ryan Williams Carnegie Mellon University Joint work in IJCAI03 with: Carla Gomes and Bart Selman Cornell University.
Generating Hard Satisfiability Problems1 Bart Selman, David Mitchell, Hector J. Levesque Presented by Xiaoxin Yin.
Properties of SLUR Formulae Ondřej Čepek, Petr Kučera, Václav Vlček Charles University in Prague SOFSEM 2012 January 23, 2012.
SAT and Model Checking. Bounded Model Checking (BMC) A.I. Planning problems: can we reach a desired state in k steps? Verification of safety properties:
Proof methods Proof methods divide into (roughly) two kinds: –Application of inference rules Legitimate (sound) generation of new sentences from old Proof.
Beating Brute Force Search for Formula SAT and QBF SAT Rahul Santhanam University of Edinburgh.
Heuristics for Efficient SAT Solving As implemented in GRASP, Chaff and GSAT.
08/1 Foundations of AI 8. Satisfiability and Model Construction Davis-Putnam, Phase Transitions, GSAT Wolfram Burgard and Bernhard Nebel.
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 21 Instructor: Paul Beame.
Ryan Kinworthy 2/26/20031 Chapter 7- Local Search part 1 Ryan Kinworthy CSCE Advanced Constraint Processing.
Algorithms in Exponential Time. Outline Backtracking Local Search Randomization: Reducing to a Polynomial-Time Case Randomization: Permuting the Evaluation.
1 Towards Efficient Sampling: Exploiting Random Walk Strategy Wei Wei, Jordan Erenrich, and Bart Selman.
Technion 1 Generating minimum transitivity constraints in P-time for deciding Equality Logic Ofer Strichman and Mirron Rozanov Technion, Haifa, Israel.
Accelerating Random Walks Wei Dept. of Computer Science Cornell University (joint work with Bart Selman)
1 Backdoors To Typical Case Complexity Ryan Williams Carnegie Mellon University Joint work with: Carla Gomes and Bart Selman Cornell University.
Quantum Search Heuristics: Tad Hogg’s Perspective George Viamontes February 4, 2002.
Computability and Complexity 24-1 Computability and Complexity Andrei Bulatov Approximation.
1 CS 4700: Foundations of Artificial Intelligence Carla P. Gomes Module: Satisfiability (Reading R&N: Chapter 7)
Stochastic greedy local search Chapter 7 ICS-275 Spring 2007.
Knowledge Representation II (Inference in Propositional Logic) CSE 473 Continued…
1 Paul Beame University of Washington Phase Transitions in Proof Complexity and Satisfiability Search Dimitris Achlioptas Michael Molloy Microsoft Research.
Lukas Kroc, Ashish Sabharwal, Bart Selman Cornell University, USA SAT 2010 Conference Edinburgh, July 2010 An Empirical Study of Optimal Noise and Runtime.
Ryan Kinworthy 2/26/20031 Chapter 7- Local Search part 2 Ryan Kinworthy CSCE Advanced Constraint Processing.
1 Message Passing and Local Heuristics as Decimation Strategies for Satisfiability Lukas Kroc, Ashish Sabharwal, Bart Selman (presented by Sebastian Brand)
Sampling Combinatorial Space Using Biased Random Walks Jordan Erenrich, Wei Wei and Bart Selman Dept. of Computer Science Cornell University.
1 Exploiting Random Walk Strategies in Reasoning Wei.
Distributions of Randomized Backtrack Search Key Properties: I Erratic behavior of mean II Distributions have “heavy tails”.
1 MCMC Style Sampling / Counting for SAT Can we extend SAT/CSP techniques to solve harder counting/sampling problems? Such an extension would lead us to.
Tonga Institute of Higher Education Design and Analysis of Algorithms IT 254 Lecture 8: Complexity Theory.
CHAPTERS 7, 8 Oliver Schulte Logical Inference: Through Proof to Truth.
Theory of Computation, Feodor F. Dragan, Kent State University 1 NP-Completeness P: is the set of decision problems (or languages) that are solvable in.
INTRODUCTION TO ARTIFICIAL INTELLIGENCE COS302 MICHAEL L. LITTMAN FALL 2001 Satisfiability.
Explorations in Artificial Intelligence Prof. Carla P. Gomes Module 3 Logic Representations (Part 2)
On a random walk strategy for the Q2SAT problem K. Subramani.
1 Agenda Modeling problems in Propositional Logic SAT basics Decision heuristics Non-chronological Backtracking Learning with Conflict Clauses SAT and.
Survey Propagation. Outline Survey Propagation: an algorithm for satisfiability 1 – Warning Propagation – Belief Propagation – Survey Propagation Survey.
Explorations in Artificial Intelligence Prof. Carla P. Gomes Module Logic Representations.
On the Relation between SAT and BDDs for Equivalence Checking Sherief Reda Rolf Drechsler Alex Orailoglu Computer Science & Engineering Dept. University.
First-Order Logic and Inductive Logic Programming.
Stochastic greedy local search Chapter 7 ICS-275 Spring 2009.
SAT 2009 Ashish Sabharwal Backdoors in the Context of Learning (short paper) Bistra Dilkina, Carla P. Gomes, Ashish Sabharwal Cornell University SAT-09.
CPSC 422, Lecture 21Slide 1 Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 21 Oct, 30, 2015 Slide credit: some slides adapted from Stuart.
CSCI-256 Data Structures & Algorithm Analysis Lecture Note: Some slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. 29.
Accelerating Random Walks Wei Wei and Bart Selman.
CS6045: Advanced Algorithms NP Completeness. NP-Completeness Some problems are intractable: as they grow large, we are unable to solve them in reasonable.
Heuristics for Efficient SAT Solving As implemented in GRASP, Chaff and GSAT.
1 CPSC 320: Intermediate Algorithm Design and Analysis July 30, 2014.
1 Propositional Logic Limits The expressive power of propositional logic is limited. The assumption is that everything can be expressed by simple facts.
CSC 413/513: Intro to Algorithms
Logical Agents Chapter 7. Outline Knowledge-based agents Propositional (Boolean) logic Equivalence, validity, satisfiability Inference rules and theorem.
SAT Solving As implemented in - DPLL solvers: GRASP, Chaff and
Inference in Propositional Logic (and Intro to SAT) CSE 473.
Proof Methods for Propositional Logic CIS 391 – Intro to Artificial Intelligence.
Heuristics for Efficient SAT Solving As implemented in GRASP, Chaff and GSAT.
Inference in Propositional Logic (and Intro to SAT)
Introduction to Randomized Algorithms and the Probabilistic Method
Inference and search for the propositional satisfiability problem
Computability and Complexity
First-Order Logic and Inductive Logic Programming
Local Search Strategies: From N-Queens to Walksat
NP-Completeness Yin Tat Lee
Complexity 6-1 The Class P Complexity Andrei Bulatov.
NP-Completeness Yin Tat Lee
Presentation transcript:

Accelerating Random Walks Wei Wei and Bart Selman Dept. of Computer Science Cornell University

Introduction – local search  Local search methods are a viable alternative to backtrack style methods for solving Boolean satisfiability (SAT) problems.  First, such methods were based purely on greedy hill-climb search (e.g., GSAT).  Later, random “walk-style” methods (WalkSat and its variants) substantially improved performance — such methods combine a random walk strategy with a greedy search bias.

Introduction - practice  Random walk-style methods are successful on hard randomly generated instances, as well as on a number of real-world benchmarks.  However, they are generally less effective in highly structured domains compared to backtrack methods such as DPLL.  Key issue: random walk needs O(N 2 ) flips to propagate dependencies among variables, while in unit-propagation in DPLL takes only O(N).  In this talk, we will show how one can accelerate random walk search methods.

Overview  Random Walk Strategies - unbiased random walk - biased random walk  Chain Formulas - binary chains - ternary chains  Practical Problems  Conclusion and Future Directions

Unbiased (Pure) Random Walk for SAT Procedure Random-Walk (RW) Start with a random truth assignment Repeat c:= an unsatisfied clause chosen at random x:= a variable in c chosen at random flip the truth value of x Until a satisfying assignment is found

Unbiased RW on any satisfiable 2SAT Formula  Given a satisfiable 2SAT formula with n variables, a satisfying assignment will be reached by Unbiased RW in O(n 2 ) steps with high probability. (Papadimitriou, 1991)  Elegant proof! (next)

Given a satisfiable 2-SAT formula F. RW starts with a random truth assignment A0. Consider an unsatisfied clause: (x_3 or (not x_4)) A0 must have x_3 False and x_4 True (both “wrong”) A satisfying truth assignment, T, must have x_3 True or x_4 False (or both) Now, “flip” truth value of x_3 or x_4. With (at least) 50% chance, Hamming distance to satisfying assignment T is reduced by 1. I.e., we’re moving the right direction! (of course, with 50% (or less) we are moving in the wrong direction… doesn’t matter!)

We have an unbiased random walk with a reflecting barrier at distance N from T (max Hamming distance) and an absorbing barrier (satisfying assignment) at distance 0. We start at a Hamming distance of approx. ½ N. Property of unbiased random walks: after N^2 flips, with high probability, we will hit the origin (the satisfying assignment). So, O(N^2) randomized algorithm (worst-case!) for 2-SAT. TA0 T

Unfortunately, does not work for k-SAT with k>= 3.  Reason: example unsat clause: (x_1 or (not x_4) or x_5) now only 1/3 chance (worst-case) of making the right flip! (Also, Schoening 1999.)

Unbiased RW on 3SAT Formulas Random walk takes exponential number of steps to reach 0. (Also, Parkes CP-2002.) T A0

Comments on RW 1)Random Walk is highly “myopic” does not take into account any gradient of the objective function (= number of unsatisfied clauses)! Purely “local” fixes. 2)Can we make RW practical for SAT? Yes --- inject greedy bias into walk  biased Random Walk.

Biased Random Walk (1 st minimal greedy bias) Procedure Random-Walk-with-Freebie (RWF) Start with random truth assignment Repeat c:= an unsatisfied clause chosen at random if there exist a variable x in c with break value = 0 // greedy bias flip the value of x (a “freebie” flip) else x:= a variable in c chosen at random // pure walk flip the value of x Until a satisfying assignment is found break value == # of clauses that become unsatisfied because of flip.

Biased Random Walk (adding more greedy bias) Procedure WalkSat Repeat c:= an unsatisfied clause chosen at random if there exist a variable x in c with break value = 0 // greedy bias flip the value of x (freebie move) else with probability p // pure walk 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 // more greedy bias flip the value of x Until a satisfying assignment is found Note: tune parameter p.

Chain Formulas  To better 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 effectively demonstrate the extreme properties of RW style algorithms.

Binary Chains  Consider formulas 2-SAT chain, F 2chain x 1  x 2 x 2  x 3 … x n-1  x n x n  x 1 Note: Only two satisfying assignments --- TTTTTT … and FFFFFF…

Binary Chains Walk is exactly balanced.

Binary Chains  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.  Greedy bias does not help in this case: both RWF and WalkSat takes  n 2 ) flips to reach a satisfying assignment on these formulas.

Speeding up Random Walks on Binary Chains Pure binary chain Binary chain with redundancies (implied clauses) Aside: Note small-world flavor (Watts & Strogatz 99, Walsh 00).

Results: Speeding up Random Walks on Binary Chains * : empirical results ** : theoretical proof available Pure binary chain Chain with redundancies RW  (n 2 ) ** RWF  (n 2 ) **  (n 1.2 ) * WalkSat  (n 2 ) *  (n 1.1 ) * Becomes almost like unit prop.

Ternary Chains In general, even a small bias in the wrong direction leads to exponential time to reach 0.

Ternary Chains  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 Note: Only one satisfying assign.: TTTTT… *These formulas are inspired by Prestwich [2001]

Ternary Chains long link short link medium link Effect of X1 and X2 needs to propagate through chain.

Theoretical Results on 3-SAT Chains Function low(i)Expected run time of pure RW i-2 (highly local) ~ Fib(n) (i.e., exp.)  i/2  (interm. reach) O(n. n log n ) (i.e., quasi-poly)  log i  (interm. reach) O(n 2. (log n) 2 ) (i.e., poly) 1 (full back reach) O(n 2 ) low(i) captures how far back the clauses reach.

Proof  The proofs of these claims are quite involved, and are available at  Here, just the intuitions.  Each RW process on these formulas can be decomposed into a series of decoupled, simpler random walks.

Example: Decomposition    Start Sat assign.

So, the process decomposes into a series of decoupled walks of the form (requires detailed proof): 11…101…11  11…111… / / /3 zizi z i +z low(i) z i +z i-1

Recurrence Relations Our formula structure gives us: 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

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 This leads to the complexity results for the overall RW.

Results for RW on 3-SAT chains. 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 )

Recap Chain Formula Results  Adding implied constraints capturing long- range dependencies speeds random walk on 2-Chain to near linear time.  Certain long-range dependencies in 3-SAT lead to poly-time convergence of random walks.  Can we take advantage of these results on practical problem instances? Yes! (next)

Results on Practical Benchmarks  Idea: Use a formula preprocessor to uncover long- range dependencies and add clauses capturing those dependencies to the formula.  We adapted Brafman’s formula preprocessor to do so. (Brafman 2001)  Experiments on recent verification benchmark. (Velev 1999)

Empirical Results SSS-SAT-1.0 instances (Velev 1999). 100 total.  level of redundancy added (20% near optimal) Formulas (redun. level) <40 sec<400 sec<4000 sec  =  =  =

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

Conclusions  We introduced a method for speeding up random walk style SAT algorithms based on the addition of constraints that capture long range dependencies.  On a binary chain, we showed how by adding implied clauses, biased RW becomes almost as effective as unit-propagation.

Conclusions, Cont.  In our formal analysis of ternary chains, we showed how the performance of RW varies from exponential to polynomial depending on the range of dependency links. We identified the first subclass of 3-SAT problems solvable in poly-time by unbiased RW  We gave a practical validation of our approach.

Future Directions  It seems likely that many other dependency structures could speed up random walk style methods.  It should be possible to develop preprocessor to uncover other dependencies. For example, in graph coloring problem we have:  x 1   x 4,  x 2   x 5,  x 3   x 6, … x 1  x 4  x 7  x 10, …

The end.

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

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

WalkSat vs. RWF

Empirically Determine Optimal Redundancy Rate

Empirical Results: Unbiased Random Walks

Empirical Results: Biased and Unbiased Random Walks

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

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

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