Constraint Satisfaction Introduction to Artificial Intelligence COS302 Michael L. Littman Fall 2001.

Slides:



Advertisements
Similar presentations
Constraint Satisfaction Problems
Advertisements

Constraint Satisfaction Problems Russell and Norvig: Chapter
Constraint Satisfaction Problems
1 Today’s class Interleaving backtracking and consistency checking Variable-ordering heuristics Value-ordering heuristics Intelligent backtracking Marie.
This lecture topic (two lectures) Chapter 6.1 – 6.4, except
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)
1 CMSC 471 Fall 2002 Class #6 – Wednesday, September 18.
1 Constraint Satisfaction Problems. 2 Intro Example: 8-Queens Generate-and-test: 8 8 combinations.
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 Processing and Programming Introductory Exemple Javier Larrosa.
4 Feb 2004CS Constraint Satisfaction1 Constraint Satisfaction Problems Chapter 5 Section 1 – 3.
Constraint Logic Programming Ryan Kinworthy. Overview Introduction Logic Programming LP as a constraint programming language Constraint Logic Programming.
CPSC 322, Lecture 12Slide 1 CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12 (Textbook Chpt ) January, 29, 2010.
Constraint Satisfaction Problems
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
Heuristic Search Introduction to Artificial Intelligence COS302 Michael L. Littman Fall 2001.
Constraint Satisfaction Problems
Constraint Satisfaction Problems
ISC 4322/6300 – GAM 4322 Artificial Intelligence Lecture 4 Constraint Satisfaction Problems Instructor: Alireza Tavakkoli September 17, 2009 University.
Slide 1 Constraint Satisfaction and Scheduling Andrew W. Moore Professor School of Computer Science Carnegie Mellon University
Satisfiability Introduction to Artificial Intelligence COS302 Michael L. Littman Fall 2001.
INTRODUCTION TO ARTIFICIAL INTELLIGENCE COS302 MICHAEL L. LITTMAN FALL 2001 Satisfiability.
CPS 270: Artificial Intelligence More search: When the path to the solution doesn’t matter Instructor: Vincent.
© J. Christopher Beck Lecture 13: Modeling in Constraint Programming.
Constraint Satisfaction Problems Chapter 6. Review Agent, Environment, State Agent as search problem Uninformed search strategies Informed (heuristic.
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.
1 CS B551: Elements of Artificial Intelligence Instructor: Kris Hauser
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,
Chapter 5: Constraint Satisfaction ICS 171 Fall 2006.
CSCI 5582 Fall 2006 CSCI 5582 Artificial Intelligence Fall 2006 Jim Martin.
Edge and Boundary interpretation Consistent line drawing labeling via backtracking Presented by Guy Shtub.
CSC 423 ARTIFICIAL INTELLIGENCE Constraint Satisfaction Problems.
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.
An Introduction to Artificial Intelligence Lecture 5: Constraint Satisfaction Problems Ramin Halavati In which we see how treating.
CHAPTER 5 SECTION 1 – 3 4 Feb 2004 CS Constraint Satisfaction 1 Constraint Satisfaction Problems.
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.
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.
Constraint Satisfaction Problems Rich and Knight: 3.5 Russell and Norvig: Chapter 3, Section 3.7 Chapter 4, Pages Slides adapted from: robotics.stanford.edu/~latombe/cs121/2003/home.htm.
Constraint Satisfaction CSE 473 University of Washington.
1 CSC 384 Lecture Slides (c) , C. Boutilier and P. Poupart CSC384: Lecture 16  Last time Searching a Graphplan for a plan, and relaxed plan heuristics.
1 Constraint Satisfaction Problems (CSP). Announcements Second Test Wednesday, April 27.
CMPT 463. What will be covered A* search Local search Game tree Constraint satisfaction problems (CSP)
Alternative Search Formulations and Applications
Instructor: Vincent Conitzer
CS 188: Artificial Intelligence
CS B551: Elements of Artificial Intelligence
Constraint Propagation
Heuristic Search Thank you Michael L. Littman, Princeton University for sharing these slides.
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 Introduction to Artificial Intelligence COS302 Michael L. Littman Fall 2001

Administration HW 1 due, HW 2 assigned (3 question parts!)

Example CSP 3-coloring: color each node R,B,G. Connected pairs must differ. V3 V4 V2 V6 V5 V1

Formal Definition Constraint satisfaction problem (CSP): {V, D, C}. V is set of variables V1…Vn. Each variable assigned a value from the domain D. C is set of constraints: each a list of vars, legal assignment set.

CSP for Graph Problem V = {V1, V2, V3, V4, V5, V6} D = {R, G, B} C = {(V1, V5) : { (B,R), (B,G), (R,B), (R,G), (G,B), (G,R) }, (V2, V5) :{ (B,R), (B,G), (R,B), (R,G), (G,B), (G,R) }, (V2, V5) :{ (B,R), (B,G), (R,B), (R,G), (G,B), (G,R) }, … } … }

