Search for satisfaction Toby Walsh Cork Constraint Computation Center

Slides:



Advertisements
Similar presentations
Propositional Satisfiability (SAT) Toby Walsh Cork Constraint Computation Centre University College Cork Ireland 4c.ucc.ie/~tw/sat/
Advertisements

10/7/2014 Constrainedness of Search Toby Walsh NICTA and UNSW
Time-Space Tradeoffs in Resolution: Superpolynomial Lower Bounds for Superlinear Space Chris Beck Princeton University Joint work with Paul Beame & Russell.
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.
The Theory of NP-Completeness
1 NP-Complete Problems. 2 We discuss some hard problems:  how hard? (computational complexity)  what makes them hard?  any solutions? Definitions 
© The McGraw-Hill Companies, Inc., Chapter 8 The Theory of NP-Completeness.
Algorithms and Problems for Quantified SAT Toby Walsh Department of Computer Science University of York England Ian P. Gent School of Computer Science.
6/2/2015 The Impact of Structure Toby Walsh Cork Constraint Computation Centre
1 Beyond NP Other complexity classes Phase transitions in P, PSPACE, … Structure Backbones, 2+p-SAT, small world topology, … Heuristics Constrainedness.
Introduction to Approximation Algorithms Lecture 12: Mar 1.
Phase Transitions of PP-Complete Satisfiability Problems D. Bailey, V. Dalmau, Ph.G. Kolaitis Computer Science Department UC Santa Cruz.
Approximation Algoirthms: Semidefinite Programming Lecture 19: Mar 22.
Semidefinite Programming
CP Formal Models of Heavy-Tailed Behavior in Combinatorial Search Hubie Chen, Carla P. Gomes, and Bart Selman
Methods for SAT- a Survey Robert Glaubius CSCE 976 May 6, 2002.
08/1 Foundations of AI 8. Satisfiability and Model Construction Davis-Putnam, Phase Transitions, GSAT Wolfram Burgard and Bernhard Nebel.
The Theory of NP-Completeness
Phase Transitions of PP-Complete Satisfiability Problems D. Bailey, V. Dalmau, Ph.G. Kolaitis Computer Science Department UC Santa Cruz.
NP-complete and NP-hard problems
AAAI00 Austin, Texas Generating Satisfiable Problem Instances Dimitris Achlioptas Microsoft Carla P. Gomes Cornell University Henry Kautz University of.
Analysis of Algorithms CS 477/677
Computational Complexity, Physical Mapping III + Perl CIS 667 March 4, 2004.
1 Backdoors To Typical Case Complexity Ryan Williams Carnegie Mellon University Joint work with: Carla Gomes and Bart Selman Cornell University.
Structure and Phase Transition Phenomena in the VTC Problem C. P. Gomes, H. Kautz, B. Selman R. Bejar, and I. Vetsikas IISI Cornell University University.
Carla P. Gomes CS4700 CS 4700: Foundations of Artificial Intelligence Carla P. Gomes Module: Instance Hardness and Phase Transitions.
1 CS 4700: Foundations of Artificial Intelligence Carla P. Gomes Module: Satisfiability (Reading R&N: Chapter 7)
Toward NP-Completeness: Introduction Almost all the algorithms we studies so far were bounded by some polynomial in the size of the input, so we call them.
Knowledge Representation II (Inference in Propositional Logic) CSE 473.
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.
Logic - Part 2 CSE 573. © Daniel S. Weld 2 Reading Already assigned R&N ch 5, 7, 8, 11 thru 11.2 For next time R&N 9.1, 9.2, 11.4 [optional 11.5]
1.1 Chapter 1: Introduction What is the course all about? Problems, instances and algorithms Running time v.s. computational complexity General description.
Distributions of Randomized Backtrack Search Key Properties: I Erratic behavior of mean II Distributions have “heavy tails”.
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
Fixed Parameter Complexity Algorithms and Networks.
1 The Theory of NP-Completeness 2012/11/6 P: the class of problems which can be solved by a deterministic polynomial algorithm. NP : the class of decision.
Boolean Satisfiability and SAT Solvers
Constrainedness Including slides from Toby Walsh.
Tonga Institute of Higher Education Design and Analysis of Algorithms IT 254 Lecture 8: Complexity Theory.
ANTs PI Meeting, Nov. 29, 2000W. Zhang, Washington University1 Flexible Methods for Multi-agent distributed resource Allocation by Exploiting Phase Transitions.
CSC 172 P, NP, Etc. “Computer Science is a science of abstraction – creating the right model for thinking about a problem and devising the appropriate.
Heavy-Tailed Phenomena in Satisfiability and Constraint Satisfaction Problems by Carla P. Gomes, Bart Selman, Nuno Crato and henry Kautz Presented by Yunho.
Techniques for Proving NP-Completeness Show that a special case of the problem you are interested in is NP- complete. For example: The problem of finding.
1 The Theory of NP-Completeness 2 Cook ’ s Theorem (1971) Prof. Cook Toronto U. Receiving Turing Award (1982) Discussing difficult problems: worst case.
Explorations in Artificial Intelligence Prof. Carla P. Gomes Module Logic Representations.
1 Chapter 34: NP-Completeness. 2 About this Tutorial What is NP ? How to check if a problem is in NP ? Cook-Levin Theorem Showing one of the most difficult.
Constraints and Search Toby Walsh Cork Constraint Computation Centre (4C) Logic & AR Summer School, 2002.
Quality of LP-based Approximations for Highly Combinatorial Problems Lucian Leahu and Carla Gomes Computer Science Department Cornell University.
/425 Declarative Methods - J. Eisner 1 Random 3-SAT  sample uniformly from space of all possible 3- clauses  n variables, l clauses Which are.
CS 3343: Analysis of Algorithms Lecture 25: P and NP Some slides courtesy of Carola Wenk.
© Daniel S. Weld 1 Logistics Problem Set 2 Due Wed A few KR problems Robocode 1.Form teams of 2 people 2.Write design document.
Balance and Filtering in Structured Satisfiability Problems Henry Kautz University of Washington joint work with Yongshao Ruan (UW), Dimitris Achlioptas.
CS6045: Advanced Algorithms NP Completeness. NP-Completeness Some problems are intractable: as they grow large, we are unable to solve them in reasonable.
Eliminating non- binary constraints Toby Walsh Cork Constraint Computation Center.
Solving the Logic Satisfiability problem Solving the Logic Satisfiability problem Jesus De Loera.
Chapter 11 Introduction to Computational Complexity Copyright © 2011 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1.
NPC.
Inference in Propositional Logic (and Intro to SAT) CSE 473.
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
Where are the hard problems?. Remember Graph Colouring? Remember 3Col?
1 The Theory of NP-Completeness 2 Review: Finding lower bound by problem transformation Problem X reduces to problem Y (X  Y ) iff X can be solved by.
1 P NP P^#P PSPACE NP-complete: SAT, propositional reasoning, scheduling, graph coloring, puzzles, … PSPACE-complete: QBF, planning, chess (bounded), …
Where are the hard problems?
Inference in Propositional Logic (and Intro to SAT)
Inference and search for the propositional satisfiability problem
NP-Completeness Yin Tat Lee
Emergence of Intelligent Machines: Challenges and Opportunities
NP-Completeness Yin Tat Lee
Presentation transcript:

