Constraint Satisfaction

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
This lecture topic (two lectures) Chapter 6.1 – 6.4, except
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 Constraint Satisfaction Problems. 2 Intro Example: 8-Queens Generate-and-test: 8 8 combinations.
This lecture topic (two lectures) Chapter 6.1 – 6.4, except 6.3.3
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
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.
Chapter 5 Outline Formal definition of CSP CSP Examples
Constraint Satisfaction Not all problems are solved by a sequential series of steps. How do we solve other types of problems?
Constraint Satisfaction Problems
Constraint Satisfaction Problems
Constraint Satisfaction Problems
1 Constraint Satisfaction Problems Slides by Prof WELLING.
Constraint Satisfaction Problems (CSPs) Chapter 6.1 – 6.4, except
CS 484 – Artificial Intelligence1 Announcements Homework 2 due today Lab 1 due Thursday, 9/20 Homework 3 has been posted Autumn – Current Event Tuesday.
Constraint Satisfaction Problems Chapter 6. Review Agent, Environment, State Agent as search problem Uninformed search strategies Informed (heuristic.
Constraint Satisfaction Read Chapter 5. Model Finite set of variables: X1,…Xn Variable Xi has values in domain Di. Constraints C1…Cm. A constraint specifies.
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.
Hande ÇAKIN IES 503 TERM PROJECT CONSTRAINT SATISFACTION PROBLEMS.
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.
1. 2 Outline of Ch 4 Best-first search Greedy best-first search A * search Heuristics Functions Local search algorithms Hill-climbing search Simulated.
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 CSE 473 University of Washington.
1 Constraint Satisfaction Problems (CSP). Announcements Second Test Wednesday, April 27.
CMPT 463. What will be covered A* search Local search Game tree Constraint satisfaction problems (CSP)
Alternative Search Formulations and Applications
ARTIFICIAL INTELLIGENCE (CS 461D) Dr. Abeer Mahmoud Computer science Department Princess Nora University Faculty of Computer & Information Systems.
Constraint Satisfaction Problems (Chapter 6)
ECE 448, Lecture 7: Constraint Satisfaction Problems
Constraint Satisfaction Problems (CSPs)
Constraint Satisfaction
Constraint Satisfaction
Instructor: Vincent Conitzer
Lecture 7 Constraint Satisfaction Problems
Computer Science cpsc322, Lecture 14
Constraint Satisfaction Problems
Constraint Satisfaction Problems
Artificial Intelligence
Constraint Satisfaction Problems
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 R & N Chapter 5

Constraint Satisfaction – Early Use From http://www-2.cs.cmu.edu/~awm/731/constraint07-2x2.pdf From http://www-2.cs.cmu.edu/~awm/731/constraint07-2x2.pdf

The Waltz Algorithm

More on Waltz Algorithm The constraints come from the fact that a line must have the same label at both ends.

Crossword Puzzles

Latin Squares Using only the numbers 1, 2, 3, and 4, arrange four sets of these numbers into a four-by-four array so that no column or row contains the same two numbers. The result is known as a Latin square. Here are two examples of Latin squares of order 4: 1 2 3 4 2 1 4 3 3 4 1 2 4 3 2 1 1 2 3 4 3 4 1 2 4 3 2 1 2 1 4 3 Such arrays have proved useful for a variety of purposes. Suppose, for example, you wanted to check the resistance to wear of four brands of automobile tires. Putting one tire of each brand on the four wheels of one car isn't good enough because the amount of wear may differ in those four positions and vary from week to week owing to different weather conditions. A better experiment would be to use four tires for four weeks and to interchange the four positions from week to week according to a four-by-four Latin square. http://www.sciencenews.org/20000506/mathtrek.asp

Satisfiability (P  Q  S)  (A   Q  B)  (P   B  C)  ( A  B  C)  (Q  A  C) Example applications: 3-SAT: all disjuncts contain exactly three terms The general problem is NP-hard. Examples:

Real Examples Scheduling What else?

Algorithms for CSPs Branching State space: usually incremental formulation Straight line State space: usually complete-state formulation

Cryptarithmetic SEND +MORE PEAS description: MONEY State space when formulated as a CSP: variables, domain, constraints Incremental state space formulation: Complete state formulation: Performance measure, Environment, Actuators, Sensors Note that in the state space description, probably only the final answer may be visible to the world. So the only actuator in the PEAS description is “solve”. Need one variable for each letter plus one for each carry digit. Constraints on the next slide

Cryptarithmetic SEND Representing the constraints: +MORE As formulas: MONEY Representing the constraints: As formulas: As a graph: Using special constraints: Alldiff Formulas: D + E = Y + 10*C1 Graph: Use one square for each constraint. One circle for each variable. Connect each square to each circle that participates in it. See R & N Figure 5.2

Cryptarithmetic – Best First Search SEND +MORE MONEY M = 1 M = 2 M = 2 Does this make sense? Should we ever be following competing paths at once? If we did do this, what heuristic function would we use? Suppose we used the complete state formulation (next slide)? Then could we do this? It turns out that a straight line algorithm will perform so well, using a complete state formulation, that it isn’t worth it.

Cryptarithmetic – Best First Search SEND +MORE MONEY M = 1 M = 2 M = 2 M = 1 S = 2 O =3 … Does this make sense? Should we ever be following competing paths at once? If we did do this, what heuristic function would we use? Suppose we used the complete state formulation? Then could we do this? It turns out that a straight line algorithm will perform so well, using a complete state formulation, that it isn’t worth it.

Cryptarithmetic – Branching Algorithms Backtracking Minimum remaining values Degree heuristic Least-constraining value SEND +MORE MONEY Minimum remaining values: Choose the variable with the fewest remaining legal values Degree heuristic: Select the variable that is involved in the largest number of constraints with other, unassigned variables. The idea is that if this is a bad plan, we’ll discover it soon. Use as a tie breaker for Minimum remaining values. Least-constraining value: prefer the value that rules out the fewest choices for related variables. Tries to leave the most flexibility. A big win if there are lots of solutions and we only care about finding one. Why do we choose the most constrained variable but the least constraining value? Because we must consider every variable. But if we’re lucky, we won’t consider every value. M = 1 M = 2 M = 2

Cryptarithmetic – Constraint Propagation Forward checking: After assigning a value to a variable X, look at all the variables connected to X and prune inconsistent values. Constraint propagation using arc consistency: The tradeoff: how much time to spend propagating vs. searching. How much do we do before we even start? In general, will we be able to eliminate combinatorial explosion? No. SEND +MORE MONEY

Backtracking – Chronological vs. Dependency Directed

Straight-Line Algorithms: Min-Conflicts function Min-Conflicts(csp, max_steps) returns a solution or failure inputs: csp, a constraint satisfaction problem max_steps, the number of steps allowed before giving up current  an initial assignment for csp for i = 1 to max_steps do if current is a solution for csp then return current var  a randomly chosen, conflicted variable from Variables[csp] value  the value v for var that minimizes Conflicts(var, v, current, csp) set var = value in current return failure Remember the problem we had with the 4 Queens problem when we tried hill climbing? We got stuck at a local maximum. Will Min-Conflicts have this same problem? Could we restate the 4 queens problem as a CSP and use this?

Do Straight-Line Algorithms Work? Does Min-Conflicts work? From: http://www.cs.mu.oz.au/303/slides/week03ah.pdf

Do Straight-Line Algorithms Work? You’ll see this same phenomenon in the Latin squares problem on the homework.

Another Win of Straight Line Algorithms They can be used to perturb a solution that ceases to be correct: Most scheduling problems