G51IAI Introduction to Artificial Intelligence

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
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.
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)
Lecture 5: Constraint Satisfaction
Constraint Satisfaction Problems. Constraint satisfaction problems (CSPs) Standard search problem: – State is a “black box” – any data structure that.
4 Feb 2004CS Constraint Satisfaction1 Constraint Satisfaction Problems Chapter 5 Section 1 – 3.
Constraint Satisfaction Problems
Artificial Intelligence Constraint satisfaction Chapter 5, AIMA.
1 Constraint Satisfaction Problems Soup Total Cost < $30 Chicken Dish Vegetable RiceSeafood Pork Dish Appetizer Must be Hot&Sour No Peanuts No Peanuts.
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 Satisfaction Problems
Distributed Scheduling. What is Distributed Scheduling? Scheduling: –A resource allocation problem –Often very complex set of constraints –Tied directly.
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.
Constraint Reasoning Florida Institute of Technology Computer Science.
1 Constraint Satisfaction Problems Slides by Prof WELLING.
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.
CSC 8520 Spring Paula Matuszek Based on Hwee Tou Ng, aima.eecs.berkeley.edu/slides-ppt, which are based on Russell, aima.eecs.berkeley.edu/slides-pdf.
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.
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
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.
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 Propagation Artificial Intelligence CMSC January 22, 2002.
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.
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) Introduction
Constraint Satisfaction Problems Lecture # 14, 15 & 16
Advanced Artificial Intelligence
Constraint Satisfaction Problems
CSP Search Techniques Backtracking Forward checking
Constraint Satisfaction Problems
Constraint Satisfaction Problems
Artificial Intelligence
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:

G51IAI Introduction to Artificial Intelligence Dr Rong Qu Constraint Satisfaction Problems

An Example Constraint satisfaction problems are everywhere in our everyday life Map coloring A region in a map has several sub-regions Given a set of colors Assign each sub-region a color so that no adjacent sub-regions have the same color everywhere in our life start from a very simple example. probably the mostly used example in introducing CSPs. problem is very simple, but will lead to some important concepts. G51IAI – Introduction to AI

An Example Map coloring Can we use 3 colors to color the map below (Australia)? rather simple problem - can easily find out a solution in seconds. a map of 100 regions - won’t be that easy to find a coloring satisfying the constraint. G51IAI – Introduction to AI

An Example Map coloring The above map can be modelled as a graph WA Q SA NSW V T NT Node: sub-region Edge: constraint (adjacency) Problem modelled as graph coloring: adjacent nodes have different colors to solve bigger and more complex map coloring problem - need to firstly model the problem. G51IAI – Introduction to AI Relationship between problem elements  constraints

CSP – Definition A constraint satisfaction problem (CSP) consists of a set of variables {x1, x2, … xi}; a finite set of domain D (possible values) associated with each variable; a set of constraints C restricting the values that the variables can simultaneously take CSP is to assign values to variables so that all constraints are satisfied standard definition of CSP - all the examples we introduce later can be defined using this standard form. G51IAI – Introduction to AI

CSP - Domain The domain of a variable is a set of possible values that can be assigned to the variable {1 … 500} – finite, integer {red, green, blue} – symbols {yes, no} – Boolean Temperatures – infinite; continuous G51IAI – Introduction to AI

CSP - Constraints Examples of constraints The demand will be more than five thousands units in August John prefer to work at only weekends Schedule these employees to cover all shifts Optimise the benefit of products G51IAI – Introduction to AI

CSP - Constraints Constraint is a set of relations upon domains of variables Restriction on the values the variables can simultaneously take What values are (dis-)allowed among the variables Functions Matrices Inequalities x1 ≠ x2 or x1 < x2 3x + 6y = 0, y + x < 7 G51IAI – Introduction to AI

CSP - Constraints Formal definition A constraint Ci,j,k… is a subset of possible relations between values of variables xi, xj, xk, ...; Ci,j,k…is a subset of Di × Dj × Dk × … G51IAI – Introduction to AI

