Constraint Satisfaction CSE 473 University of Washington.

Slides:



Advertisements
Similar presentations
Constraint Satisfaction Problems
Advertisements

Constraint Satisfaction Problems
Lecture 11 Last Time: Local Search, Constraint Satisfaction Problems Today: More on CSPs.
1 Constraint Satisfaction Problems A Quick Overview (based on AIMA book slides)
This lecture topic (two lectures) Chapter 6.1 – 6.4, except 6.3.3
1 Finite Constraint Domains. 2 u Constraint satisfaction problems (CSP) u A backtracking solver u Node and arc consistency u Bounds consistency u Generalized.
ICS-271:Notes 5: 1 Lecture 5: Constraint Satisfaction Problems ICS 271 Fall 2008.
Artificial Intelligence Constraint satisfaction problems Fall 2008 professor: Luigi Ceccaroni.
Constraint Satisfaction problems (CSP)
Review: Constraint Satisfaction Problems How is a CSP defined? How do we solve CSPs?
Constraint Satisfaction Problems. Constraint satisfaction problems (CSPs) Standard search problem: – State is a “black box” – any data structure that.
Constraint Satisfaction Problems
4 Feb 2004CS Constraint Satisfaction1 Constraint Satisfaction Problems Chapter 5 Section 1 – 3.
Constraint Satisfaction CSE 473 University of Washington.
Constraint Satisfaction and the Davis-Putnam-Logeman-Loveland Procedure Henry Kautz.
Artificial Intelligence Constraint satisfaction Chapter 5, AIMA.
1 Constraint Satisfaction Problems Soup Total Cost < $30 Chicken Dish Vegetable RiceSeafood Pork Dish Appetizer Must be Hot&Sour No Peanuts No Peanuts.
Constraint Satisfaction Problems
Constraint Satisfaction
Constraint Satisfaction Problem Solving Chapter 5.
Outline Introduction & Logistics Textbook: Russell and Norvig chapters 3, 4 and 5. Notion of a Problem Space Search Techniques Constraint Satisfaction.
Chapter 5 Outline Formal definition of CSP CSP Examples
Constraint Satisfaction Problems
Constraint Satisfaction Problems
1 Constraint Satisfaction Problems Slides by Prof WELLING.
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.
Searching by Constraint CMSC Artificial Intelligence January 24, 2008.
Hande ÇAKIN IES 503 TERM PROJECT CONSTRAINT SATISFACTION PROBLEMS.
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
Review Test1. Robotics & Future Technology Future of Intelligent Systems / Ray Kurzweil futurist Ray Kurzweil / A Long Bet A Long Bet / Robot Soccer.
CSE 473: Artificial Intelligence Constraint Satisfaction Daniel Weld Slides adapted from Dan Klein, Stuart Russell, Andrew Moore & Luke Zettlemoyer.
Constraint Satisfaction Problems
Outline for 3/28 Introduction & Logistics Textbook: chapters 3, 4 and 5. Notion of a Problem Space Search Techniques Constraint Satisfaction Techniques.
Constraint Satisfaction Problems (Chapter 6)
An Introduction to Artificial Intelligence Lecture 5: Constraint Satisfaction Problems Ramin Halavati In which we see how treating.
© Daniel S. Weld 1 Logistics PS3 Project Additional problem Reading Planning & CSP for “today” SAT plan paper review for Wed.
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
© Daniel S. Weld 1 Midterm Search Space Bayes Net Learning / Cross Validation Lessons for the Final I’ll hit these areas again I’ll include one midterm.
1. 2 Outline of Ch 4 Best-first search Greedy best-first search A * search Heuristics Functions Local search algorithms Hill-climbing search Simulated.
Heuristics & Constraint Satisfaction CSE 573 University of Washington.
Computing & Information Sciences Kansas State University Friday, 08 Sep 2006CIS 490 / 730: Artificial Intelligence Lecture 7 of 42 Friday, 08 September.
Chapter 5 Team Teaching AI (created by Dewi Liliana) PTIIK Constraint Satisfaction Problems.
EXAMPLE: MAP COLORING. Example: Map coloring Variables — WA, NT, Q, NSW, V, SA, T Domains — D i ={red,green,blue} Constraints — adjacent regions must.
1 Constraint Satisfaction Problems (CSP). Announcements Second Test Wednesday, April 27.
Cse 150, Fall 2012Gary Cottrell: Many slides borrowed from David Kriegman! Constraint Satisfaction Problems Introduction to Artificial Intelligence CSE.
CS 561, Session 8 1 This time: constraint satisfaction - Constraint Satisfaction Problems (CSP) - Backtracking search for CSPs - Local search for CSPs.
Constraint Satisfaction Problems (CSPs)
Constraint Satisfaction
Constraint Satisfaction
Constraint Satisfaction Problems
Constraint Satisfaction Problems
Constraints and Search
Constraint satisfaction problems
Constraint Satisfaction Problems. A Quick Overview
Constraint Satisfaction Problems
Constraint Satisfaction
CS 8520: Artificial Intelligence
Constraint Satisfaction Problems
Constraint satisfaction problems
Constraint Satisfaction Problems (CSP)
Presentation transcript:

Constraint Satisfaction CSE 473 University of Washington

© Daniel S. Weld 2 Today: Constraint Satisfaction Problems Definition Factoring state spaces Variable-ordering heuristics Backtracking policies Preprocessing algorithms

© Daniel S. Weld 3 Constraint Satisfaction Kind of search in which States are factored into sets of variables Search = assigning values to these variables Structure of space is encoded with constraints Backtracking-style algorithms work E.g. DFS for SAT (i.e. DPLL) But other techniques add speed Propagation Variable ordering Preprocessing

