1 Constraint Satisfaction Problems. 2 Intro Example: 8-Queens Generate-and-test: 8 8 combinations.

Slides:



Advertisements
Similar presentations
Constraint Satisfaction Problems
Advertisements

Constraint Satisfaction Problems Russell and Norvig: Chapter
Constraint Satisfaction Problems (Chapter 6). What is search for? Assumptions: single agent, deterministic, fully observable, discrete environment Search.
Constraint Satisfaction Problems
Constraint Satisfaction Introduction to Artificial Intelligence COS302 Michael L. Littman Fall 2001.
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
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.
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.
Artificial Intelligence Constraint satisfaction Chapter 5, AIMA.
Constraint Satisfaction Problems
CS460 Fall 2013 Lecture 4 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.
Constraint Propagation (Where a better exploitation of the constraints further reduces the need to make decisions) R&N: Chap. 5 + Chap. 24, p
CAP 492 Course Dr. Souham Meshoul 1 CONSTRAINT SATISFACTION PROBLEMS Chapter 5.
Constraint Satisfaction Problems Russell and Norvig: Chapter 5 CMSC 421 – Fall 2005.
Chapter 5 Outline Formal definition of CSP CSP Examples
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.
Artificial Intelligence CS482, CS682, MW 1 – 2:15, SEM 201, MS 227 Prerequisites: 302, 365 Instructor: Sushil Louis,
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.
PSU CS 370 – Introduction to Artificial Intelligence 1 Constraint Satisfaction Problems Chapter 5.
1 CS B551: Elements of Artificial Intelligence Instructor: Kris Hauser
CS B551: E LEMENTS OF A RTIFICIAL I NTELLIGENCE Instructor: Kris Hauser 1.
Hande ÇAKIN IES 503 TERM PROJECT CONSTRAINT SATISFACTION PROBLEMS.
Chapter 5: Constraint Satisfaction ICS 171 Fall 2006.
Chapter 5 Constraint Satisfaction Problems
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.
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 Russell and Norvig: Chapter 3, Section 3.7 Chapter 4, Pages CS121 – Winter 2003.
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.
Dr. Shazzad Hosain Department of EECS North South University Lecture 01 – Part C Constraint Satisfaction Problems.
PSU CS 370 – Introduction to Artificial Intelligence 1 Constraint Satisfaction Problems.
Constraint Propagation CS121 – Winter Constraint Propagation2 Constraint Propagation … … is the process of determining how the possible values of.
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.
ECE 448, Lecture 7: Constraint Satisfaction Problems
Constraint Satisfaction Problems Lecture # 14, 15 & 16
CS B551: Elements of Artificial Intelligence
Constraint Propagation
Constraint Satisfaction Problems
Artificial Intelligence
Constraint Satisfaction Problems
Constraint satisfaction problems
Constraint Satisfaction Problems. A Quick Overview
Constraint Satisfaction Problems
CS 8520: Artificial Intelligence
Constraint Satisfaction Problems
Constraint satisfaction problems
Constraint Satisfaction Problems (CSP)
Presentation transcript:

1 Constraint Satisfaction Problems

2 Intro Example: 8-Queens Generate-and-test: 8 8 combinations

3 Intro Example: 8-Queens

4 Constraint Satisfaction Problem Set of variables {X 1, X 2, …, X n } Each variable X i has a domain D i of possible values Usually D i is discrete and finite Set of constraints {C 1, C 2, …, C p } Each constraint C k involves a subset of variables and specifies the allowable combinations of values of these variables Assign a value to every variable such that all constraints are satisfied

5 Example: 8-Queens Problem 8 variables X i, i = 1 to 8 Domain for each variable {1,2,…,8} Constraints are of the forms: X i = k  X j  k for all j = 1 to 8, j  i X i = k i, X j = k j  |i-j|  | k i - k j |  for all j = 1 to 8, j  i

6 Example: Map Coloring 7 variables {WA,NT,SA,Q,NSW,V,T} Each variable has the same domain {red, green, blue} No two adjacent variables have the same value: WA  NT, WA  SA, NT  SA, NT  Q, SA  Q, SA  NSW, SA  V,Q  NSW, NSW  V WA NT SA Q NSW V T WA NT SA Q NSW V T

7 Constraint Graph Binary constraints T WA NT SA Q NSW V Two variables are adjacent or neighbors if they are connected by an edge or an arc

8 Map Coloring {} WA=redWA=greenWA=blue WA=red NT=green WA=red NT=blue WA=red NT=green Q=red WA=red NT=green Q=blue WA NT SA Q NSW V T

9 Backtracking Algorithm CSP-BACKTRACKING(PartialAssignment a) If a is complete then return a X  select an unassigned variable D  select an ordering for the domain of X For each value v in D do  If v is consistent with a then Add (X= v) to a result  CSP-BACKTRACKING(a) If result  failure then return result Return failure CSP-BACKTRACKING({})

10 Questions 1. Which variable X should be assigned a value next? 2. In which order should its domain D be sorted? 3. In which order should constraints be verified?

11 Choice of Variable Map coloring WA NT SA Q NSW V T WA NTSA

12 Choice of Variable 8-queen

13 Choice of Variable Most-constrained-variable heuristic: Select a variable with the fewest remaining values = Fail First Principle