CSP - Constraints Types of constraints Binary CSP Unary: affect only one variable x >= 1, WA = green Binary: affect two variables x >= y, WA ≠ NT High-order: affect more than two variables alldifferent(WA, NT, Q) x = y = z Binary CSP With only unary and binary constraints G51IAI – Introduction to AI

CSP - Constraints Simplification of constraints Replace a constraint by an equivalent constraint which has a simpler form Problem is easier to understand Information of original form is more apparent G51IAI – Introduction to AI

CSP - Solutions A solution to a CSP is an assignment of each variable with a value (within its domain), such that all constraints C are satisfied if a CSP has a feasible solution find one (any) solution all solutions G51IAI – Introduction to AI

CSP - Solutions Often we not only want a CSP solution but also the best one (optimal solution) Optimisation problems Objective function: to measure how good a solution is Constraint Optimisation Problems (COP) G51IAI – Introduction to AI

CSP – Other Definitions Label a variable-value pair representing assigning the value to the variable Compound label the finite set of labels representing simultaneous assignments G51IAI – Introduction to AI

CSP – Other Definitions Satisfiable a CSP (V,D,C) is satisfiable iff there is a compound label assigning values to all variables V that satisfy all constraints C A solution can then be defined as A compound label for all variables which satisfy all the constraints G51IAI – Introduction to AI

CSP – Example Variables Domains Constraints {WA, NT, Q, SA, NSW, V, T} {red, green, blue} Constraints {not_same(WA,NT), not_same(WA, SA), not_same(NT,SA), …} G51IAI – Introduction to AI

CSP – Example WA Q SA NSW V T NT The above formulate the map coloring problem into a constraint satisfaction problem Solution {WA=red, NT=green, SA=blue, Q=red, NSW=green, V=red, T=red} G51IAI – Introduction to AI

CSP – Example WA = red is a label The problem is satisfiable. G51IAI – Introduction to AI

CSP – Example The above solution using 3 colors Is actually an optimal solution (using the least colors) There are more than one solution For example, given 7 colors, we’ll have 7! solutions for the problem (at least) G51IAI – Introduction to AI

CSP – Example Graph coloring is NP-Hard (Karp, 1972) Optimal solutions of least colors cannot be obtained for 90-vertice graph (Johnson, 1991) Constraint based techniques are the mostly studied early approaches G51IAI – Introduction to AI

CSP So why is graph coloring important? CSP has many uses A typical constraint satisfaction problem Can be used to model many real problems CSP has many uses Scheduling Timetabling Other optimisation problems in industrial … G51IAI – Introduction to AI

CSP – Search Tree Depth first search ? G51IAI – Introduction to AI

CSP – Search Tree Backtracking ? G51IAI – Introduction to AI

CSP Techniques Constraint propagation Search strategies Consistency enforcing Arc consistency, path consistency Search strategies Back and forward checking Variable and Value ordering Branch & bound (B&B) Constraint optimisation techniques G51IAI – Introduction to AI

CSP – Example II Scene labeling problem The first CSP studied In vision, scene are captured as images, and processed as lines to represent images Lines need to be interpreted into types G51IAI – Introduction to AI

CSP – Example II Scene labeling problem Types of lines Convex edges + The edge is moving away from the viewer Concave edges – The edge moves towards the viewer Occluding edges  Face at right can be seen by the viewer + - Convex: moving away from the viewer Concave: moving towards the viewer area on the right: face of the object which can be seen as the viewer G51IAI – Introduction to AI

CSP – Example II Scene labeling problem defined as CSP Variables Domains G H I B C A D F E Convex: moving away from the viewer Concave: moving towards the viewer area on the right: face of the object which can be seen as the viewer + -   G51IAI – Introduction to AI

CSP – Example II Scene labeling problem defined as CSP Constraints G51IAI – Introduction to AI

CSP – Example III Sudoku Variables Domain Constraints 6 5 2 3 9 7 1 4 8 G51IAI – Introduction to AI

CSP – Example IV N-Queen problem Variables Domain Constraints G51IAI – Introduction to AI