Constraint Satisfaction and the Davis-Putnam-Logeman-Loveland Procedure Henry Kautz.

Slides:



Advertisements
Similar presentations
Constraint Satisfaction Problems
Advertisements

Constraint Satisfaction Problems Russell and Norvig: Chapter
Constraint Satisfaction Problems
1 Constraint Satisfaction Problems A Quick Overview (based on AIMA book slides)
1 Constraint Satisfaction Problems. 2 Intro Example: 8-Queens Generate-and-test: 8 8 combinations.
1 Finite Constraint Domains. 2 u Constraint satisfaction problems (CSP) u A backtracking solver u Node and arc consistency u Bounds consistency u Generalized.
MBD and CSP Meir Kalech Partially based on slides of Jia You and Brian Williams.
Artificial Intelligence Constraint satisfaction problems Fall 2008 professor: Luigi Ceccaroni.
Proofs from SAT Solvers Yeting Ge ACSys NYU Nov
Constraint Satisfaction problems (CSP)
Review: Constraint Satisfaction Problems How is a CSP defined? How do we solve CSPs?
Constraint Satisfaction Problems
4 Feb 2004CS Constraint Satisfaction1 Constraint Satisfaction Problems Chapter 5 Section 1 – 3.
Constraint Satisfaction CSE 473 University of Washington.
1 Constraint Satisfaction Problems Soup Total Cost < $30 Chicken Dish Vegetable RiceSeafood Pork Dish Appetizer Must be Hot&Sour No Peanuts No Peanuts.
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 Problems Russell and Norvig: Chapter 3, Section 3.7 Chapter 4, Pages Slides adapted from: robotics.stanford.edu/~latombe/cs121/2003/home.htm.
Constraint Satisfaction Problem Solving Chapter 5.
Chapter 5 Outline Formal definition of CSP CSP Examples
Constraint Satisfaction Problems
1 Constraint Satisfaction Problems Slides by Prof WELLING.
CS 484 – Artificial Intelligence1 Announcements Homework 2 due today Lab 1 due Thursday, 9/20 Homework 3 has been posted Autumn – Current Event Tuesday.
Constraint Satisfaction Problems Chapter 6. Review Agent, Environment, State Agent as search problem Uninformed search strategies Informed (heuristic.
Constraint Satisfaction Read Chapter 5. Model Finite set of variables: X1,…Xn Variable Xi has values in domain Di. Constraints C1…Cm. A constraint specifies.
Chapter 5 Section 1 – 3 1.  Constraint Satisfaction Problems (CSP)  Backtracking search for CSPs  Local search for CSPs 2.
Constraint Satisfaction CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
Hande ÇAKIN IES 503 TERM PROJECT CONSTRAINT SATISFACTION PROBLEMS.
Artificial Intelligence CS482, CS682, MW 1 – 2:15, SEM 201, MS 227 Prerequisites: 302, 365 Instructor: Sushil Louis,
1 Constraint Satisfaction Problems Soup Total Cost < $30 Chicken Dish Vegetable RiceSeafood Pork Dish Appetizer Must be Hot&Sour No Peanuts No Peanuts.
Chapter 5: Constraint Satisfaction ICS 171 Fall 2006.
CSCI 5582 Fall 2006 CSCI 5582 Artificial Intelligence Fall 2006 Jim Martin.
1 Chapter 5 Constraint Satisfaction Problems. 2 Outlines  Constraint Satisfaction Problems  Backtracking Search for CSPs  Local Search for CSP  The.
Chapter 5 Constraint Satisfaction Problems
CSE 473: Artificial Intelligence Constraint Satisfaction Daniel Weld Slides adapted from Dan Klein, Stuart Russell, Andrew Moore & Luke Zettlemoyer.
Constraint Satisfaction Problems
Constraint Satisfaction Problems (Chapter 6)
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.
BIL 472 SADI EVREN SEKER Constraint Satisfaction.
Chapter 5 Team Teaching AI (created by Dewi Liliana) PTIIK Constraint Satisfaction Problems.
Constraint Satisfaction CSE 473 University of Washington.
1 Constraint Satisfaction Problems (CSP). Announcements Second Test Wednesday, April 27.
ARTIFICIAL INTELLIGENCE (CS 461D) Dr. Abeer Mahmoud Computer science Department Princess Nora University Faculty of Computer & Information Systems.
CS 561, Session 8 1 This time: constraint satisfaction - Constraint Satisfaction Problems (CSP) - Backtracking search for CSPs - Local search for CSPs.
Constraint Satisfaction Problems (Chapter 6)
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
ECE 448, Lecture 7: Constraint Satisfaction Problems
Constraint Satisfaction Problems (CSPs)
Constraint Satisfaction Problems Lecture # 14, 15 & 16
Constraint Satisfaction
Constraint Satisfaction
Instructor: Vincent Conitzer
Lecture 7 Constraint Satisfaction Problems
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
Constraint Satisfaction Problems
Constraint Satisfaction Problems
Artificial Intelligence
Constraint satisfaction problems
Constraint Satisfaction Problems. A Quick Overview
Constraint Satisfaction
CS 8520: Artificial Intelligence
Constraint Satisfaction Problems
Constraint satisfaction problems
Constraint Satisfaction Problems (CSP)
Presentation transcript:

Constraint Satisfaction and the Davis-Putnam-Logeman-Loveland Procedure Henry Kautz

Guessing versus Reasoning A central feature of all search algorithms is making guesses –Which node to expand? –Which child to explore? We can reduce the amount of guesswork by doing more reasoning about the consequences of past decisions –Reasoning about past choices can prune away many future choices

Discrete Constraint Satisfaction Problem X is a set of variables x1, x2, …, xn D is a set of finite domains D1, D2, …, Dn C is a set of constraints C1, C2, …, Cm Each constraint restricts the joint values of a subset of the variables Example: 3-Coloring Xi = countries Di = { Red, Blue, Green} For each adjacent xi, xj there is a constraint Ck (xi,xj)  { (R,G), (R,B), (G,R), (G,B), (B,R), (B,G) }

Kinds of Problems Find a solution that satisfies all constraints Find all solutions Find a “tightest form” for each constraint (x1,x2)  { (R,G), (R,B), (G,R), (G,B), (B,R), (B,G) }  (x1,x2)  { (R,G), (R,B) } Find a solution that minimizes some additional objective function

Chinese Dinner Constraint Network Soup Total Cost < $30 Chicken Dish Vegetable RiceSeafood Pork Dish Appetizer Must be Hot&Sour No Peanuts No Peanuts Not Eggplant Not Both Spicy What is the arity of each constraint?

Solving CSP by Depth-First Search Interleave inference and guessing At each internal node: –Select unassigned variable –Select a value in domain –Backtracking: try another value At each node: –Propagate Constraints Where are the guesses?

4 Queens Q4  {1,2,3,4} Q3  {1,2,3,4} Q2  {1,2,3,4} Q1  {1,2,3,4} Q Q Q Q Q1Q Q1Q Q1Q Q2Q Q Q2Q

Constraint Checking Q Q x Qx x Qx xx Qxx Q x x Qx Q x xQ Qxx Qx xx xQx Qxxx Takes 5 guesses to determine first guess was wrong

Forward Checking x x x Qxxx xx Qxx xxx Qxxx Qxx xx xx Qxxx Qxx xxx xQx Qxxx Takes 3 guesses to determine first guess was wrong When variable is set, immediately remove inconsistent values from domains of other variables

Arc Consistency Iterated forward checking Q Q1Q Q1Q Q1Q Q2Q Q Q2Q

Arc Consistency Reduce domain of Q1 x x x Qxxx Q1Q Q1Q Q1Q Q2Q Q Q2Q

Arc Consistency Reduce domain of Q2 x x x Qxxx Q1Q Q1Q Q1Q Q2Q Q Q2Q

Arc Consistency Reduce domain of Q3 x x x Qxxx Q1Q Q1Q Q1Q Q2Q Q Q2Q

Arc Consistency Reduce domain of Q4 x x x Qxxx Q1Q Q1Q Q1Q Q2Q Q Q2Q

Arc Consistency Note that Q3=2 is determined by (Q2,Q3) xx x x Qxxx Q1Q Q1Q Q1Q Q2Q Q Q2Q

Arc Consistency Propagating Q3=2 eliminates all rows in (Q3,Q4) xx x x Qxxx Q1Q Q1Q Q1Q Q2Q Q Q2Q violated constraint!

Arc Consistency First choice Q1=1 shown bad with no further guessing! xx x x Qxxx Q1Q Q1Q Q1Q Q2Q Q Q2Q violated constraint!

Huffman-Clowes Labeling

Waltz’s Filtering: Arc- Consistency Lines: variables Conjunctions: constraints Initially Di = {+,-, ,  ) Repeat until no changes: Choose edge (variable) Delete labels on edge not consistent with both endpoints

No labeling!

Path Consistency Path consistency (3-consistency): –Iterated check of every triple of variables K-consistency: N-consistency: backtrack-free search

Variable and Value Selection Select variable with smallest domain –Minimize branching factor –Most likely to propagate, reduce guessing –Most constrained variable heuristic Which values to try first? –Most likely value for solution –Forward checking reduces fewest constraints –Least constrained value heuristic

CSP Applications Scheduling –NASA: Shuttle repair, Hubble telescope scheduling,... –College basketball scheduling Configuration –#5ESS Switching System: >200 options, highly complex interactions –Reduced configuration time from 2 months  2 hours

(Barry and Humblet 93, Cheung et al. 90, Green 92, Kumar et al. 99) CONFLICT FREE LATIN ROUTER Input ports Output ports Input PortOutput Port Router Design Dynamic wavelength router design: –each channel cannot be repeated in the same input port (row constraints); –each channel cannot be repeated in the same output port (column constraints);

SAT as a CSP Domain of all variables is {0, 1} Clauses are constraints – specify illegal combinations of values (A v B v ~C) rules out (A=0,B=0,C=1) ABC

Basic Backtrack Search for SAT Solve( F ): return Search(F, { }); Search( F, assigned ): if vars(F)=vars(assigned) then if evaluate(F, assigned) then return assigned; else return FALSE; choose unassigned variable x; returnSearch(F, assigned U {x=0}) || Search(F, assigned U {x=1}); end;

Propagating Constraints Suppose formula contains (A v B v ~C) and we set A=0. What is the resulting constraint on the remaining variables B and C? (B v ~C) Suppose instead we set A=1. What is the resulting constraint on B and C? No constraint

Empty Clauses and Formulas Suppose a clause in F is shortened until it become empty. What does this mean about F and the partial assignment? F cannot be satisfied by any way of completing the assignment; must backtrack Suppose all the clauses in F disappear. What does this mean? F is satisfied by any completion of the partial assignment

Arc Consistency for SAT Suppose a clause in F is shortened to contain a single literal, such as (A) What should you do? Immediately add the literal to assigned, and repeat constraint propagation Arc consistency for SAT is called unit propagation

DPLL DPLL( F, assigned ): while F has a unit clause (c) do assigned = assigned U {c}; shorten clauses containing ~c; delete clauses containing c; end if F is empty then return assigned; if F contains an empty clause then return FALSE; choose an unassigned literal c; // variable and initial value returnSearch(F U { (c) }, assigned) || Search(F U { (~c) }, assigned); end;

I.e., ((not x_1) or x_7) ((not x_1) or x_6) etc. What is BIG? x_1, x_2, x_3, etc. our Boolean variables (set to True or False) Set x_1 to False ?? Consider a real world Boolean Satisfiability (SAT) problem

I.e., (x_177 or x_169 or x_161 or x_153 … x_33 or x_25 or x_17 or x_9 or x_1 or (not x_185)) clauses / constraints are getting more interesting… 10 pages later: … Note x_1 …

4000 pages later: …

Finally, 15,000 pages later: Current SAT solvers solve this instance in approx. 1 minute! Search space of truth assignments: HOW?

Progress in SAT Solvers Source: Marques Silva 2002

Questions How? –Clause learning Why? –Phase transition phenomena –Small backdoors

How: Clause Learning Idea: backtrack search can repeatedly reach an empty clause (backtrack point) for the same reason A BB CC  Example: Propagation from B=0 and C=0 leads to empty clause

How: Clause Learning If reason was remembered, then could avoid having to rediscover it A BB CD  Example: Propagation from B=0 and C=0 leads to empty clause I had better set C=1 immediately!

How: Clause Learning The reason can be remembered by adding a new learned clause to the formula A BB CD  learn (~B V ~C) Example: Propagation from B=0 and C=0 leads to empty clause Set C=1 by unit propagation

How: Clause Learning Savings can be huge A B B C  Example: Setting B=0 is the root cause of reaching an empty clause DE  C  DE 

How: Clause Learning Savings can be huge A B C C  Example: Setting B=0 is the root cause of reaching an empty clause DE  Have learned unit clause (B)

Determining Reasons The reason for a backtrack can be found by (incrementally) constructing a conflict graph of the implications between assumed or derived literals (unit clauses) Analyzing the graph yields learned clauses

43 Conflict Graphs Decision scheme (p  q   b) 1-UIP scheme t pp qq b a x1x1 x2x2 x3x3 y yy false tt Known Clauses (p  q  a) (  a   b   t) (t   x 1 ) (t   x 2 ) (t   x 3 ) (x 1  x 2  x 3  y) (x 2   y) Current decisions p  false q  false b  true

Scaling Up Clause Learning Clause learning greatly enhances the power of unit propagation Tradeoff: memory needed for the learned clauses, time needed to check if they cause propagations Clever data structures enable modern SAT solvers to manage millions of learned clauses efficiently