14 Choice of Variable Most-constraining-variable heuristic: Select the variable that is involved in the largest number of constraints on other unassigned variables = Fail First Principle again WA NT SA Q NSW V T SA

15 {} Choice of Value WA NT SA Q NSW V T WA NT

16 Choice of Value Least-constraining-value heuristic: Prefer the value that leaves the largest subset of legal values for other unassigned variables {blue} WA NT SA Q NSW V T WA NT

17 Choice of Constraint to Test Most-constraining-Constraint: Prefer testing constraints that are more difficult to satisfy = Fail First Principle

18 Constraint Propagation … … is the process of determining how the possible values of one variable affect the possible values of other variables

19 Forward Checking After a variable X is assigned a value v, look at each unassigned variable Y that is connected to X by a constraint and deletes from Y’s domain any value that is inconsistent with v

20 Map Coloring WANTQNSWVSAT RGBRGBRGBRGBRGBRGBRGBRGBRGBRGBRGBRGBRGBRGB T WA NT SA Q NSW V

21 Map Coloring WANTQNSWVSAT RGBRGBRGBRGBRGBRGBRGBRGBRGBRGBRGBRGBRGBRGB RGBGBRGBRGBRGBRGBRGBRGBGBGBRGBRGB T WA NT SA Q NSW V

22 WANTQNSWVSAT RGBRGBRGBRGBRGBRGBRGBRGBRGBRGBRGBRGBRGBRGB RGBGBRGBRGBRGBRGBRGBRGBGBGBRGBRGB RBGRBRBRGBRGBBRGBRGB Map Coloring T WA NT SA Q NSW V

23 Map Coloring WANTQNSWVSAT RGBRGBRGBRGBRGBRGBRGBRGBRGBRGBRGBRGBRGBRGB RGBGBRGBRGBRGBRGBRGBRGBGBGBRGBRGB RBGRBRBRGBRGBBRGBRGB RBGRBRGBRGB Impossible assignments that forward checking do not detect T WA NT SA Q NSW V

24 Example: 4-Queens Problem X1 {1,2,3,4} X3 {1,2,3,4} X4 {1,2,3,4} X2 {1,2,3,4}

25 Example: 4-Queens Problem X1 {1,2,3,4} X3 {1,2,3,4} X4 {1,2,3,4} X2 {1,2,3,4}

26 Example: 4-Queens Problem X1 {1,2,3,4} X3 {,2,,4} X4 {,2,3, } X2 {,,3,4}

27 Example: 4-Queens Problem X1 {1,2,3,4} X3 {,2,,4} X4 {,2,3, } X2 {,,3,4}

28 Example: 4-Queens Problem X1 {1,2,3,4} X3 {,,, } X4 {,2,3, } X2 {,,3,4}

29 Example: 4-Queens Problem X1 {,2,3,4} X3 {1,2,3,4} X4 {1,2,3,4} X2 {1,2,3,4} BT

30 Example: 4-Queens Problem X1 {,2,3,4} X3 {1,,3, } X4 {1,,3,4} X2 {,,,4} BT

31 Example: 4-Queens Problem X1 {,2,3,4} X3 {1,,3, } X4 {1,,3,4} X2 {,,,4} BT

32 Example: 4-Queens Problem X1 {,2,3,4} X3 {1,,, } X4 {1,,3, } X2 {,,,4} BT

33 Example: 4-Queens Problem X1 {,2,3,4} X3 {1,,, } X4 {1,,3, } X2 {,,,4} BT

34 Example: 4-Queens Problem X1 {,2,3,4} X3 {1,,, } X4 {,,3, } X2 {,,,4} BT

35 Example: 4-Queens Problem X1 {,2,3,4} X3 {1,,, } X4 {,,3, } X2 {,,,4} BT

36 Edge Labeling in Computer Vision

37 Trihedral Objects Objects in which exactly three plane surfaces come together at each vertex. Goal: label a 2-D object to produce a 3-D object

38 Labels of Edges Convex edge: two surfaces intersecting at an angle greater than 180° Concave edge two surfaces intersecting at an angle less than 180° + convex edge, both surfaces visible − concave edge, both surfaces visible  convex edge, only one surface is visible and it is on the right side of 

39 Junction Label Sets (Waltz, 1975; Mackworth, 1977)

40 Edge Labeling

41 Edge Labeling

42 Edge Labeling as a CSP A variable is associated with each junction The domain of a variable is the label set of the corresponding junction Each constraint imposes that the values given to two adjacent junctions give the same label to the joining edge

43 Edge Labeling

44 Edge Labeling

45 Edge Labeling

46 Edge Labeling

47 Removal of Arc Inconsistencies REMOVE-ARC-INCONSISTENCIES(J,K) removed  false X  label set of J Y  label set of K For every label y in Y do If there exists no label x in X such that the constraint (x,y) is satisfied then  Remove y from Y  If Y is empty then contradiction  true  removed  true Label set of K  Y Return removed

48 CP Algorithm for Edge Labeling Associate with every junction its label set Q  stack of all junctions while Q is not empty do J  UNSTACK(Q) For every junction K adjacent to J do  If REMOVE-ARC-INCONSISTENCIES(J,K) then If K’s domain is non-empty then STACK(K,Q) Else return false (Waltz, 1975; Mackworth, 1977)