Search for satisfaction Toby Walsh Cork Constraint Computation Center

Cork Constraint Computation Center (4C) Gene Freuder (director)  €6M from SFI Toby Walsh (PI)  €1.5M from SFI ~20 staff  Gene’s 3C group from NH (Wallace, …)  Existing Cork people (Bowen,O’Sullivan,…)  Lots of new staff (Beck & Little from ILOG, …, your name here) Research themes  Modelling eliminating the consultant  Uncertainty  Robustness Cork  Ireland’s 2nd city  Cultural capital

Health warning To cover more ground, credit & references may not always be given Many active researchers in this area: Achlioptas, Boros, Chaynes, Dunne, Eiter, Franco, Gent, Gomes, Hogg,..., Walsh, …,Zhang

Search for satisfaction Multi-media survey  “hot” research area My next stop  5th International Symposium on SAT (SAT-2002)  1 panel, 3 invited speakers, 9 competing systems, 50 talks

Satisfaction Propositional satisfiability (SAT)  does a truth assignment exist that satisfies a propositional formula?  NP-complete (x1 v x2) & (-x2 v x3 v -x4) x1/ True, x2/ False,...

Satisfaction Propositional satisfiability (SAT)  does a truth assignment exist that satisfies a propositional formula?  NP-complete 3-SAT  formulae in clausal form with 3 literals per clause  remains NP-complete (x1 v x2) & (-x2 v x3 v -x4) x1/ True, x2/ False,...

