Running example The 4-houses puzzle:

Slides:



Advertisements
Similar presentations
Foundations of Constraint Processing Lookahead Schemas 1 Foundations of Constraint Processing CSCE421/821, Spring
Advertisements

Constraint Satisfaction Problems
Maintaining Arc Consistency We have a constraint graph G of variables X 1,...X n, and constraint relations {X i  X j}, and each Xi has a value set V (X.
1 Constraint Satisfaction Problems A Quick Overview (based on AIMA book slides)
1 CMSC 471 Fall 2002 Class #6 – Wednesday, September 18.
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)
A B Q Chord AB is 18. The radius of Circle Q is 15. How far is chord AB from the center of the circle? 9 15 (family!) 12 x.
Optimal Rectangle Packing: A Meta-CSP Approach Chris Reeson Advanced Constraint Processing Fall 2009 By Michael D. Moffitt and Martha E. Pollack, AAAI.
OBJECTIVE: 1) BE ABLE TO IDENTIFY THE MEDIAN AND ALTITUDE OF A TRIANGLE 2) BE ABLE TO APPLY THE MID-SEGMENT THEOREM 3) BE ABLE TO USE TRIANGLE MEASUREMENTS.
Artificial Intelligence Constraint satisfaction Chapter 5, AIMA.
CS460 Fall 2013 Lecture 4 Constraint Satisfaction Problems.
CPSC-608 Database Systems Fall 2011 Instructor: Jianer Chen Office: HRBB 315C Phone: Notes #8.
Chapter 9: Graphs Basic Concepts
Identifying Solutions
Relaxation and Hybrid constraint processing Different relaxation techniques Some popular hybrid techniques.
Artificial Intelligence CS482, CS682, MW 1 – 2:15, SEM 201, MS 227 Prerequisites: 302, 365 Instructor: Sushil Louis,
Chapter 7 Section 1.  Students will write ratios and solve proportions.
Computer Science CPSC 322 Lecture 13 Arc Consistency (4.5, 4.6 ) Slide 1.
6.3Find Probabilities Using Combinations
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,
Digraphs and Relations Warm Up. The Divisibility Relation Let “|” be the binary relation on N×N such that a|b (“a divides b”) iff there is an n ∈ N such.
Problem Solving with Constraints Lookahead Schemas 1 Foundations of Constraint Processing CSCE496/896, Fall
Computing the chromatic number for block intersection graphs of Latin squares Ed Sykes CS 721 project McMaster University, December 2004 Slide 1.
Counting CSC-2259 Discrete Structures Konstantin Busch - LSU1.
Phrase-structure grammar A phrase-structure grammar is a quadruple G = (V, T, P, S) where V is a finite set of symbols called nonterminals, T is a set.
Daphne Koller Message Passing Belief Propagation Algorithm Probabilistic Graphical Models Inference.
© 2002 Thomson / South-Western Slide 5-1 Chapter 5 Discrete Probability Distributions.
Principles of Intelligent Systems Constraint Satisfaction + Local Search Written by Dr John Thornton School of IT, Griffith University Gold Coast.
Artificial Intelligence Tutorials
An Introduction to Artificial Intelligence Lecture 5: Constraint Satisfaction Problems Ramin Halavati In which we see how treating.
EMIS Lecture 16 - Chapter 8 Designing Mesh Networks.
Arc Consistency CPSC 322 – CSP 3 Textbook § 4.5 February 2, 2011.
Introduction to State Space Search
Counting Techniques Tree Diagram Multiplication Rule Permutations Combinations.
Determine the sequence of genes along a chromosome based on the following recombination frequencies A-C 20% A-D 10% B-C 15% B-D 5%
Arc Consistency and Domain Splitting in CSPs CPSC 322 – CSP 3 Textbook Poole and Mackworth: § 4.5 and 4.6 Lecturer: Alan Mackworth October 3, 2012.
Properties Objective: To use the properties of numbers. Do Now 1.) = 3.) ( 2  1 )  4 = 2.) =4.) 2  ( 1  4 ) =
Graphs Definition: a graph is an abstract representation of a set of objects where some pairs of the objects are connected by links. The interconnected.
Constraint Satisfaction Problems/Programming ZUI 2012/2013.
Graphs and Matrices Spring 2012 Mills College Dan Ryan Lecture Slides by Dan Ryan is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike.
南亚和印度.
Chapter8 Relations 8.1: Relations and their properties.
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
Basic Concepts Graphs For more notes and topics visit:
Constraint Satisfaction Problems Lecture # 14, 15 & 16
Aim: Full House Grid: 9 Grid Play: Calculate answer & cross it off
Combinations COURSE 3 LESSON 11-3
Quiz Feb Inf. Search & CSP.
Factoring by Grouping.
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
Make an Organized List and Simulate a Problem
تصنيف التفاعلات الكيميائية
Line, line segment and rays.
Chapter 9: Graphs Basic Concepts
CSP Search Techniques Backtracking Forward checking
A Series of Slides in 5 Parts Movement 2. BFS
Vectors (2).
If AD = 10, DC =6, and ED = 15, find DB.
Constraint Satisfaction Problems
Chapter 9: Graphs Basic Concepts
A Series of Slides in 5 Parts Movement 4. Best-First
A Series of Slides in 5 Parts Movement 4. Best-First
A Series of Slides in 5 Parts Movement 1. DFS
A Series of Slides in 5 Parts Movement 3. IDFS
Constraint Graph Binary CSPs
Presentation transcript:

