Constraint Satisfaction Basics strongly influenced by Rina Dechter, “Constraint Processing”, 2003.

Slides:



Advertisements
Similar presentations
Constraint Satisfaction Patrick Prosser. An Example, Exam Timetabling Someone timetables the exams We have a number of courses to examine how many? Dept.
Advertisements

Maximal Independent Sets of a Hypergraph IJCAI01.
CONSTRAINT Networks Chapters 1-2
Constraint Satisfaction Problems
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)
Logic Puzzle Smith. The Setup There are five houses Each of a different color Inhabited by men of different nationalities Each has a different pet Each.
Foundations of Constraint Processing, Fall 2005 October 21, 2005CSPs and Relational DBs1 Foundations of Constraint Processing CSCE421/821, Fall 2005:
CPSC 322, Lecture 11Slide 1 Constraint Satisfaction Problems (CSPs) Introduction Computer Science cpsc322, Lecture 11 (Textbook Chpt 4.0 – 4.2) January,
Constraint Satisfaction Problems
CONSTRAINT Networks Chapters 1-2 Compsci-275 Spring 2009 Spring
1 Advanced consistency methods Chapter 8 ICS-275 Spring 2007.
1 Binary C ONSTRAINT P ROCESSING Chapter 2 ICS-275A Fall 2007.
Constraint Satisfaction Problems
Constraint Networks ( slides courtesy of Natalia Flerova, based on slides courtesy of Rina Dechter)
Constraint Satisfaction Problems (CSP) (Where we postpone making difficult decisions until they become easy to make) R&N: Chap. 5 1.
1 Chapter 8 Advanced Consistency Methods Yaling Zheng CSCE : Advanced Constraint Processing.
1 Constraint Satisfaction and Backtrack Search 22c:31 Algorithms.
Artificial Intelligence CS482, CS682, MW 1 – 2:15, SEM 201, MS 227 Prerequisites: 302, 365 Instructor: Sushil Louis,
Slide 1 Constraint Satisfaction Problems (CSPs) Introduction Jim Little UBC CS 322 – CSP 1 September 27, 2014 Textbook §
Computer Science CPSC 502 Lecture 3 Constraint Satisfaction Problems (Ch. 4 )
Constraint Satisfaction Problems (CSPs) CPSC 322 – CSP 1 Poole & Mackworth textbook: Sections § Lecturer: Alan Mackworth September 28, 2012.
Constraint Networks Overview. Suggested reading Russell and Norvig. Artificial Intelligence: Modern Approach. Chapter 5.
Artificial Intelligence CS482, CS682, MW 1 – 2:15, SEM 201, MS 227 Prerequisites: 302, 365 Instructor: Sushil Louis,
Solving Constraint Satisfaction Problems (CSPs) using Search CPSC 322 – CSP 2 Textbook § January 31, 2011.
Chapter 5: Constraint Satisfaction ICS 171 Fall 2006.
CSCI 5582 Fall 2006 CSCI 5582 Artificial Intelligence Fall 2006 Jim Martin.
1 CS B551: Elements of Artificial Intelligence Instructor: Kris Hauser
Explorations in Artificial Intelligence Prof. Carla P. Gomes Module 6 Binary CSP.
Constraint Satisfaction Basics strongly influenced by Dr. Rina Dechter: “Constraint Processing”
Principles of Intelligent Systems Constraint Satisfaction + Local Search Written by Dr John Thornton School of IT, Griffith University Gold Coast.
C ONSTRAINT Networks Chapters 1-2 Compsci-275 Fall
Who owns the zebra?. Here’s a small logical puzzle for you. Copy down the information you see. Through elimination, can you discover who owns the zebra.
CP Summer School Modelling for Constraint Programming Barbara Smith 3. Symmetry, Viewpoints.
Constraint Satisfaction Problems University of Berkeley, USA
CS 175 Project in AI. 2 Lectures: ICS 180 Tuesday, Thursday Hours: am Discussion: DBH 1300 Wednesday Hours: pm Instructor: Natalia.
Constraint Satisfaction Problems
G51IAI Introduction to Artificial Intelligence
Constraint Propagation influenced by Dr. Rina Dechter, “Constraint Processing”
Introduction to State Space Search
1 Constraint Satisfaction Problems: Formulation, Arc Consistency & Propagation 1 Brian C. Williams October 13 th, 2004 Slides adapted from:
Constraint Satisfaction Problems Russell and Norvig: Chapter 3, Section 3.7 Chapter 4, Pages CS121 – Winter 2003.
Lecture 5: Constraint Satisfaction Problems
Domain Splitting, Local Search CPSC 322 – CSP 4 Textbook §4.6, §4.8 February 4, 2011.
Constraint Satisfaction Problems (CSP) (Where we delay difficult decisions until they become easier) R&N: Chap. 6 (These slides are primarily from a course.
Constraint Satisfaction Problems/Programming ZUI 2012/2013.
An Introduction to Constraint Programming in JChoco.
Problem Solving with Constraints CSPs and Relational DBs1 Problem Solving with Constraints CSCE496/896, Fall
1 Constraint Satisfaction Problems (CSP). Announcements Second Test Wednesday, April 27.
Introduction to graphical models. Outline Course goals and policies Overview of graphical models, examples Constraint networks Probabilistic networks.
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) Introduction
Constraint Satisfaction Problems (CSPs) Introduction
Constraint Satisfaction Problem
CS 188: Artificial Intelligence
CSPs and Relational DBs
Problem Solving with Constraints
Running example The 4-houses puzzle:
Constraint Satisfaction Problems
Constraint Satisfaction Problems
Advanced consistency methods Chapter 8
Constraint satisfaction problems
Problem Solving with Constraints
Problem Solving with Constraints
Constraint Satisfaction Problems
Constraint satisfaction problems
Constraint Satisfaction Problems (CSP)
Presentation transcript:

