Constraints and Search Toby Walsh Cork Constraint Computation Centre (4C) Logic & AR Summer School, 2002.

Slides:



Advertisements
Similar presentations
Non-Binary Constraint Satisfaction Toby Walsh Cork Constraint Computation Center.
Advertisements

Propositional Satisfiability (SAT) Toby Walsh Cork Constraint Computation Centre University College Cork Ireland 4c.ucc.ie/~tw/sat/
10/7/2014 Constrainedness of Search Toby Walsh NICTA and UNSW
1 Constraint Satisfaction Problems A Quick Overview (based on AIMA book slides)
Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:
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.
Approximation Algoirthms: Semidefinite Programming Lecture 19: Mar 22.
Semidefinite Programming
08/1 Foundations of AI 8. Satisfiability and Model Construction Davis-Putnam, Phase Transitions, GSAT Wolfram Burgard and Bernhard Nebel.
Search for satisfaction Toby Walsh Cork Constraint Computation Center
Constraint Satisfaction Problems
GRASP-an efficient SAT solver Pankaj Chauhan. 6/19/ : GRASP and Chaff2 What is SAT? Given a propositional formula in CNF, find an assignment.
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
1 Backdoors To Typical Case Complexity Ryan Williams Carnegie Mellon University Joint work with: Carla Gomes and Bart Selman Cornell 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)
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”.
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.
Constrainedness Including slides from Toby Walsh.
Solvers for the Problem of Boolean Satisfiability (SAT) Will Klieber Aug 31, 2011 TexPoint fonts used in EMF. Read the TexPoint manual before you.
Chapter 5 Section 1 – 3 1.  Constraint Satisfaction Problems (CSP)  Backtracking search for CSPs  Local search for CSPs 2.
CP Summer School Modelling for Constraint Programming Barbara Smith 2. Implied Constraints, Optimization, Dominance Rules.
Heavy-Tailed Phenomena in Satisfiability and Constraint Satisfaction Problems by Carla P. Gomes, Bart Selman, Nuno Crato and henry Kautz Presented by Yunho.
EMIS 8373: Integer Programming NP-Complete Problems updated 21 April 2009.
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.
On the Relation between SAT and BDDs for Equivalence Checking Sherief Reda Rolf Drechsler Alex Orailoglu Computer Science & Engineering Dept. University.
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.
An Introduction to Artificial Intelligence Lecture 5: Constraint Satisfaction Problems Ramin Halavati In which we see how treating.
© 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.
Accelerating Random Walks Wei Wei and Bart Selman.
Balance and Filtering in Structured Satisfiability Problems Henry Kautz University of Washington joint work with Yongshao Ruan (UW), Dimitris Achlioptas.
1. 2 Outline of Ch 4 Best-first search Greedy best-first search A * search Heuristics Functions Local search algorithms Hill-climbing search Simulated.
Eliminating non- binary constraints Toby Walsh Cork Constraint Computation Center.
Solving the Logic Satisfiability problem Solving the Logic Satisfiability problem Jesus De Loera.
CSC 413/513: Intro to Algorithms
SAT Solving As implemented in - DPLL solvers: GRASP, Chaff and
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?
The NP class. NP-completeness Lecture2. The NP-class The NP class is a class that contains all the problems that can be decided by a Non-Deterministic.
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
Empirical Comparison of Preprocessing and Lookahead Techniques for Binary Constraint Satisfaction Problems Zheying Jane Yang & Berthe Y. Choueiry Constraint.
NP-Completeness Yin Tat Lee
Constraints and Search
Artificial Intelligence
NP-Completeness Yin Tat Lee
Constraint Satisfaction Problems
GRASP-an efficient SAT solver
Presentation transcript:

Constraints and Search Toby Walsh Cork Constraint Computation Centre (4C) Logic & AR Summer School, 2002

Constraint satisfaction Constraint satisfaction problem (CSP) is a triple where: –V is set of variables –Each X in V has set of values, D_X Usually assume finite domain {true,false}, {red,blue,green}, [0,10], … –C is set of constraints Goal: find assignment of values to variables to satisfy all the constraints

Constraint solver Tree search –Assign value to variable –Deduce values that must be removed from future/unassigned variables Constraint propagation –If any future variable has no values, backtrack else repeat Number of choices –Variable to assign next, value to assign Some important refinements like nogood learning, non-chronological backtracking, …