© Daniel S. Weld 4 Chinese Food as Search States? Operators? Start state? Goal states? Suppose every meal for n people has n dishes plus soup

© Daniel S. Weld 5 Chinese Food as Search States? Operators? Start state? Goal states? Partially specified meals Add, remove, change dishes Null meal Meal meeting certain conditions Two non-peanut dishes, with at least one of the others non-spicy. Suppose every meal for n people has n dishes plus soup

© Daniel S. Weld 6 Break the state into its independent components: State = (dish1, … dishN, soup) Becomes variables: Soup = Dish 1 = Dish 2 = … Dish n = Factoring States

© Daniel S. Weld 7 Encode the structure of the problem as constraints Often this structure is the description of the goal state: Goal condition = “Two peanut-free dishes; of the others, at least one must be non-spicy” How to express this as constraints? Factoring States

© Daniel S. Weld 8 Chinese Constraint Network Soup Total Cost < $30 Chicken Dish Vegetable RiceSeafood Pork Dish Appetizer Must be Hot&Sour No Peanuts No Peanuts Not Chow Mein Not Both Spicy

© Daniel S. Weld 9 Binary Constraint Network Set of n variables: x 1 … x n Value domains for each variable: D 1 … D n Set of binary constraints (also “relations”) Each binary constraint specifies which pairs (x i, x j ) are consistent R ij  D i  D j

© Daniel S. Weld 10 Binary Constraint Network Partial assignment of values = tuple of pairs {...(x, a)…} means variable x gets value a... Tuple=consistent if all constraints satisfied Tuple=full solution if consistent + has all vars Tuple {(x i, a i ) … (x j, a j )} = consistent w/ a set of vars {x m … x n } iff  a m … a n such that {(x i, a i )…(x j, a j ), (x m, a m )…(x n, a n )} } = consistent

© Daniel S. Weld 11 CSPs in the Real World Scheduling space shuttle repair Airport gate assignments Transportation Planning Supply-chain management Computer configuration Diagnosis UI optimization Etc...

© Daniel S. Weld 12 CSP Example: Cryptarithmetic State Space Set of states Operators [and costs] Start state Goal states Variables? Domains (variable values)? Constraints?

© Daniel S. Weld 13 CSP Example: Cryptarithmetic State Space Set of states Operators [and costs] Start state Goal states Variables? Domains (variable values)? Constraints?

© Daniel S. Weld 14 CSP Example: Classroom Scheduling Variables? Domains (possible values for variables)? Constraints?

© Daniel S. Weld 15 N Queens As a CSP?

© Daniel S. Weld 16 N Queens Variables = board columns Domain values = rows R ij = {(a i, a j ) : (a i  a j )  (|i-j|  |a i -a j |) e.g. R 12 = {(1,3), (1,4), (2,4), (3,1), (4,1), (4,2)} Q Q Q {(x 1, 2), (x 2, 4), (x 3, 1)} consistent with (x 4 ) Shorthand: “{2, 4, 1} consistent with x 4 ”

© Daniel S. Weld 17 CSP as a search problem? What are states? What are the operators? Initial state? Goal test? Q Q Q

© Daniel S. Weld 18 CSP as a search problem? What are states? (partial assignments) What are the operators? (add/change a single-variable assignment) Initial state? (empty assignment) Goal test? (full & consistent assignment) Q Q Q

© Daniel S. Weld 19 N-Queens CSP Search Q Q Q Q Q Q Q Q Q Q Q

© Daniel S. Weld 20 Which queen to place next? Variable Ordering Q Q

© Daniel S. Weld 21 Which queen to place next? Most constrained Least constraining Highest degree (as tiebreaker) Variable Ordering Q Q

© Daniel S. Weld 22 Chronological Backtracking (BT) (e.g., depth first search) Q Q Q Q Q Q Q Q Q Q Q Consistency check performed in the order in which vars were instantiated If c-check fails, try next value of current var If no more values, backtrack to most recent var

© Daniel S. Weld 23 Backjumping (BJ) Similar to BT, but more efficient when no consistent instantiation can be found for the current var Instead of backtracking to most recent var… BJ reverts to deepest var which was c-checked against the current var BJ Discovers placement of queens (2, 3, 5, 6) is inconsistent with x 6 No sense trying other values of x 5 Backtrack to x 4 and try a new placement Q Q Q Q Q

© Daniel S. Weld 24 Forward Checking (FC) Perform Consistency Check Forward Whenever a var is assigned a value Prune inconsistent values from As-yet unvisited variables Backtrack if domain of any var ever collapses Q Q Q Q Q QQ Q Q Q Q Forward checking vs backjumping? Backtrack from here without trying any values for Q6

© Daniel S. Weld 25 Arc Consistency Stronger version of forward checking For every pair of variables (x, y), check that: For every value remaining in x’s domain, there is some value for y that is consistent. (Where ‘consistent’ means consistent with all current settings and the value of ‘x’ currently in question.) QQ Q Q Q Q Backtrack from here because there is a value in Q5’s domain that is inconsistent with all values in Q6’s domain. Q When a value is deleted from x’s domain, we must re-check consistency of all of x’s neighbors. Why?

© Daniel S. Weld 26 K-Consistency Arc consistency generalized to k-ary relations For every k-tuple of variables (x 1, …, x k ), check that: For every consisent set of values remaining in the domains of x 1 through x k-1, there is some value for x k that is consistent. Tradeoffs