Constraint Satisfaction Basics strongly influenced by Rina Dechter, “Constraint Processing”, 2003

complete search space of a problem  variables V = {v 1, v 2, …., v n }  domains D = {D 1, D 2, …., D n }, v i  D i  search space T = D 1 X D 2 X…. X D n  size of search space |D 1 |. |D 2 |. ….. |D n | if there are no constraints, any solution in T is feasible

constraint satisfaction problems  variables V = {v 1, v 2, …., v n }  domains D = {D 1, D 2, …., D n }, v i  D i  constraints C = {C 1, C 2, …., C k } C i is a relation on scope S i  V C i puts constraints on some variables in the problem  search space T = D 1 X D 2 X…. X D n a solution in the search space T whose values violate a constraint is infeasible a constraint satisfaction problem is often called a constraint network

example: Sudoku puzzle  variables V = {v 11, v 12, v 13,..., v 99 }  domains D 1 = D 2 = D 3 =... = D 99 = {1,2,3,4,5,6,7,8,9}  constraints: “no repeated values in row, columns or squares; pre-assigned values” C = {C 1, C 2, …., C 810 } C i is a relation on scope S i = {v i1, v i2 } algebraic: { (v i1,v i2 ) | v i1 ≠ v i2 } C j on S j = {v j1 }: { v j1 | v j1 = k } for particular puzzle:

example: Sudoku puzzle ● variables V i D i = {1,2,3,4,5,6,7,8,9} ∀ i each square is subject to 20 binary constraints of form V i ≠ V j total = 81 * 20 / 2 = 810 a particular game also has ~ 25 constraints of form V i = k

describing constraints  scope S i :the set of variables on which a constraint C i is defined  scheme S = {S 1, S 2, …, S k } set of all scopes on which constraints are defined  arity of a constraint C i is size of its scope |S i | unary constraint on one variable binary constraint on two variables n-ary constraint on n variables* *n-ary constraints can be rewritten as (many) binaries

simple scheduling problem five tasks to schedule, T1, T2, T3, T4, T5  each lasts one hour  each may start at 1PM, 2PM, 3PM  tasks can be executed simultaneously except: T1 starts after T3 T3 starts before T4 and after T5 T2 cannot be concurrent with T1 or T4 T4 cannot start at 2PM

simple scheduling problem five tasks to schedule, T1, T2, T3, T4, T5  variables? domains?  constraints? scopes? arity?

constraint graphs  vertices: variables  edges: (binary) variable scopes TSPscheduling problem v1v1 v1v1 v2v2 v2v2 v4v4 v4v4 v3v3 v3v3 T1 T2 T3 T4 T5