Solve via Search In a state, variables V1 through Vk are assigned and V{k+1} through Vn are unassigned. Start state: All unassigned. G(s): All assigned, constraints satisfied. N(s): One more assigned

Search Example s 0 = ?????? N(s 0 ) = {R?????, G?????, B?????} What search algorithms could we use? BFS? DFS?

DFS Looks Dumb V3 V4 V2 V6 V5 V1

Making DFS Smarter Like A*, we can use a little bit of generic knowledge to guide the search process. Idea? h(s) = infinity if constraints violated by partial assignment Don’t make an assignment if it violates constraints Don’t peek.

Consistency Checking Still flails a bit… V3 V4 V2 V6 V5 V1 V4 V3 V2

Forward Checking Track set of (remaining) legal values for each variable. Fail if any variable’s set goes empty. How express this as a heuristic function h(s)?

Let’s Try It Yay! V3 V4 V2 V6 V5 V1

Computational Overhead How would you implement forward checking? Could the “empty domain” calculation be performed incrementally?

Constraint Propagation As values are eliminated from a variable’s domain, this can start a cascade effect on other variables. Expensive operation, so often performed only before search begins. Can be quite powerful…

Constraint Propagation Solved without search V3 V4 V2 V6 V5 V1

Example CSPs Graph coloring Real applications include hundreds of thousands of nodesReal applications include hundreds of thousands of nodes VLSI board layout 8 queens, cryptarithmetic Visual scene interpretation: Waltz Minesweeper…

Minesweeper Example Number is count of bombs in 8 adjacent cells

Minesweeper CSP V = { V1, …, V8 }, D = {B, S} C = { (V1, V2) : { (B,S), (S,B) }, (V1, V2, V3): {(S,S,B), (S,B,S), (B,S,S)}, …} (V1, V2, V3): {(S,S,B), (S,B,S), (B,S,S)}, …} V1 V2 V3 V4 V8V7V6V5

Using CSP to Decide V1 V2 S V4 V8V7SV5 How can we check if a value is forced?

Waltz Algorithm Each “Y” intersection can be either concave or convex. Global interpretation is key.

Scheduling Big, important use of CSPs. Makes multi-million dollar decisions in many industries.Makes multi-million dollar decisions in many industries. Used in space mission planning.Used in space mission planning. Military uses.Military uses. Large state spaces

Generic CSP Algorithm If all values assigned and no constraints violated, doneIf all values assigned and no constraints violated, done Apply consistency checkingApply consistency checking If deadend, backtrackIf deadend, backtrack Select variable to be assignedSelect variable to be assigned Select value for the variableSelect value for the variable Assign variable and recurseAssign variable and recurse

Search Heuristics Have some freedom in what variable to assign next Most constrained variableMost constrained variable Most constraining variableMost constraining variable Freedom in value to assign to that variable Least constraining valueLeast constraining value

Implementing CP Fundamental question: Given a constraint involving variables V1…Vk and possible values P1…Pk, remove impossible valuesGiven a constraint involving variables V1…Vk and possible values P1…Pk, remove impossible values For i = 1 to k for each val in Pi if not possible(V1…V{i-1} { val } V{i+1}…Vk, legalset) Vi -= { val }, restart Return P1…Pk

What’s “possible”? Possible(V1…Vk, legalset) For l1…lk in legalset fail = 0 For i = 1 to k if li not in Vi, fail = 1 if fail == 0, return TRUE Return FALSE

Formalizing Other CSPs Cryptograms Paint by Numbers Crossword Puzzles Four on the Floor Battleships

What to Learn Definition of a CSP: relationship to search. How to formalize problems as CSPs Use of improvements like consistency checking and forward checking

Homework 2 1.Consider the heuristic for Rush Hour of counting the cars blocking the ice cream truck and adding one. (a) Show this is a relaxation by giving conditions for an illegal move and showing what was eliminated. (b) For the board on the next page, show an optimal sequence of boards en route to the goal. Label each board with the f value from the heuristic. 2.Describe an improved heuristic for Rush Hour. (a) Explain why it is admissible. (b) Is it a relaxation? (c) Label the boards from 1b with the f values from your heuristic.

Rush Hour Example

Homework 2 (cont.) 3.Consider the 3-coloring problem on a graph with n nodes with the additional constraint that there not be exactly 2 nodes colored blue. (a) The most direct constraint for this involves all n nodes. How large is the corresponding legal assignment set for this constraint? (b) Explain how to specify this constraint more compactly by breaking it down into a set of simpler constraints. How many constraints do you add and how large is the legal assignment set for each one?