Constraint propagation Arc-consistency (AC) –A binary constraint r(X1,X2) is AC iff for every value for X1, there is a consistent value (often called support) for X2 and vice versa E.g. With 0/1 domains and the constraint X1 =/= X2 Value 0 for X1 is supported by value 1 for X2 Value 1 for X1 is supported by value 0 for X2 … –A problem is AC iff every constraint is AC

Tree search Backtracking (BT) Forward checking (FC) Maintaining arc-consistency (MAC) Limited discrepany search (LDS) Non-chronological backtracking & learning

Modelling Choose a basic model Consider auxiliary variables –To reduce number of constraints, improve propagation Consider combined models –Channel between views Break symmetries Add implied constraints –To improve propagation

Propositional Satisfiability SAT –does a truth assignment exist that satisfies a propositional formula? –special type of constraint satisfaction problem Variables are Boolean Constraints are formulae –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,...

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 –l/n=4.3, problems on “knife-edge” between SAT and UNSAT

Shape –“Sharp” (in a technical sense) [Friedgut 99] Location –2-SAT occurs at l/n=1 [Chavatal & Reed 92, Goerdt 92] –3-SAT occurs at 3.26 < l/n < Theoretical results

“But it doesn’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 Phase transition behaviour seen in: –polynomial problems like arc-consistency –PSPACE problems like QSAT and modal K –...

Algorithms at the phase boundary What do we understand about problem hardness at the phase boundary? How can this help build better algorithms?

Looking inside search Three key insights –constrainedness “knife- edge” –backbone structure –2+p-SAT Suggests branching heuristics –also insight into branching mistakes

Inside SAT phase transition Random 3-SAT, l/n =4.3 Davis Putnam algorithm –tree search through space of partial assignments –unit propagation Clause to variable ratio l/n drops as we search => problems become less constrained Aside: can anyone explain simple scaling? l/n against depth/n

Inside SAT phase transition But (average) clause length, k also drops => problems become more constrained Which factor, l/n or k wins? –Look at kappa which includes both and is based on prob(SAT) Aside: why is there again such simple scaling? Clause length, k against depth/n

Constrainedness knife-edge kappa against depth/n

Constrainedness knife-edge Seen in other problem domains –number partitioning, … Seen on “real” problems –exam timetabling (alias graph colouring) Suggests branching heuristic –“get off the knife-edge as quickly as possible” –minimize or maximize-kappa heuristics must take into account branching rate, max-kappa often therefore not a good move!

Minimize constrainedness Many existing heuristics minimize-kappa –or proxies for it For instance –Karmarkar-Karp heuristic for number partitioning –Brelaz heuristic for graph colouring –Fail-first heuristic for constraint satisfaction –… Can be used to design new heuristics –removing some of the “black art”

Backbone Variables which take fixed values in all solutions –alias unit prime implicates Let f k be fraction of variables in backbone –l/n < 4.3, f k vanishing (otherwise adding clause could make problem unsat) –l/n > 4.3, f k > 0 discontinuity at phase boundary!

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 Backbones seen in other problems –graph colouring –TSP –… Can we make algorithms that identify and exploit the backbone structure of a problem?

2+p-SAT 2-SAT is polynomial (linear) but 3-SAT is NP-complete –2-SAT, unlike 3-SAT, has no backbone discontinuity Morph between 2-SAT and 3- SAT –fraction p of 3-clauses –fraction (1-p) of 2-clauses 2+p-SAT maps from P to NP –p>0, 2+p-SAT is NP-complete

2+p-SAT

Observed search cost –linear for p<0.4 –exponential for p>0.4 But NP-hard for all p>0!

2+p-SAT Discontinuous 3-SAT like Continuous 2-SAT like

Simple bound Are the 2-clauses UNSAT? –2-clauses are more constraining than 3-clauses For p<0.4, transition occurs at lower bound! –3-clauses are not contributing

2+p-SAT trajectories

Structure Can we model structural features not found in uniform random problems? How does such structure affect our algorithms and 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 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 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 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 –problems in which optimized quantity appears in control parameter and those in which it does not

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

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 AI becoming more of an experimental science? –theory and experiment complement each other well –increasing use of approximate/heuristic theories to keep theory in touch with rapid experimentation Phase transition behaviour is FUN –lots of nice graphs as promised –and it is teaching us lots about complexity and algorithms!

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 & 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