Constraint Satisfaction taking advantage of internal structure of states when paths don’t matter.

Slides:



Advertisements
Similar presentations
Constraint Satisfaction Problems
Advertisements

Constraint Programming Peter van Beek University of Waterloo.
Distributed AI an overview. D Goforth - COSC 4117, fall Why distributed AI? situated expert – the importance of general knowledge and incorporation.
Algorithms and Data Structures Lecture III
Constraint Satisfaction Problems Russell and Norvig: Chapter
A. BobbioReggio Emilia, June 17-18, Dependability & Maintainability Theory and Methods 3. Reliability Block Diagrams Andrea Bobbio Dipartimento di.
Constraint Satisfaction Problems (Chapter 6). What is search for? Assumptions: single agent, deterministic, fully observable, discrete environment Search.
Constraint Satisfaction Problems
Distributed Constraint Satisfaction Problems M OHSEN A FSHARCHI.
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.
This lecture topic (two lectures) Chapter 6.1 – 6.4, except 6.3.3
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)
Review: Constraint Satisfaction Problems How is a CSP defined? How do we solve CSPs?
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
CS121 Heuristic Search Planning CSPs Adversarial Search Probabilistic Reasoning Probabilistic Belief Learning.
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.
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.
Searching by Constraint CMSC Artificial Intelligence January 24, 2008.
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
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.
Dr. Shazzad Hosain Department of EECS North South University Lecture 01 – Part C Constraint Satisfaction Problems.
Constraint Satisfaction Problems/Programming ZUI 2012/2013.
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
Advanced Artificial Intelligence
Constraint Satisfaction Problems
Artificial Intelligence
Constraints and Search
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 taking advantage of internal structure of states when paths don’t matter

D Goforth - COSC 4117, fall Constraint satisfaction problems (CSPs)  no prescribed start state  path does not matter  acceptable states must satisfy constraints functions of state variables  among acceptable states, goal states will optimize an objective function

D Goforth - COSC 4117, fall Example problem – timetable of university (1)  state - collection of schedule objects schedule  professor(~10 2 ) (~350 at LU)  course (~10 3 )  time slot (~10) (16 at LU)  location (~10 2 )  constraints  objective function

D Goforth - COSC 4117, fall Example problem – timetable of university (2)  constraints professors assigned to courses one course per location per time slot location capacity >= course (projected) enrollment professors assigned only once per time slot rooms assigned only once per time slot courses in program in different time slots

D Goforth - COSC 4117, fall Example problem – timetable of university (3)  objective function minimize total course enrollment in early morning time slots distribute program courses across days concentrate professor assignments on same day accommodate special requests

D Goforth - COSC 4117, fall Solving CSPs  analysis of problem state structure is critical  two basic approaches: start state is null: assign state variables one at a time and backtrack if constraint is violated assign variables ‘randomly/intelligently’ to make a start state and use greedy search by changing variable assignments

D Goforth - COSC 4117, fall Example problem – timetable of university (4)  analyzing the problem e.g. fix time slots for all weekly sessions of a course (tutorials?)  problem solving approaches allocate courses to rooms and times one after the other assign all courses then start moving those involved in constraint violations

D Goforth - COSC 4117, fall CSP – problem definition  state representation (R&N) state variables X 1, X 2, …, X n  X i from domain D i constraints C 1, C 2, …, C m  Cj are functions of Xi (unary, binary, … fns) solution – assignment of values v i to all X i so all constraint functions C j are satisfied objective function – optimized function of X i over solution set

D Goforth - COSC 4117, fall Example problem – timetable of university (4)  variables: array of assignments of courses (c k ) to locations (loc i )and time (t j ) slots c k :prof,enroll,prog loc i : capacity t j : time, day A[loc,t] = c k  constraints: loc.capacity >= c.enroll (unary) if (loc i1 != loc i2 ) A[loc i1,t j ].prof != A[loc i2,t j ].prof

D Goforth - COSC 4117, fall Modelling a state as constraint graph  variables are nodes loc 1: 25loc 2: 100 t 1 t 2 t 3 c 1:Ann20 c 2:Ben45 c 3:Cec 15 c 4:Ben80 c 5:Ann90

D Goforth - COSC 4117, fall Modelling a state as constraint graph  unary constraints reduce domains loc 1: 25loc 2: 100 t 1 t 2 t 3 c 1:Ann20 c 2:Ben45 c 3:Cec 15 c 4:Ben80 c 5:Ann90 for A(loc 1, t) {c 1,c 3 } for A(loc 2, t) {c 1,c 2,c 3,c 4,c 5 }

