Constraint Satisfaction

Slides:



Advertisements
Similar presentations
Constraint Satisfaction Problems
Advertisements

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.
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)
Lecture 5: Constraint Satisfaction
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.
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
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.
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.
CSC 423 ARTIFICIAL INTELLIGENCE Constraint Satisfaction Problems.
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.
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.
Constraint Satisfaction CSE 473 University of Washington.
1 Constraint Satisfaction Problems (CSP). Announcements Second Test Wednesday, April 27.
CS 561, Session 8 1 This time: constraint satisfaction - Constraint Satisfaction Problems (CSP) - Backtracking search for CSPs - Local search for CSPs.
Automatic Test Generation
Constraint Satisfaction Problems (CSPs) Introduction
Constraint Programming
Constraint Satisfaction Problems (CSPs)
Constraint Satisfaction Problems Lecture # 14, 15 & 16
Constraint Satisfaction
Constraint Satisfaction Problems (CSPs) Introduction
Advanced Artificial Intelligence
Lecture 7 Constraint Satisfaction Problems
CS 188: Artificial Intelligence
Constraint Satisfaction Problems
Constraint Satisfaction Problems
Artificial Intelligence
Constraints and Search
Constraint satisfaction problems
Constraint Satisfaction Problems. A Quick Overview
Outline for 4/9 Recap Constraint Satisfaction Techniques
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 Oren Etzioni University of Washington

Question from last time. What’s the relationship between Uniform Cost search and Dijkstra’s algorithm? Answer: essentially the same. Paradox: Dijkstra’s algorithm is “fast” O(e*logn) and search is “slow” O(b^d), but they are the same…how can that be? © Daniel S. Weld

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

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 But other techniques add speed Propagation Variable ordering Preprocessing © Daniel S. Weld

Chinese Food as Search? States? Partially specified meals Operators? Start state? Goal states? Partially specified meals Add, remove, change dishes Null meal Meal meeting certain conditions (rating?) © Daniel S. Weld

Factoring States Rather than state = meal Model state’s (independent) parts, e.g. Suppose every meal for n people Has n dishes plus soup Soup = Meal 1 = Meal 2 = … Meal n = Or… physical state = X coordinate = Y coordinate = © Daniel S. Weld

Chinese Constraint Network Must be Hot&Sour Soup No Peanuts Chicken Dish Appetizer Total Cost < $30 No Peanuts Pork Dish Vegetable Unary, binary and N-ry constraints. Seafood Rice Not Both Spicy Not Chow Mein © Daniel S. Weld

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

Binary Constraint Network Any FD constraints can be reduced to ‘binary’ Set of n variables: x1 … xn Value domains for each variable: D1 … Dn Set of binary constraints (also “relations”) Rij  Di  Dj Specifies which values pair (xi xj) are consistent V for each country Each domain = 4 colors Rij enforces  © Daniel S. Weld

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 {(xi, ai) … (xj, aj)} = consistent w/ a set of vars {xm … xn} iff  am … an such that {(xi, ai)…(xj, aj), (xm, am)…(xn, an)} } = consistent © Daniel S. Weld

Difficulty of CSP How hard is it to solve a Boolean CSP? (so we why do we care about algorithms?) CSPs can have infinite domains (e.g., integers) Linear programming = integer domain + linear constraints. NP complete by reduction of 3SAT to CSP. Exponential in number of variables! © Daniel S. Weld

Cryptarithmetic State Space SEND + MORE ------ MONEY Variables? Set of states Operators [and costs] Start state Goal states SEND + MORE ------ MONEY Variables? Domains (variable values)? Constraints? (alldiff(..) can be represented as binary inequalities! STATE: partial assignment of letters to numbers GOAL state: TOTAL assignment that is a correct sum OPERATOR: assign a number to a letter Branching factor 8 (letters) * 10 values = 80. Depth = 8 Fixed order  branching factor = 10. DON’T CARE about PATH LENGTH. In fact, ALL solution paths exactly 8 LETTERS long! © Daniel S. Weld

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

N Queens As a CSP? © Daniel S. Weld

N Queens Variables = board columns Domain values = rows {(x1, 2), (x2, 4), (x3, 1)} consistent with (x4) Shorthand: “{2, 4, 1} consistent with x4” Q Q Q © Daniel S. Weld

CSP as a search problem? What are states? What are the operators? (N variables) What are the operators? (assign D possible values) What is the branching factor? O(N * D) CommutativeD Initial state? Goal test? Q Q Q © Daniel S. Weld

Chronological Backtracking (BT) (e.g., depth first search) 1 Q Q 2 6 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 Q 4 Q 3 Q Q 5 Q © Daniel S. Weld

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 Q Q Q Q BJ Discovers (2, 5, 3, 6) inconsistent with x6 No sense trying other values of x5 Q © Daniel S. Weld

Conflict-Directed Backjumping (CBJ) More sophisticated backjumping behavior Each variable has conflict set CS Set of vars that failed c-checks w/ current val Update this set on every failed c-check When no more values to try for xi Backtrack to deepest var, xd, in CS(xi) And update CS(xd):=CS(xd)CS(xi)-{xd} 1 3 2 CBJ Discovers (2, 5, 3) inconsistent with {x5, x6 } CS(x5) CS(x6) Q 2 Q 1 1 Q 1,2,3 1, 2 ,3 ,5 3 3 3 4 Q 5 5 Q 2 6 3 x1 x2 x3 x4 x5 x6 © Daniel S. Weld

BT vs. BJ vs. CBJ { © Daniel S. Weld

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 FC only visits consistent nodes but not all such nodes skips (2, 5, 3, 4) which CBJ visits But FC can’t detect that (2, 5, 3) inconsistent with {x5, x6 } Q Q Q Q Q © Daniel S. Weld