Why search for satisfaction? Effective method to solve many problems  Model checking  Diagnosis  Planning  …

Why search for satisfaction? Effective method to solve many problems  Model checking  Diagnosis  Planning  … Simple domain in which to understand  Problem hardness  NP-hard search  …

Outline SAT phase transition  Why it might be important for you? Problem structure  Backbones Real v random problems  Small world graphs Open problems Conclusions

Random 3-SAT  sample uniformly from space of all possible 3- clauses  n variables, l clauses

Random 3-SAT  sample uniformly from space of all possible 3- clauses  n variables, l clauses Which are the hard instances?  around l/n = 4.3 What happens with larger problems? Why are some dots red and others blue?

Random 3-SAT Varying problem size, n Complexity peak appears to be largely invariant of algorithm  backtracking algorithms like Davis-Putnam  local search procedures like GSAT What’s so special about 4.3?

Random 3-SAT Complexity peak coincides with solubility transition  l/n < 4.3 problems under- constrained and SAT  l/n > 4.3 problems over- constrained and UNSAT

Random 3-SAT Complexity peak coincides with solubility transition  l/n < 4.3 problems under- constrained and SAT  l/n > 4.3 problems over- constrained and UNSAT  l/n=4.3, problems on “knife-edge” between SAT and UNSAT

So, what’s the relevance? Livingstone model-based diagnosis system  Deep Space One Tough operating constraints  Autonomous  Real time  Limited computational resources Compiled down to propositional theory …

Deep Space One Limited computational resources Deep Space One model has 2^160 states

Deep Space One Limited computational resources Deep Space One model has 2^160 states Fortunately, far from phase boundary

Deep Space One Limited computational resources Deep Space One model has 2^160 states Fortunately, far from phase boundary Not so surprising  Very over-engineered

So what’s the relevance? Model checking  Does an implementation satisfy a specification?  PSpace in general So how can SAT help?  It’s only NP-complete!

So what’s the relevance? Model checking  Does an implementation satisfy a specification?  PSpace in general So how can SAT help?  Bounded model checking  Bound = path length in state transition diagram

Model checking SAT solvers (e.g. Davis Putnam) very effective at finding bugs  BDDs good at proving correctness l/n 4.3 time DP B DD

Model checking SAT solvers (e.g. Davis Putnam) very effective at finding bugs  BDDs good at proving correctness Surprised it took so long to see benefits of SAT solvers  DP is O(n) space, O(2^n) time  BDDs are O(2^n) space and time  Memory isn’t that cheap l/n 4.3 time DP B DD

“But phase transitions don’t occur in X?” X = some NP-complete problem X = real problems X = some other complexity class Little evidence yet to support any of these claims!

“But it doesn’t occur in X?” X = some NP-complete problem Phase transition behaviour seen in:  TSP problem (decision not optimization)  Hamiltonian circuits (but NOT a complexity peak)  number partitioning  graph colouring  independent set ...

“But it doesn’t occur in X?” X = real problems No, you just need a suitable ensemble of problems to sample from? Phase transition behaviour seen in:  job shop scheduling problems  TSP instances from TSPLib  exam Edinburgh  Boolean circuit synthesis  Latin squares (alias sports scheduling) ...

“But it doesn’t occur in X?” X = some other complexity class Ignoring trivial cases (like O(1) algorithms) Phase transition behaviour seen in:  polynomial problems like arc-consistency  PSPACE problems like QSAT and modal K ...

Random 2-SAT 2-SAT is P  linear time algorithm Random 2-SAT displays “classic” phase transition  c/n < 1, almost surely SAT  c/n > 1, almost surely UNSAT  complexity peaks around c/n=1 x1 v x2, -x2 v x3, -x1 v x3, …

Phase transitions in P 2-SAT  c/n=1 Horn SAT  transition not “sharp” Arc-consistency  rapid transition in whether problem can be made AC  peak in (median) checks

Phase transitions above NP PSpace  QSAT (SAT of QBF)  x1  x2  x3. x1 v x2 & -x1 v x3