D Goforth - COSC 4117, fall Modelling a state as constraint graph  binary constraints are edges loc 1: 25loc 2: 100 t 1 t 2 t 3 c 1:Ann20 c 2:Ben45 c 3:Cec 15 c 4:Ben80 c 5:Ann90 for A(loc 1, t) {c 1,c 3 } for A(loc 2, t) {c 1,c 2,c 3,c 4,c 5 } A[loc 1,t j ].prof != A[loc 2,t j ].prof

D Goforth - COSC 4117, fall Modelling a state as constraint graph  multiple constraints are ‘hubs’ loc 1: 25loc 2: 100 t 1 t 2 t 3 c 1:Ann20 c 2:Ben45 c 3:Cec 15 c 4:Ben80 c 5:Ann90 for A(loc 1, t) {c 1,c 3 } for A(loc 2, t) {c 1,c 2,c 3,c 4,c 5 } each course in one slot only

D Goforth - COSC 4117, fall Variable domains  discrete finite  discrete infinite  continuous Domains may be distinct or shared among variables (typical)

D Goforth - COSC 4117, fall Constraints  enumerations of possible combinations  functions of variables linear, non-linear, … unary, binary,…

D Goforth - COSC 4117, fall Solution by incremental formulation  initial state – no variable assigned  successor function for transition: pick a variable and set a value that does not conflict with previous assignments by applying constraint functions  goal – all variables assigned

D Goforth - COSC 4117, fall Solution by incremental formulation  advantage depth of search is limited to number of variables in state  depth limited dfs is natural algorithm ‘backtracking search’

Backtracking search loc 1: 25 loc 2: 100 c 1:Ann20 c 2:Ben45 c 3:Cec 15 c 4:Ben80 c 5:Ann90 c 5c 1c 5 c 1 c 5

D Goforth - COSC 4117, fall Efficient Backtracking search (1)  Forward checking - Propagate constraints when variable is assigned, use constraints to reduce value sets of remaining variables e.g. when course is assigned:  remove course from domain of all remaining variables  remove courses with same prof from allocations in same time slot

D Goforth - COSC 4117, fall Efficient Backtracking search (2)  Variable ordering – which variable to assign a value next? MRV heuristic – pick most constrained variable (minimum remaining values)  e.g. – book small room first degree heuristic – pick variable involved in most constraints (propagates and prunes most)

D Goforth - COSC 4117, fall Efficient Backtracking search (3)  Value ordering: once variable is selected, which value to try first? least constraining value heuristic – pick value that reduces value sets of remaining variables the least e.g. when assigning a course:  pick location with smallest capacity that will accommodate the course (risk?)

D Goforth - COSC 4117, fall Efficient Backtracking search (4)  Arc consistency: stronger constraint propagation check for consistency between variables after value is set forward checking remove variables arc consistency ?

D Goforth - COSC 4117, fall Efficient Backtracking search (5)  k-consistency: extending arc- consistency forward checking remove variables arc consistency

D Goforth - COSC 4117, fall Norvig and Russell example chapter04b.ps

D Goforth - COSC 4117, fall DFS ‘chronological’ backtracking  when search fails X6 (no value can be set for variable)  back up one level, try again v 5 v 5  useless IF no constraint between X 5, X 6 X1 X2 X3 X4 X5 X6

D Goforth - COSC 4117, fall DFS backjumping  when search fails X6 (no value can be set for variable)  look at conflict set of X6 {X3, X1}  jump back to change v3 v3 X1 X2 X3 X4 X5 X6

D Goforth - COSC 4117, fall Solution by local search  start state has values for every variable state variables X 1 =v 1, X 2 =v 2, …, X n =v n constraints C 1, C 2, …, C m  some satisfied, some violated objective function not optimized  successor function changes one or more variables – evaluate to minimize conflicts

D Goforth - COSC 4117, fall Solution by local search  timetable example:  start state – assign all courses to room/time slot  change assignments to reduce conflicts

D Goforth - COSC 4117, fall advantages of local search  solves some problems very fast  flexible in online situations – revised conditions can be re-solved with minimal changes e.g. course enrollment projections turn out to be wrong – conflicts with room sizes  takes advantage of any known partial solutions installed in start state

D Goforth - COSC 4117, fall Constraint graph structure  independent variables (unary constraints only) easy but rare  tree graphs – process variables in top-down order from any node as root  general graphs – may be reducible (by removing and assigning some nodes) to trees  general graphs – may be reducible by clustering into subgraphs

D Goforth - COSC 4117, fall Examples  crossword puzzle construction p.158 #5.4  cryptarithmetic puzzle – section 5.2 other example  Sudoku puzzle

Sudoku constraints From rules Constraints on all cells: For rows, columns, squares Every integer occurs No integer is repeated From data (particular game) Constraints on some cells Specific value Underconstrained – many solutions Overconstrained – no solutions y y x|A B C D E F G H I c B3