1 / 21

Lecture 7 Constraint Satisfaction Problems

Lecture 7 Constraint Satisfaction Problems. CSE 573 Artificial Intelligence I Henry Kautz Fall 2001. But first…. Why is driving to Spokane like playing Backgammon?. Roadmap. Backtracking Constraint Satisfaction Algorithms. Tree Search (guessing) BFS DFS Iterative Deepening

camila
Télécharger la présentation

Lecture 7 Constraint Satisfaction Problems

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Lecture 7Constraint Satisfaction Problems CSE 573 Artificial Intelligence I Henry Kautz Fall 2001

  2. But first… • Why is driving to Spokane like playing Backgammon?

  3. Roadmap Backtracking Constraint Satisfaction Algorithms • Tree Search (guessing) • BFS • DFS • Iterative Deepening • Bidirectional • Best-first search • A* • Game tree • Davis-Putnam (logic) • Cutset conditioning (probability) • Inference (simplifying) • Forward Checking • Path Consistency (Waltz labeling, temporal algebra) • Resolution • “Bucket Algorithm” • Iterative improvement (wandering) • Hillclimbing (gradient descent) • Walksat & Simulated annealing • Genetic algorithms • Monte-Carlo Methods

  4. Map Coloring

  5. CSP • V is a set of variables v1, v2, …, vn • D is a set of finite domains D1, D2, …, Dn • C is a set of constraints C1, C2, …, Cm Each constraint specifies a restriction over joint values of a subset of the varibles • E.g.: v1 is Spain, v2 is France, v3 is Germany, … Di = { Red, Blue, Green} for all i For each adjacent vi, vj there is a constraint Ck (vi,vj) in { (R,G), (R,B), (G,R), (G,B), (B,R), (B,G) } • Important special case: Discrete Binary CSP

  6. Variations • Find a solution that satisfies all constraints • Find all solutions • Find a “tightest form” for each constraint (v1,v2) in { (R,G), (R,B), (G,R), (G,B), (B,R), (B,G) }  (v1,v2) in { (R,G), (R,B), (B,G) } • Find a solution that minimizes some additional objective function • Note: in general path length to solution is not important!

  7. Exploiting CSP Structure • Interleaveinference and search • At each internal node: • Select unassigned variable • Select a value in domain • Backtracking: try another value • Branching factor? • How to best select a variable? • At each node: • Propagate Constraints

  8. Running Example: 4 Queens • Variables: • Constraints:

  9. Running Example: 4 Queens • Variables: Q1 in {1,2,3,4} Q2 in {1,2,3,4} Q3 in {1,2,3,4} Q3 in {1,2,3,4} • Constraints:

  10. Constraint Checking

  11. Forward Checking

  12. Arc Consistency Q3=3 inconsistent with Q4 in {2,3,4} Q2=1 and Q2=2 inconsistent with Q3 in {1} Only one guess!

  13. Huffman-ClowesLabeling + - + + + + +

  14. Waltz’s Filtering: Arc-Consistency • Lines: variables • Conjunctions: constraints • Initially Di = {+,-, ,  ) • Repeat until no changes: • Choose edge (variable) • Delete labels on edge not consistent with both endpoints

  15. No labeling!

  16. Path Consistency • Path consistency (3-consistency): • Check every triple of variables • More expensive! • k-consistency: • n-consistency: backtrack-free search

  17. Variable and Value Selection • Select variable with smallest domain • Which values to try first? • Why different? • Tie breaking?

  18. Variable and Value Selection • Select variable with smallest domain • Minimize branching factor • Most likely to propagate: most constrained variable heuristic • Which values to try first? • Most likely value for solution • Least propagation! Least constrained variable • Why different? • Every constraint must be eventually satisfied • Not every value must be assigned to a variable! • Tie breaking? • In general randomized tie breaking best – less likely to get stuck on same bad pattern of choices

  19. N-queens Demo • Board size 15 • Delay 6 • Deterministic vs. Randomized tie breaking

  20. Inference in CSP’s: So Far… • Constraint checking against partial assignments • Forward checking: each time a variable is instantiated, remove other inconsistent values • Keep track of current domains of vars • Arc consistency: • Iterate forward checking until no more changes • For each pair (Vi,Vj): for every value d in the current domain of Vi there is some value y in the domain of Vj such that Vi=x and Vj=y is permitted by the binary constraint between Vi and Vj • Variable / value selection

  21. Coming Up • Leveraging randomized tie-breaking • Satisfiability • Boolean (0/1) variables • Non-binary constraints • Iterative Repair and Problem Hardness

More Related