Phase transitions above NP PSpace-complete  QSAT (SAT of QBF)  stochastic SAT  modal SAT PP-complete  polynomial-time probabilistic Turing machines  counting problems  #SAT(>= 2^n/2) [Bailey, Dalmau, Kolaitis IJCAI-2001]

Exact phase boundaries in NP Random 3-SAT is only known within bounds  3.26 < c/n < Recent result gives an exact NP phase boundary  1-in-k SAT at c/n = 2/k(k-1)  2nd order transition (like 2- SAT and unlike 3-SAT) Are there any NP phase boundaries known exactly? 1st order transitions not a characteristic of NP as has been conjectured

Structure What structures makes problems hard? How does such structure affect phase transition behaviour?

Backbone Variables which take fixed values in all solutions  alias unit prime implicates

Backbone Variables which take fixed values in all solutions  alias unit prime implicates Let f k be fraction of variables in backbone  in random 3-SAT c/n < 4.3, f k vanishing (otherwise adding clause could make problem unsat) c/n > 4.3, f k > 0 discontinuity at phase boundary (1st order)!

Backbone Search cost correlated with backbone size  if f k non-zero, then can easily assign variable “wrong” value  such mistakes costly if at top of search tree One source of “thrashing” behaviour  can tackle with randomization and rapid restarts Can we adapt algorithms to offer more robust performance guarantees?

Backbone Backbones observed in structured problems  quasigroup completion problems (QCP) colouring partial Latin squares Backbones also observed in optimization and approximation problems  coloring, TSP, blocks world planning … see [Slaney, Walsh IJCAI-2001] Can we adapt algorithms to identify and exploit the backbone structure of a problem?

2+p-SAT Morph between 2-SAT and 3- SAT  fraction p of 3-clauses  fraction (1-p) of 2-clauses

2+p-SAT Morph between 2-SAT and 3- SAT  fraction p of 3-clauses  fraction (1-p) of 2-clauses 2-SAT is polynomial (linear)  phase boundary at c/n =1  but no backbone discontinuity here!

2+p-SAT Morph between 2-SAT and 3- SAT  fraction p of 3-clauses  fraction (1-p) of 2-clauses 2-SAT is polynomial (linear)  phase boundary at c/n =1  but no backbone discontinuity here! 2+p-SAT maps from P to NP  p>0, 2+p-SAT is NP-complete

2+p-SAT phase transition

c/n p

2+p-SAT phase transition Lower bound  are the 2-clauses (on their own) UNSAT?  n.b. 2-clauses are much more constraining than 3- clauses

2+p-SAT phase transition Lower bound  are the 2-clauses (on their own) UNSAT?  n.b. 2-clauses are much more constraining than 3- clauses p <= 0.4  transition occurs at lower bound  3-clauses are not contributing!

2+p-SAT backbone f k becomes discontinuous for p>0.4  but NP-complete for p>0 ! search cost shifts from linear to exponential at p=0.4 similar behavior seen with local search algorithms Search cost against n

Structure How do we model structural features found in real problems? How does such structure affect phase transition behaviour?

The real world isn’t random? Very true! Can we identify structural features common in real world problems? Consider graphs met in real world situations  social networks  electricity grids  neural networks ...

Real versus Random Real graphs tend to be sparse  dense random graphs contains lots of (rare?) structure

Real versus Random Real graphs tend to be sparse  dense random graphs contains lots of (rare?) structure Real graphs tend to have short path lengths  as do random graphs

Real versus Random Real graphs tend to be sparse  dense random graphs contains lots of (rare?) structure Real graphs tend to have short path lengths  as do random graphs Real graphs tend to be clustered  unlike sparse random graphs

Real versus Random Real graphs tend to be sparse  dense random graphs contains lots of (rare?) structure Real graphs tend to have short path lengths  as do random graphs Real graphs tend to be clustered  unlike sparse random graphs L, average path length C, clustering coefficient (fraction of neighbours connected to each other, cliqueness measure) mu, proximity ratio is C/L normalized by that of random graph of same size and density

Small world graphs Sparse, clustered, short path lengths Six degrees of separation  Stanley Milgram’s famous 1967 postal experiment  recently revived by Watts & Strogatz  shown applies to: actors database US electricity grid neural net of a worm...