crossword puzzle (after Dechter) HOSESLASERSHEETSNAIL STEERALSOEARNHIKE IRONSAMEEATLET RUNSUNTENYES MEITNOUS

crossword puzzle HOSESLASERSHEETSNAIL STEERALSOEARNHIKE IRONSAMEEATLET RUNSUNTENYES MEITNOUS variables: 13 (letters) domains: alphabet constraints: S 1 {1,2,3,4,5} C1 {(H,O,S,E,S), (L,A,S,E,R), (S,H,E,E,T), (S,N,A,I,L), (S,T,E,E,R)}

crossword puzzle HOSESLASERSHEETSNAIL STEERALSOEARNHIKE IRONSAMEEATLET RUNSUNTENYES MEITNOUS S 1 {1,2,3,4,5} arity 5 S 2 {3,6,9,12} S 3 {5,7,11} S 4 {8,9,10,11} S 5 {10,13} S 6 {12,13}

crossword puzzle HOSESLASERSHEETSNAIL STEERALSOEARNHIKE IRONSAMEEATLET RUNSUNTENYES MEITNOUS partial solution satisfying C 4 and C 5 over S 4  S 5 {8,9,10,11,13} {(S,A,M,E,E)}

graphs for arity > 2  hypergraph multiple nodes per “hyperedge”

graphs for arity > 2  hypergraph

graphs for arity > 2  dual of hypergraph nodes are constraints edges are common variables ,2,3,4,5 5,7,11 3,6,9,12 8,9,10,11 12,13 10,

crossword puzzle another formulation HOSESLASERSHEETSNAIL STEERALSOEARNHIKE IRONSAMEEATLET RUNSUNTENYES MEITNOUS variables: 6: domains: words by length constraints: crossings S 1 {1,3}S 2 {1,5}S 3 {10,12} S 4 {3,8}S 5 {3,12}S 6 {5,8} S 7 {10,8} all binary constraints

binary constraint networks only unary and binary constraints  constraint deduction inferring new constraints from initial set 1.constraints between unconstrained variables 2.tightening of existing constraints

constraint deduction example: V = { v 1,v 2,v 3 } D 1 = D 2 = D 3 = { red, green} C 1 : {(v 2,v 1 )|v 2 ≠v 1 } = {(red, green),(green, red)} C 2 : {(v 1,v 3 )|v 1 ≠v 3 } = {(red, green),(green, red)} solutions: {(red, green, green), (green, red, red)} red green red green red green v1v1 v2v2 v3v3

constraint deduction example: new constraint network with same solutions --> better for partial solutions (more later) red green red green red green v1v1 v2v2 v3v3 red green red green red green v1v1 v2v2 v3v3 inferred constraint: v 2 = v 3

constraint composition given two binary* constraints C 1, C 2 on scopes S 1 = {x,y} and S 2 = {y,z} then the composition C 3 =C 1. C 2 is defined on S 3 = {x,z} C 3 = {(a,b)| a  D x, b  D z,  c  D y such that (a,c)  C 1 and (c,b)  C 2 } e.g.,C 1 = {(red, green),(green, red)} C 2 = {(red, green),(green, red)} C 3 =C 1. C 2 = {(red, red), (green, green)} *also works for a unary and a binary

inferring with constraints Who owns the zebra? p.225 variables domains constraints constraint graph

Who owns the zebra?  variables

Who owns the zebra?  variables and domains 25 variables  5 cars  5 pets  5 house colours  5 drinks  5 nationalities the houses?? they are the elements of the domains

Who owns the zebra?  variables and domains 25 variables, D = {1, 2, 3, 4, 5} for each variable  5 cars  5 pets  5 house colours  5 drinks  5 nationalities

Who owns the zebra?  constraints explicit implicit assuming all binary, how many?

Who owns the zebra?  constraints explicit14 implicit50 assuming all unary or binary, how many?64

Who owns the zebra?  binary constraint graph a 5-permutation as 10 binary constraints milk o.j.water cocoaeggnog

Who owns the zebra?  binary constraint graph 5 permutations drinks colours cars pets nationalities

Who owns the zebra?  binary constraint graph 14 explicit constraints drinks colours cars pets nationalities

Who owns the zebra? drinks colours cars pets nationalities horse snail dog fox zebra