Running example The 4-houses puzzle: 4 families A, B, C and D live next to each other in houses numbered 1, 2, 3 and 4. D lives in a house with lower number than B, B lives next to A in a house with higher number, There is at least one house between B and C, D does not live in the house with number 2, C does not live in the house with number 4. Which family lives in which house ?

Representation: The variables: A, B, C and D The domains: dA = dB = dC = dD = { 1, 2, 3, 4} Constraints: unary: c(C) = C  4 c(D) = D  2 binary: c(A,B) = B = A + 1 c(A,C) = A  C c(B,D) = D  B c(A,D) = A  D c(B,C) = |B - C|  1 c(C,D) = C  D

Node-consistency: Or: 1-consistency (only 1 variable is involved) Unary constraints are eliminated through domain- reductions: c(C) = C  4 dC = { 1, 2, 3} c(D) = D  2 dD = { 1, 3, 4}

The constraint network: B D C B = A + 1 A  C D  B A  D |B - C|  1 C  D { 1, 2, 3, 4} { 1, 2, 3} { 1, 3, 4}

The example – AC3 (1): First pass (== Look ahead check): B D C B = A + 1 A  C D  B A  D |B - C|  1 C  D { 1, 2, 3, 4} { 1, 2, 3} { 1, 3, 4} A B D C B = A + 1 A  C D  B A  D |B - C|  1 C  D { 3, 4} { 1, 2} { 1, 3} { 1, 2, 3} Deletion_occurred := true

The example AC3 (2): Second pass: Deletion_occurred := true A B D C B = A + 1 A  C D  B A  D |B - C|  1 C  D { 3, 4} { 1, 2} { 1, 3} { 1, 2, 3} A B D C B = A + 1 A  C D  B A  D |B - C|  1 C  D { 3, 4} { 1, 2} { 1, 3} { 2, 3} Deletion_occurred := true

The example AC3 (3): Third pass: B D C B = A + 1 A  C D  B A  D |B - C|  1 C  D { 3, 4} { 1, 2} { 1, 3} { 2, 3} Deletion_occurred := false Result: A (2 or 3) , B (3 or 4), C (1 or 2), D (1 or 3) Consistent, but NOT REALLY A SOLUTION !!

K-consistency: 1-consistency (node-consistency): unary constraints (on 1 variable) are consistent 2-consistency (arc-consistency): binary constraints (on 2 variables) are consistent 3-consistency: all constraints involving 3 variables are consistent Eample: A B D C B = A + 1 A  C D  B A  D |B - C|  1 C  D { 1, 2, 3, 4} { 1, 2, 3} { 1, 3, 4} A value remains in the domain if there are consistent values in the domains of the 2 other variables (for all connecting constraints)

Path consistency Starting with an arc-consistent graph: B D C B = A + 1 A  C D  B A  D |B - C|  1 C  D { 3, 4} { 1, 2} { 1, 3} { 2, 3} Consistent, but NOT REALLY A SOLUTION !! Path-consistency considers all possible paths (triples of variables) AB -> D, AB->C, AC -> D, AC->B, BD->C, BD->A, CD->A, CD->B, etc etc

Path consistency <A,B>::[<2,3>, <3,4>] vs D, vs C B = A + 1 A  C D  B A  D |B - C|  1 C  D { 3, 4} { 1, 2} { 1, 3} { 2, 3} <A,B>::[<2,3>, <3,4>] vs D, vs C <A,C>::[<2,1>, <3,1>, <3,2>] vs B, vs D <B,C>::[<3,1>, <4,1>, <4,2>] vs A, vs D <B,D>::[<3,1>, <4,1>, <4,3> ] vs A, vs C …

Search: Forward checking at work (starting with 1-consistent network) 3 2 A B C D {1} {1,2,3,4} {1,2,3} {1,3,4} B=A+1 AD AC A B C D {2} {1,2,3,4} {1,2,3} {1,3,4} B=A+1 AD AC A B C D {3} {1,2,3,4} {1,2,3} {1,3,4} B=A+1 AD AC B 3 B 4 B 2 A B C D {2} {3} {1,3} {1,3,4} |B-C|1 D B A B C D {3} {4} {1,2} {1,4} |B-C|1 D B A B C D {1} {2} {2,3} {3,4} |B-C|1 D B C 1 1 C 2 A B C D {3} {4} {1} CD A B C D {3} {4} {2} {1} CD A B C D {2} {3} {1} CD fail fail fail success

Lookahead checking at work B C D {1,2,3,4} {1,2,3} {1,3,4} B=A+1 AD AC D B |B-C|1 CD A B C D {3} {3,4} {1,2} {1,3} B=A+1 AD AC D B |B-C|1 CD 1 A 3 2 A B C D {1} {3,4} {1,2} {1,3} B=A+1 B 4 A B C D {3} {4} {2} {1} D B |B-C|1 CD fail C 2 A B C D {2} {3,4} {1,2} {1,3} B=A+1 AD AC D B |B-C|1 CD A B C D {3} {4} {2} {1} CD fail success