An example 1994 exam timetable at Edinburgh University  59 nodes, 594 edges so relatively sparse  but contains 10-clique less than 10^-10 chance in a random graph  assuming same size and density

An example 1994 exam timetable at Edinburgh University  59 nodes, 594 edges so relatively sparse  but contains 10-clique less than 10^-10 chance in a random graph  assuming same size and density clique totally dominated cost to solve problem

Small world graphs To construct an ensemble of small world graphs  morph between regular graph (like ring lattice) and random graph  prob p include edge from ring lattice, 1-p from random graph real problems often contain similar structure and stochastic components?

Small world graphs ring lattice is clustered but has long paths random edges provide shortcuts without destroying clustering

Small world graphs

Colouring small world graphs

Small world graphs Other bad news  disease spreads more rapidly in a small world Good news  cooperation breaks out quicker in iterated Prisoner’s dilemma

Other structural features It’s not just small world graphs that have been studied Large degree graphs  Barbasi et al’s power-law model [Walsh, IJCAI 2001] Ultrametric graphs  Hogg’s tree based model Numbers following Benford’s Law  1 is much more common than 9 as a leading digit! prob(leading digit=i) = log(1+1/i)  such clustering, makes number partitioning much easier

The future? What open questions remain? Where to next?

Open questions Prove random 3-SAT occurs at l/n = 4.3  random 2-SAT proved to be at l/n = 1  random 3-SAT transition proved to be in range 3.26 < l/n <  random 3-SAT phase transition proved to be “sharp”

Open questions Impact of structure on phase transition behaviour  some initial work on quasigroups (alias Latin squares/sports tournaments)  morphing useful tool (e.g. small worlds, 2-d to 3-d TSP, …) Optimization v decision  some initial work by Slaney & Thiebaux  economics often pushes optimization problems naturally towards feasible/infeasible phase boundary

Open questions Does phase transition behaviour give help answer P=NP?  it certainly identifies hard problems!  problems like 2+p-SAT and ideas like backbone also show promise Problems away from phase boundary can be hard  over-constrained 3-SAT region has exponential resolution proofs  under-constrained 3-SAT region can throw up occasional hard problems (early mistakes?)

Research directions in SAT Algorithm development  Fast but cheap solvers (chaff from Princeton) Basic operations are constant time (e.g. branching heuristic, finding unit clauses,..)  Nogood learning  Randomization and restarts Learning across restarts Domain enlargement  New encodings into SAT  Beyond the propositional (QBF, modal SAT, …)

Summary That’s nearly all from me!

Conclusions Phase transition behaviour ubiquitous  decision/optimization/...  NP/PSpace/P/…  random/real Phase transition behaviour gives insight into problem hardness  suggests new branching heuristics  ideas like the backbone help understand branching mistakes

Conclusions Propositional satisfiability (SAT)  Very active research area SAT2002  Useful for understanding source of problem hardness  Useful also for solving problems E.g. Planning as SAT, model checking via SAT, …  Developing new algorithms E.g. Randomization and restarts, learning, non- chronological backtracking,..

Very partial bibliography Cheeseman, Kanefsky, Taylor, Where the really hard problem are, Proc. of IJCAI-91 Gent et al, The Constrainedness of Search, Proc. of AAAI-96 Gent et al, SAT 2000, IOS Press, Fronteirs in Artificial Intelligence, 2000 Gent & Walsh, The TSP Phase Transition, Artificial Intelligence, 88: , 1996 Gent & Walsh, Analysis of Heuristics for Number Partitioning, Computational Intelligence, 14 (3), 1998 Gent & Walsh, Beyond NP: The QSAT Phase Transition, Proc. of AAAI-99 Gent et al, Morphing: combining structure and randomness, Proc. of AAAI-99 Hogg & Williams (eds), special issue of Artificial Intelligence, 88 (1-2), 1996 Mitchell, Selman, Levesque, Hard and Easy Distributions of SAT problems, Proc. of AAAI-92 Monasson et al, Determining computational complexity from characteristic ‘phase transitions’, Nature, 400, 1998 Walsh, Search in a Small World, Proc. of IJCAI-99 Watts & Strogatz, Collective dynamics of small world networks, Nature, 393, 1998 See for morehttp://