1 Today’s class Interleaving backtracking and consistency checking Variable-ordering heuristics Value-ordering heuristics Intelligent backtracking Marie.

Slides:



Advertisements
Similar presentations
Constraint Satisfaction Problems
Advertisements

Constraint Satisfaction Patrick Prosser. An Example, Exam Timetabling Someone timetables the exams We have a number of courses to examine how many? Dept.
Constraint Satisfaction Problems Russell and Norvig: Chapter
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)
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.
ICS-271:Notes 5: 1 Lecture 5: Constraint Satisfaction Problems ICS 271 Fall 2008.
Artificial Intelligence Constraint satisfaction problems Fall 2008 professor: Luigi Ceccaroni.
Review: Constraint Satisfaction Problems How is a CSP defined? How do we solve CSPs?
4 Feb 2004CS Constraint Satisfaction1 Constraint Satisfaction Problems Chapter 5 Section 1 – 3.
Artificial Intelligence Constraint satisfaction Chapter 5, AIMA.
Constraint Satisfaction
Constraint Satisfaction Problems
CS460 Fall 2013 Lecture 4 Constraint Satisfaction Problems.
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
Chapter 5 Outline Formal definition of CSP CSP Examples
1 Pertemuan 20 Understanding Continued Matakuliah: T0264/Intelijensia Semu Tahun: Juli 2006 Versi: 2/1.
Distributed Scheduling. What is Distributed Scheduling? Scheduling: –A resource allocation problem –Often very complex set of constraints –Tied directly.
Constraint Satisfaction Problems
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.
CSP Examples Tamara Berg CS 560 Artificial Intelligence Many slides throughout the course adapted from Svetlana Lazebnik, Dan Klein, Stuart Russell, Andrew.
CMSC 471 Spring 2014 Class #7 Postponed due to snow day Class #8 Tue 2/18/14 Thu 2/20/14 Constraint Satisfaction Professor Marie desJardins,
Constraint Satisfaction CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
1 CS B551: Elements of Artificial Intelligence Instructor: Kris Hauser
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,
CSCI 5582 Fall 2006 CSCI 5582 Artificial Intelligence Fall 2006 Jim Martin.
Edge and Boundary interpretation Consistent line drawing labeling via backtracking Presented by Guy Shtub.
CSC 423 ARTIFICIAL INTELLIGENCE Constraint Satisfaction Problems.
Constraint Satisfaction Russell & Norvig Ch. 5. Overview Constraint satisfaction offers a powerful problem- solving paradigm –View a problem as a set.
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.
CHAPTER 5 SECTION 1 – 3 4 Feb 2004 CS Constraint Satisfaction 1 Constraint Satisfaction Problems.
G51IAI Introduction to Artificial Intelligence
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.
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.
Constraint Satisfaction Problems/Programming ZUI 2012/2013.
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.
Alternative Search Formulations and Applications
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
Class #7 – Thursday, September 23
Empirical Comparison of Preprocessing and Lookahead Techniques for Binary Constraint Satisfaction Problems Zheying Jane Yang & Berthe Y. Choueiry Constraint.
Quiz Feb Inf. Search & CSP.
CS B551: Elements of Artificial Intelligence
Constraint Propagation
Biointelligence Lab School of Computer Sci. & Eng.
Chapter 3: Finite Constraint Domains
CSP Search Techniques Backtracking Forward checking
Incorporating Constraint Checking Costs in Constraint Satisfaction Problem Suryakant Sansare.
Biointelligence Lab School of Computer Sci. & Eng.
Constraint satisfaction problems
Artificial Intelligence
Constraint Satisfaction
Constraint Satisfaction Problems
CS 8520: Artificial Intelligence
Directional consistency Chapter 4
Constraint Graph Binary CSPs
Constraint satisfaction problems
Presentation transcript:

1 Today’s class Interleaving backtracking and consistency checking Variable-ordering heuristics Value-ordering heuristics Intelligent backtracking Marie desJardins

2 Advanced Constraint Techniques Kumar, “Algorithms for constraint satisfaction problems: A survey” Barták, “Constraint programming: In pursuit of the holy grail”

3 Review Represent a problem as a set of variables and constraints among those variables –For binary constraints, result is a constraint graph G = (V, C) with N variables and M constraints Use search and/or constraint propagation to solve the constraint network Improve efficiency of solving by –Interleaving search and constraint propagation –Variable ordering –Value ordering –Intelligent backtracking

4 A famous example: Labelling line drawings Waltz labelling algorithm – one of the earliest CSP applications –Convex interior lines are labelled as + –Concave interior lines are labeled as – –Boundary lines are labeled as There are 208 labellings (most of which are impossible) Here are the 18 legal labellings:

5 Labelling line drawings II Here are some illegal labelings:

6 Labelline line drawings (cont.) Waltz labelling algorithm: Propagate constraints repeatedly until a solution is found A solution for one labelling problem A labelling problem with no solution

7 Ordered constraint graphs Select a variable ordering, V 1, …, V n Width of a node in this OCG is the number of arcs leading to earlier variables: –w(V i ) = Count ( (V i, V k ) | k < i) Width of the OCG is the maximum width of any node: –w(G) = Max (w (V i )), 1 <= i <= N Width of an unordered CG is the minimum width of all orderings of that graph (“best you can do”)

8 Tree-structured constraint graph An OCG with width 1 is a constraint tree rooted at V 1 –That is, in the ordering V1, …, Vn, every node has zero or one parents If this constraint tree is also node- and arc-consistent (i.e., strongly 2-consistent), then it can be solved without backtracking More generally, if the ordered graph is strongly k- consistent, and has width w < k, then it can be solved without backtracking V1 V8V4 V7 V6 V10V9 V5V3V2

9 Backtrack-free CSPs: Proof sketch Given a strongly k-consistent OCG, G, with width w < k: –Instantiate variables in order, choosing values that are consistent with the constraints between Vi and its parents –Each variable has at most w parents, and k-consistency tells us we can find a legal value consistent with the values of those w parents Unfortunately, achieving k-consistency is hard –(and can increase the width of the graph in the process!) Fortunately, 2-consistency is relatively easy to achieve, so constraint trees are easy to solve Unfortunately, many CGs have width greater than one (that is, no equivalent tree), so we still need to improve search

10 So what if we don’t have a tree? Answer #1: Try interleaving constraint propagation and backtracking Answer #2: Try using variable-ordering heuristics to improve search Answer #3: Try using value-ordering heuristics during variable instantiation Answer #4: Try using intelligent backtracking methods

11 Interleaving constraint propagation and search Generate and Test No constraint propagation: assign all variable values, then test constraints Simple Backtracking Check constraints only for variables “up the tree” Forward Checking Check constraints for immediate neighbors “down the tree” Partial Lookahead Propagate constraints forward “down the tree” Full Lookahead Ensure complete arc consistency after each instantiation

12 Variable ordering Intuition: choose variables that are highly constrained early in the search process; leave easy ones for later Minimum width ordering (MWO): identify OCG with minimum width Minimum cardinality ordering: approximation of MWO that’s cheaper to compute: order variables by decreasing cardinality Fail first principle (FFP): choose variable with the fewest values –Static FFP: use domain size of variables –Dynamic FFP (search rearrangement method): At each point in the search, select the variable with the fewest remaining values

13 Variable ordering II Maximal stable set: find largest set of variables with no constraints between them and save these for last Cycle-cutset tree creation: –Find a set of variables that, once instantiated, leave a tree of uninstantiated variables; –solve these, –then solve the tree without backtracking

14 Value ordering Intuition: Choose values that are the least constrained early on, leaving the most legal values in later variables Maximal options method (least-constraining-value heuristic): Choose the value that leaves the most legal values in uninstantiated variables Min-conflicts: Used in iterative repair search

15 Iterative repair Start with an initial complete (but invalid) assignment Hill climbing, simulated annealing Min-conflicts: Select new values that minimally conflict with the other variables –Use in conjunction with hill climbing or simulated annealing or… Local maxima strategies –Random restart –Random walk –Tabu search: don’t try recently attempted values

16 Min-conflicts heuristic Iterative repair method 1.Find some “reasonably good” initial solution –E.g., in N-queens problem, use greedy search through rows, putting each queen where it conflicts with the smallest number of previously placed queens, breaking ties randomly 2.Find a variable in conflict (randomly) 3.Select a new value that minimizes the number of constraint violations –O(N) time and space 4.Repeat steps 2 and 3 until done Performance depends on quality and informativeness of initial assignment; inversely related to distance to solution

17 Intelligent backtracking Backjumping: if V j fails, jump back to the variable V i with greatest i such that the constraint (V i, V j ) fails (i.e., most recently instantiated variable in conflict with V i ) Backchecking: keep track of incompatible value assignments computed during backjumping Backmarking: keep track of which variables led to the incompatible variable assignments for improved backchecking

18 Some challenges for constraint reasoning What if not all constraints can be satisfied? –Hard vs. soft constraints –Degree of constraint satisfaction –Cost of violating constraints What if constraints are of different forms? –Symbolic constraints –Numerical constraints [constraint solving] –Temporal constraints –Mixed constraints

19 Some challenges for constraint reasoning II What if constraints are represented intentionally? –Cost of evaluating constraints (time, memory, resources) What if constraints, variables, and/or values change over time? –Dynamic constraint networks –Temporal constraint networks –Constraint repair What if you have multiple agents or systems involved in constraint satisfaction? –Distributed CSPs –Localization techniques