Constrainedness Including slides from Toby Walsh.

Slides:



Advertisements
Similar presentations
Constraint Satisfaction Problems
Advertisements

Constraints and Search Toby Walsh Cork Constraint Computation Centre (4C) Logic & AR Summer School, 2002.
Non-Binary Constraint Satisfaction Toby Walsh Cork Constraint Computation Center.
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
Interactive Configuration
1 Constraint Satisfaction Problems A Quick Overview (based on AIMA book slides)
1 Finite Constraint Domains. 2 u Constraint satisfaction problems (CSP) u A backtracking solver u Node and arc consistency u Bounds consistency u Generalized.
Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:
Review: Constraint Satisfaction Problems How is a CSP defined? How do we solve CSPs?
Algorithms and Problems for Quantified SAT Toby Walsh Department of Computer Science University of York England Ian P. Gent School of Computer Science.
Introduction to Approximation Algorithms Lecture 12: Mar 1.
4 Feb 2004CS Constraint Satisfaction1 Constraint Satisfaction Problems Chapter 5 Section 1 – 3.
Semidefinite Programming
Heuristics for Efficient SAT Solving As implemented in GRASP, Chaff and GSAT.
Search for satisfaction Toby Walsh Cork Constraint Computation Center
Presented by Ed Clarke Slides borrowed from P. Chauhan and C. Bartzis
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.
Constraint Satisfaction
GRASP SAT solver Presented by Constantinos Bartzis Slides borrowed from Pankaj Chauhan J. Marques-Silva and K. Sakallah.
Search in the semantic domain. Some definitions atomic formula: smallest formula possible (no sub- formulas) literal: atomic formula or negation of an.
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 24 Instructor: Paul Beame.
CS121 Heuristic Search Planning CSPs Adversarial Search Probabilistic Reasoning Probabilistic Belief Learning.
Knowledge Representation II (Inference in Propositional Logic) CSE 473.
Chapter 5 Outline Formal definition of CSP CSP Examples
Knowledge Representation II (Inference in Propositional Logic) CSE 473 Continued…
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]
Constraint Satisfaction Problems
CP Summer School Modelling for Constraint Programming Barbara Smith 1.Definitions, Viewpoints, Constraints 2.Implied Constraints, Optimization,
Graph Colouring Various Models. an obvious model SAT sets demo random graphs chromatic number maxCol phase transition.
Solvers for the Problem of Boolean Satisfiability (SAT) Will Klieber Aug 31, 2011 TexPoint fonts used in EMF. Read the TexPoint manual before you.
Constraint Satisfaction Problems Chapter 6. Review Agent, Environment, State Agent as search problem Uninformed search strategies Informed (heuristic.
1 3-COLOURING: Input: Graph G Question: Does there exist a way to 3-colour the vertices of G so that adjacent vertices are different colours? 1.What could.
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.
EMIS 8373: Integer Programming NP-Complete Problems updated 21 April 2009.
Constraint Satisfaction CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
Searching by Constraint CMSC Artificial Intelligence January 24, 2008.
Hande ÇAKIN IES 503 TERM PROJECT CONSTRAINT SATISFACTION PROBLEMS.
Chapter 5: Constraint Satisfaction ICS 171 Fall 2006.
1 Chapter 5 Constraint Satisfaction Problems. 2 Outlines  Constraint Satisfaction Problems  Backtracking Search for CSPs  Local Search for CSP  The.
Constraints and Search Toby Walsh Cork Constraint Computation Centre (4C) Logic & AR Summer School, 2002.
Chapter 5 Constraint Satisfaction Problems
Constraints and Search Toby Walsh Cork Constraint Computation Centre (4C) Logic & AR Summer School, 2002.
Review Test1. Robotics & Future Technology Future of Intelligent Systems / Ray Kurzweil futurist Ray Kurzweil / A Long Bet A Long Bet / Robot Soccer.
/425 Declarative Methods - J. Eisner 1 Random 3-SAT  sample uniformly from space of all possible 3- clauses  n variables, l clauses Which are.
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.
1 Constraint Satisfaction Problems Chapter 5 Section 1 – 3 Grand Challenge:
CHAPTER 5 SECTION 1 – 3 4 Feb 2004 CS Constraint Satisfaction 1 Constraint Satisfaction Problems.
Constraint Satisfaction Problems University of Berkeley, USA
1. 2 Outline of Ch 4 Best-first search Greedy best-first search A * search Heuristics Functions Local search algorithms Hill-climbing search Simulated.
Solving the Logic Satisfiability problem Solving the Logic Satisfiability problem Jesus De Loera.
Chapter 5 Team Teaching AI (created by Dewi Liliana) PTIIK Constraint Satisfaction Problems.
SAT Solving As implemented in - DPLL solvers: GRASP, Chaff and
Inference in Propositional Logic (and Intro to SAT) CSE 473.
Where are the hard problems?. Remember Graph Colouring? Remember 3Col?
Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:
Where are the hard problems?
Inference in Propositional Logic (and Intro to SAT)
Constraint Satisfaction Problems
Constraints and Search
Constraint satisfaction problems
Constraint Satisfaction Problems. A Quick Overview
CS 8520: Artificial Intelligence
Constraint Satisfaction Problems
GRASP-an efficient SAT solver
Constraint satisfaction problems
Presentation transcript:

Constrainedness Including slides from Toby Walsh

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) Backjumping (BJ, CBJ, DB) Maintaining arc-consistency (MAC) Limited discrepancy search (LDS) Non-chronological backtracking & learning Probing …

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

“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 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?

Kappa Defined for an ensemble of problems

Kappa (motivation)

Kappa When every state is a solution When every state is not a solution When there is a unique solution

Kappa When every state is a solution When every state is not a solution When there is a unique solution Easy Soluble Easy Insoluble On the knife edge Hard

An Example: random CSP’s Each of n variables has a uniform domain size m There is a probability p1 of a constraint between a pair of variables There is a probability p2 that a pair of values conflict (when a constraint exists)

An Example: random CSP’s

Can rearrange this formula so that we find the value of p2 such that we are at the phase transition, i.e. when kappa = 1 Then perform experiments to see if it is accurate predictor i.e. we put theory to the test

Kappa as a heuristic Minimise that

An Example: not random CSP’s

Kappa is general (3 examples) SAT with n variables, l clauses, a literals/clause Graph colouring, n vertices, e edges, m colours Number partitioning, n numbers, range (0,l], m bags with same sum

Kappa as a heuristic Minimise that

assume we only measure domain size (denominator) assume we only measure top line (numerator) assume we measure top and bottom line (numerator and denominator But that’s costly to do. Is there a low cost surrogate?

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

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