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.

Slides:



Advertisements
Similar presentations
Constraint Satisfaction Problems
Advertisements

Constraint Satisfaction Problems Russell and Norvig: Chapter
Constraint Satisfaction Problems
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 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
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?
Lecture 5: Constraint Satisfaction
Constraint Satisfaction Problems
4 Feb 2004CS Constraint Satisfaction1 Constraint Satisfaction Problems Chapter 5 Section 1 – 3.
Artificial Intelligence Constraint satisfaction Chapter 5, AIMA.
Constraint Satisfaction Problems
Constraint Satisfaction
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.
CAP 492 Course Dr. Souham Meshoul 1 CONSTRAINT SATISFACTION PROBLEMS Chapter 5.
Constraint Satisfaction Problem Solving Chapter 5.
Chapter 5 Outline Formal definition of CSP CSP Examples
Constraint Satisfaction Problems
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.
1 Constraint Satisfaction Problems Slides by Prof WELLING.
Constraint Satisfaction Problems (CSPs) Chapter 6.1 – 6.4, except
Artificial Intelligence CS482, CS682, MW 1 – 2:15, SEM 201, MS 227 Prerequisites: 302, 365 Instructor: Sushil Louis,
CSPs Tamara Berg CS 560 Artificial Intelligence Many slides throughout the course adapted from Svetlana Lazebnik, Dan Klein, Stuart Russell, Andrew Moore,
CSPs Tamara Berg CS Artificial Intelligence Many slides throughout the course adapted from Svetlana Lazebnik, Dan Klein, Stuart Russell, Andrew.
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.
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.
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.
CSC 8520 Spring Paula Matuszek CS 8520: Artificial Intelligence Search 3: Constraint Satisfaction Problems Paula Matuszek Spring, 2013.
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.
Constraint Satisfaction Problems (Chapter 6)
An Introduction to Artificial Intelligence Lecture 5: Constraint Satisfaction Problems Ramin Halavati In which we see how treating.
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
Constraint Satisfaction Problems Chapter 6. Outline CSP? Backtracking for CSP Local search for CSPs Problem structure and decomposition.
1. 2 Outline of Ch 4 Best-first search Greedy best-first search A * search Heuristics Functions Local search algorithms Hill-climbing search Simulated.
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 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.
1 Constraint Satisfaction Problems Chapter 5 Section 1 – 3.
Dr. Shazzad Hosain Department of EECS North South University Lecture 01 – Part C Constraint Satisfaction Problems.
1 Constraint Satisfaction Problems (CSP). Announcements Second Test Wednesday, April 27.
Constraint Satisfaction Problems
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 (CSPs)
Constraint Satisfaction Problems Lecture # 14, 15 & 16
Constraint Satisfaction
Constraint Satisfaction Problems
Artificial Intelligence
Constraint satisfaction problems
Constraint Satisfaction Problems. A Quick Overview
CS 8520: Artificial Intelligence
Constraint Satisfaction Problems
Constraint satisfaction problems
Constraint Satisfaction Problems (CSP)
Presentation transcript:

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 legal combinations of the values. Assignment: selection of values for all variables. Consistent: assignment satisfies all constraints.

Constraints can be made binary Constraints = table of legal values One trinary table between(a,b,c). Replaced by two binary tables less(a,b) ^ less(b,c)

Example: Map-coloring Domain: colors = {red, blue, green} Variables: X1, X2, X3; domain colors Xi is color of country Ci. Constraints: C1 touches C2 … X1 != X2 C1 touches C3 … X1 != X3 C2 touches C3 … X2 != X3

BackTracking Solution X1 = red, X2= red, X3 = red, X1!=X2 #Fail X1= red, X2=red, X3=blue, X1!=X2 #Fail X1= red, X2=red, X3=green….Fail X1= red, X2=blue,…. Continue to Solution.. UGH. But it is the way Prolog works.

BackTracking Algorithm: Recursive formulation recurse( assignment, csp) –if complete, return assignment –else SELECT unassigned variable –for each value in domain of variable (order) if consistent: –add variable/value call recurse –if recurse succeeds, return assignment else remove (var/value) –return failure

Controlling Backtracking Choosing a variable to bind Choosing a binding for variable Prolog: user code does it. Variable ordering: –MRV heuristic: minimum remaining values –most constraining variable –choose variable with fewest values –Complete. Only effects efficiency.

Control Backtracking Degree Heuristic –choose variable involved in largest number of constraints. (tie-breaker) Choosing a value –least-constraining value –maximize number of future options Complete. Various heuristic change efficiency

Forward Checking Constraint Propagation If variable X is bound, find all variables Y that are connected to it by a constraint. Eliminate values that are inconsistent. Can yield dramatic improvement. Provably better than backtracking

Relook at Map-coloring Using Forward Checking X1= red: remove red from X2 and X3 domains X2 = blue: remove blue from X3’s domain X3 = green. Done!

Arc-Consistency (3) Binary CSP (can always force this) Arc = edge between variables that are in same constraint. Let X-Y be arc. – for each x in Domain X if there is no value y in domain Y that allows constraint to be met, then delete x from domain X. Can be done as preprocessing or during search.

Cost of Arc-Consistency Checking Let d = max number of values for any variable Let n = number of variables There are at most n^2 constraints. For any specific pair, at most d^2 table lookups. Pair revisited at most d times. So.. O(n^2 d^3) cost.

AC-3 algorithm: Mackworth Binary CSP. Direct the arcs Queue = all arcs (constraints) while (queue is not empty) –remove first pair arc X-Y –check arc consistency of X-Y –if any values deleted, then add arcs Z-X to queue where Z is neighbor of X.

AC3 Example TWO+TWO = FOUR edge between T and F gives: (T+T+Carry )/10 = F we see that only T in {5,6,7,8,9} can work for F = 1. Edge between F and R says R \= 1. Edge between (O+O)%10 = R and O\=R gives: O \= 0.

Intelligent Backtracking as opposed to chronological backtracking Identify conflict set – variables that could change the value of constraint. Backtrack to most recent variable in conflict set. Theorem: forward checking prunes all that backjumping does (and maybe more).

Min-conflicts No guarantees but… Hubble Scheduling 3 weeks -> 10 minutes! Current = random complete assignment of values (may repeat) For max number of steps do –if current = solution, return it –randomly choose a variable V that has conflicts –choose a value that minimizes number of conflicts –break ties randomly!

Problem Structure General CSP as hard as BSAT Complete searches are exponential. Research paradigm: identify tractable subproblems. Tree-structure problems: any two variables connected by single path. Tree-structure problem: search is LINEAR in number variables.

Tree Algorithm 1.Choose any variable as root. Order variables from root to leaves so parent precedes son. Say X1,X2, … XN. 2.For j=N to 2 apply arc consistency. 3.For j = 1 to N assign any consistent value. Major cost: arc consistency. Generalization Possible (tree decomposition)

Tree example Adjacent countries: –X1 to X2, X2 to X3, X2 to X4. Legal Colors {red,green}. Arc-consistency step: nothing removed. Value assignment step: –X1 = red, X2 = green, X3 = red, X4=red.