Constraint satisfaction search

Size: px
Start display at page:

Download "Constraint satisfaction search"

Transcription

1 CS 70 Foundations of AI Lecture 6 Constraint satisfaction search Milos Hauskrecht milos@cs.pitt.edu 539 Sennott Square Search problem A search problem: Search space (or state space): a set of objects among which we conduct the search; Initial state: an object we start to search from; Operators (actions): transform one state in the search space to the other; Goal condition: describes the object we search for Possible metric on the search space: measures the quality of the object with respect to the goal

2 Constraint satisfaction problem (CSP) wo types of search: path search (a path from the initial state to a state satisfying the goal condition) configuration search (a configuration satisfying goal conditions) Constraint satisfaction problem (CSP) = a configuration search problem where: A state is defined by a set of variables and their values Goal condition is represented by a set constraints on possible variable values Special properties of the CSP lead to special search procedures we can design to solve them Eample of a CSP: N-queens Goal: n queens placed in non-attacking positions on the board ariables: Represent queens, one for each column:,, 3, alues: Row placement of each queen on the board {,, 3, }, Constraints: i j i j i j wo queens not in the same row wo queens not on the same diagonal

3 Satisfiability () problem Determine whether a sentence in the conjunctive normal form (CNF) is satisfiable (can evaluate to true) Used in the propositional logic (covered later) ( P R) ( P R S) ( P ) ariables: Propositional symbols (P, R,, S) alues: rue, False Constraints: Every conjunct must evaluate to true, at least one of the literals must evaluate to true ( P R) rue,( P R S) rue, Other real world CSP problems Scheduling problems: E.g. telescope scheduling High-school class schedule Design problems: Hardware configurations LSI design More comple problems may involve: real-valued variables additional preferences on variable assignments the optimal configuration is sought 3

4 Eercise: Map coloring problem Color a map using k different colors such that no adjacent countries have the same color ariables:? ariable values:? Constraints:? Map coloring Color a map using k different colors such that no adjacent countries have the same color ariables: Represent countries A, B, C, D, E alues: K -different colors {Red, Blue, Green,..} Constraints:?

5 Map coloring Color a map using k different colors such that no adjacent countries have the same color ariables: Represent countries A, B, C, D, E alues: K -different colors {Red, Blue, Green,..} Constraints: A B, A C, C E, etc his is an eample of a problem with binary constraints Constraint satisfaction as a search problem A formulation of the search problem: States. Assignment (partial or complete) of values to variables. Initial state. No variable is assigned a value. Operators. Assign a value to one of the unassigned variables. Goal condition. All variables are assigned, no constraints are violated. Constraints can be represented: Eplicitly by a set of allowable values Implicitly by a function that tests for the satisfaction of constraints 5

6 Search strategies for solving CSP Unassigned:,, 3, Assigned: Unassigned:, Assigned: 3, Unassigned:, 3, Assigned: Unassigned: 3, Assigned:, Search strategies for solving CSP Maimum depth of the tree (m):? Depth of the solution (d) :? Branching factor (b) :? Unassigned:,, Assigned: 3, Unassigned:, 3, Assigned: Unassigned:, 3, Assigned: Unassigned: 3, Assigned:, 6

7 Search strategies for solving CSP Maimum depth of the tree: Number of variables in the CSP Depth of the solution: Number of variables in the CSP Branching factor: if we fi the order of variable assignments the branch factor depends on the number of their values Unassigned:,, Assigned: 3, Unassigned:, 3, Assigned: Unassigned:, 3, Assigned: Unassigned: 3, Assigned:, Search strategies for solving CSP What search algorithm to use:? Unassigned:,, Assigned: 3, Unassigned:, 3, Assigned: Unassigned:, 3, Assigned: Unassigned: 3, Assigned:, 7

8 Search strategies for solving CSP What search algorithm to use:? Depth of the tree = Depth of the solution=number of vars Unassigned:,, Assigned: 3, Unassigned:, 3, Assigned: Unassigned:, 3, Assigned: Unassigned: 3, Assigned:, Search strategies for solving CSP What search algorithm to use: Depth first search!!! Since we know the depth of the solution We do not have to keep large number of nodes in queues Unassigned:,, Assigned: 3, Unassigned:, 3, Assigned: Unassigned:, 3, Assigned: Unassigned: 3, Assigned:, 8

9 Search strategies for solving CSP What search algorithm to use: Depth first search!!! Since we know the depth of the solution We do not have to keep large number of nodes in queues Unassigned:,, Assigned: 3, Unassigned:, 3, Assigned: Unassigned:, 3, Assigned: Depth-first search strategy for CSP is also referred to as backtracking Unassigned: 3, Assigned:, Constraint consistency uestion: When to check the constraints defining the goal condition? he violation of constraints can be checked: at the end (for the leaf nodes) for each node of the search tree during its generation or before its epansion Checking the constraints for intermediate nodes: More efficient: cuts branches of the search tree early 9

10 Constraint consistency Checking the constraints for intermediate nodes: More efficient: cuts branches of the search tree early Unassigned:,, Assigned: 3, Unassigned:, 3, Assigned: Unassigned:, 3, Assigned: Unassigned: 3, Assigned:, Constraint consistency Checking the constraints for intermediate nodes: More efficient: cuts branches of the search tree early Unassigned:,, Assigned: 3, Unassigned:, 3, Assigned: Unassigned:, 3, Assigned: Unassigned: 3, Assigned:, 0

11 Constraint consistency Checking the constraints for intermediate nodes: More efficient: cuts branches of the search tree early Unassigned:,, Assigned: 3, Unassigned:, 3, Assigned: Unassigned:, 3, Assigned: Unassigned: 3, Assigned:, Constraint consistency Another way to cut the search space and tree eploration Current variable assignments together with constraints restrict remaining legal values of unassigned variables he remaining legal and illegal values of variables may be inferred (effect of constraints propagates) Unassigned:,, Assigned: 3, Unassigned:, 3, Assigned: Unassigned:, 3, Assigned: Unassigned: 3, Assigned:,

12 Constraint consistency Another way to cut the search space and tree eploration Current variable assignments together with constraints restrict remaining legal values of unassigned variables he remaining legal and illegal values of variables may be inferred (effect of constraints propagates) Unassigned:,, Assigned: 3, Unassigned:, 3, Assigned: Unassigned:, 3, Assigned: Unassigned: 3, Assigned:, We know that Constraint consistency Another way to cut the search space and tree eploration Current variable assignments together with constraints restrict remaining legal values of unassigned variables he remaining legal and illegal values of variables may be inferred (effect of constraints propagates) Unassigned:,, Assigned: 3, Unassigned:, 3, Assigned: Unassigned:, 3, Assigned: hen node representing Unassigned: 3,, is not Assigned: even generated, We know that

13 Constraint consistency Another way to cut the search space and tree eploration Current variable assignments together with constraints restrict remaining legal values of unassigned variables he remaining legal and illegal values of variables may be inferred (effect of constraints propagates) o prevent blind eploration we can keep track of the remaining legal values, so we know when the constraints will be violated and when to terminate the search Constraint propagation A state (more broadly) is defined: by a set of assigned variables, their values and a list of legal and illegal assignments for unassigned variables Legal and illegal assignments can be represented: equations (value assignments) and disequations (list of invalid assignments) A Blue C Red Constraints + assignments can entail new equations and disequations A Red B Red Constraint propagation: the process of inferring of new equations and disequations from eisting equations and disequations 3

14 Constraint propagation Assign A=Red A=Red A B C D E F Red Blue Green - equations - disequations Constraint propagation Assign A=Red Red Blue Green A B C D E F E= A=Red - equations - disequations

15 Constraint propagation Assign E=Blue Red Blue Green A B C D E F E=Blue A=Red Constraint propagation Assign E=Blue Red Blue Green F=? E=Blue A=Red A B C D E F 5

16 Constraint propagation Assign F=Green Red Blue Green A B C D E F F=Green E=Blue A=Red Constraint propagation Assign F=Green Red Blue Green A B C D E F F=Green B=? A=Red E=Blue 6

17 Constraint propagation Assign F=Green Red Blue Green A B C D E F F=Green B=? A=Red E=Blue Conflict!!! No legal assignments available for B and C Constraint propagation We can derive remaining legal values through propagation A B C D E F Red Blue Green B=Green C=Green C=? B=? E=Blue A=Red 7

18 Constraint propagation We can derive remaining legal values through propagation A B C D E F Red Blue Green F=? C=? E=Blue B=? A=Red B=Green C=Green F=Red Constraint propagation We can derive remaining legal values through propagation A B C D E F Red Blue Green E=Blue B=Green C=Green F=Red A=Red B=Green C=Green F=Red 8

19 Constraint propagation hree known techniques for propagating the effects of past assignments and constraints on options left for other (yet to be assigned) variables Node propagation Arc consistency Forward checking Difference: Completeness of inferences ime compleity of inferences. Constraint propagation. Node consistency. Infers: equations (valid assignments) or disequations (invalid assignments) for an individual variable by applying a unary constraint. Arc consistency. Infers: disequations from the set of equations and disequations defining the partial assignment, and a constraint equations through the ehaustion of alternatives 3. Forward checking. Infers: disequations from equations defining the partial assignment, and a constraint Equations through the ehaustion of alternatives Restricted forward checking: uses only active constraints (active constraint only one variable unassigned in the constraint) 9

20 Eample Map coloring of Australia territories N Eample: node consistency Map coloring N Assume a constraint: Green vars N domain R G B R G B R G B R G B R G B R G B R G B inferred??????? 0

21 Map coloring Assume a constraint: Green Eample: node consistency Infer: invalid assignments from Green constraint vars N N domain R G B R G B R G B R G B R G B R G B R G B inferred R B R G B R G B R G B R G B R G B R G B Eample: forward checking Map coloring N Set: =Red vars N domain R G B R G B R G B R G B R G B R G B R G B =Red R??????

22 Eample: forward checking Map coloring N Infer: invalid assignments from =Red + constraints vars N domain R G B R G B R G B R G B R G B R G B R G B =Red R G B R G B R G B R G B G B R G B Eample: forward checking Map coloring N Set: =Green vars N domain R G B R G B R G B R G B R G B R G B R G B =Red R G B R G B R G B R G B G B R G B =Green R? G????

23 Eample: forward checking Map coloring N Infer: invalid assignments from =Green + constraints vars N domain R G B R G B R G B R G B R G B R G B R G B =Red R G B R G B R G B R G B G B R G B =Green R B G R B R G B B R G B Eample: forward checking Map coloring N Infer: N=B Ehaustions of alternatives vars N domain R G B R G B R G B R G B R G B R G B R G B =Red R G B R G B R G B R G B G B R G B =Green R B G R B R G B B R G B Infer N R B G???? 3

24 Eample: forward checking Map coloring N Infer: invalid assignments from N=B vars N domain R G B R G B R G B R G B R G B R G B R G B =Red R G B R G B R G B R G B G B R G B =Green R B G R B R G B B R G B Infer N R B G R B R G B! R G B Eample: arc consistency Map coloring N Set: =Red Set: =Green vars N domain R G B R G B R G B R G B R G B R G B R G B =Red R G B R G B R G B R G B G B R G B =Green R B G R B R G B B R G B

25 Eample: arc consistency Map coloring N vars {B} Infer: invalid assignments from valid and invalid assignments N domain R G B R G B R G B R G B R G B R G B R G B =Red R G B R G B R G B R G B G B R G B =Green R B G R B R G B B R G B {R,B} Map coloring vars Eample: arc consistency {B} Infer: invalid assignments from valid and invalid assignments N N domain R G B R G B R G B R G B R G B R G B R G B =Red R G B R G B R G B R G B G B R G B =Green R B G R B R G B B R G B {R,B} =B =R Consistent assignment 5

26 Map coloring vars Eample: arc consistency {B} Infer: invalid assignments from valid and invalid assignments N N domain R G B R G B R G B R G B R G B R G B R G B =Red R G B R G B R G B R G B G B R G B =Green R B G R B R G B B R G B {R,B} =R =B Consistent assignment Map coloring vars Eample: arc consistency {B} Infer: invalid assignments from valid and invalid assignments N N domain R G B R G B R G B R G B R G B R G B R G B =Red R G B R G B R G B R G B G B R G B =Green R B G R B R G B B R G B {R,B} =B =! Inconsistent assignment 6

27 Map coloring vars Eample: arc consistency {B} Infer: invalid assignments from valid and invalid assignments N N domain R G B R G B R G B R G B R G B R G B R G B =Red R G B R G B R G B R G B G B R G B =Green R B G R B R G B B R G B R {R,B} =B =! Inconsistent assignment Heuristics for CSPs CSP searches the space in the depth-first manner. But we still can choose: Which variable to assign net? Which value to choose first? Heuristics Most constrained variable Which variable is likely to become a bottleneck? Least constraining value Which value gives us more fleibility later? 7

28 Eample: map coloring Heuristics for CSP Heuristics Most constrained variable? Least constraining value? Eamples: map coloring Heuristics for CSP Heuristics Most constrained variable Country E is the most constrained one (cannot use Red, Green) Least constraining value? 8

29 Eamples: map coloring Heuristics for CSP Heuristics Most constrained variable Country E is the most constrained one (cannot use Red, Green) Least constraining value Assume we have chosen variable C What color is the least constraining color? Eamples: map coloring Heuristics for CSP Heuristics Most constrained variable Country E is the most constrained one (cannot use Red, Green) Least constraining value Assume we have chosen variable C Red is the least constraining valid color for the future 9

Constraint satisfaction search. Combinatorial optimization search.

Constraint satisfaction search. Combinatorial optimization search. CS 1571 Introduction to AI Lecture 8 Constraint satisfaction search. Combinatorial optimization search. Milos Hauskrecht milos@cs.pitt.edu 539 Sennott Square Constraint satisfaction problem (CSP) Objective:

More information

Informed (heuristic) search (cont). Constraint-satisfaction search.

Informed (heuristic) search (cont). Constraint-satisfaction search. CS 1571 Introduction to AI Lecture 5 Informed (heuristic) search (cont). Constraint-satisfaction search. Milos Hauskrecht milos@cs.pitt.edu 539 Sennott Square Administration PS 1 due today Report before

More information

Constraint satisfaction search. Combinatorial optimization search.

Constraint satisfaction search. Combinatorial optimization search. S 1571 Introduction to I Lecture 8 onstraint satisfaction search. ombinatorial optimization search. Milos Hauskrecht milos@cs.pitt.edu 539 Sennott Square onstraint satisfaction problem (SP) Objective:

More information

Lecture 18. Questions? Monday, February 20 CS 430 Artificial Intelligence - Lecture 18 1

Lecture 18. Questions? Monday, February 20 CS 430 Artificial Intelligence - Lecture 18 1 Lecture 18 Questions? Monday, February 20 CS 430 Artificial Intelligence - Lecture 18 1 Outline Chapter 6 - Constraint Satisfaction Problems Path Consistency & Global Constraints Sudoku Example Backtracking

More information

Constraint Satisfaction Problems Part 2

Constraint Satisfaction Problems Part 2 Constraint Satisfaction Problems Part 2 Deepak Kumar October 2017 CSP Formulation (as a special case of search) State is defined by n variables x 1, x 2,, x n Variables can take on values from a domain

More information

Admin. Quick search recap. Constraint Satisfaction Problems (CSPs)! Intro Example: 8-Queens. Where should I put the queens in columns 3 and 4?

Admin. Quick search recap. Constraint Satisfaction Problems (CSPs)! Intro Example: 8-Queens. Where should I put the queens in columns 3 and 4? Admin Constraint Satisfaction Problems (CSPs)! CS David Kauchak Spring 0 Final project comments: Use preexisting code Get your data now! Use preexisting data sets Finding good references Google scholar

More information

CONSTRAINT SATISFACTION

CONSTRAINT SATISFACTION 9// CONSRAI ISFACION oday Reading AIMA Chapter 6 Goals Constraint satisfaction problems (CSPs) ypes of CSPs Inference Search + Inference 9// 8-queens problem How would you go about deciding where to put

More information

Outline. Best-first search

Outline. Best-first search Outline Best-first search Greedy best-first search A* search Heuristics Local search algorithms Hill-climbing search Beam search Simulated annealing search Genetic algorithms Constraint Satisfaction Problems

More information

Constraint Satisfaction Problems Chapter 3, Section 7 and Chapter 4, Section 4.4 AIMA Slides cstuart Russell and Peter Norvig, 1998 Chapter 3, Section

Constraint Satisfaction Problems Chapter 3, Section 7 and Chapter 4, Section 4.4 AIMA Slides cstuart Russell and Peter Norvig, 1998 Chapter 3, Section Constraint Satisfaction Problems Chapter 3, Section 7 and Chapter 4, Section 4.4 AIMA Slides cstuart Russell and Peter Norvig, 1998 Chapter 3, Section 7 and Chapter 4, Section 4.4 1 Outline } CSP examples

More information

Foundations of Artificial Intelligence

Foundations of Artificial Intelligence Foundations of Artificial Intelligence 5. Constraint Satisfaction Problems CSPs as Search Problems, Solving CSPs, Problem Structure Wolfram Burgard, Bernhard Nebel, and Martin Riedmiller Albert-Ludwigs-Universität

More information

Lecture 6: Constraint Satisfaction Problems (CSPs)

Lecture 6: Constraint Satisfaction Problems (CSPs) Lecture 6: Constraint Satisfaction Problems (CSPs) CS 580 (001) - Spring 2018 Amarda Shehu Department of Computer Science George Mason University, Fairfax, VA, USA February 28, 2018 Amarda Shehu (580)

More information

CONSTRAINT SATISFACTION

CONSTRAINT SATISFACTION CONSRAI ISFACION oday Reading AIMA Read Chapter 6.1-6.3, Skim 6.4-6.5 Goals Constraint satisfaction problems (CSPs) ypes of CSPs Inference (Search + Inference) 1 8-queens problem How would you go about

More information

Comments about assign 1. Quick search recap. Constraint Satisfaction Problems (CSPs) Search uninformed BFS, DFS, IDS. Adversarial search

Comments about assign 1. Quick search recap. Constraint Satisfaction Problems (CSPs) Search uninformed BFS, DFS, IDS. Adversarial search Constraint Satisfaction Problems (CSPs) CS5 David Kauchak Fall 00 http://www.xkcd.com/78/ Some material borrowed from: Sara Owsley Sood and others Comments about assign Grading actually out of 60 check

More information

10/11/2017. Constraint Satisfaction Problems II. Review: CSP Representations. Heuristic 1: Most constrained variable

10/11/2017. Constraint Satisfaction Problems II. Review: CSP Representations. Heuristic 1: Most constrained variable //7 Review: Constraint Satisfaction Problems Constraint Satisfaction Problems II AIMA: Chapter 6 A CSP consists of: Finite set of X, X,, X n Nonempty domain of possible values for each variable D, D, D

More information

Announcements. Reminder: CSPs. Today. Example: N-Queens. Example: Map-Coloring. Introduction to Artificial Intelligence

Announcements. Reminder: CSPs. Today. Example: N-Queens. Example: Map-Coloring. Introduction to Artificial Intelligence Introduction to Artificial Intelligence 22.0472-001 Fall 2009 Lecture 5: Constraint Satisfaction Problems II Announcements Assignment due on Monday 11.59pm Email search.py and searchagent.py to me Next

More information

CS 4100/5100: Foundations of AI

CS 4100/5100: Foundations of AI CS 4100/5100: Foundations of AI Constraint satisfaction problems 1 Instructor: Rob Platt r.platt@neu.edu College of Computer and information Science Northeastern University September 5, 2013 1 These notes

More information

Constraint Satisfaction Problems

Constraint Satisfaction Problems Last update: February 25, 2010 Constraint Satisfaction Problems CMSC 421, Chapter 5 CMSC 421, Chapter 5 1 Outline CSP examples Backtracking search for CSPs Problem structure and problem decomposition Local

More information

ARTIFICIAL INTELLIGENCE (CS 370D)

ARTIFICIAL INTELLIGENCE (CS 370D) Princess Nora University Faculty of Computer & Information Systems ARTIFICIAL INTELLIGENCE (CS 370D) (CHAPTER-6) CONSTRAINT SATISFACTION PROBLEMS Outline What is a CSP CSP applications Backtracking search

More information

Constraint Satisfaction Problems

Constraint Satisfaction Problems Constraint Satisfaction Problems [These slides were created by Dan Klein and Pieter Abbeel for CS188 Intro to AI at UC Berkeley. All CS188 materials are available at http://ai.berkeley.edu.] What is Search

More information

Constraint Satisfaction Problems (CSP) (Where we postpone making difficult

Constraint Satisfaction Problems (CSP) (Where we postpone making difficult Constraint Satisfaction Problems (CSP) (Where we postpone making difficult decisions until they become easy to make) R&N: Chap. What we will try to do... Search techniques make choices in an often arbitrary

More information

DIT411/TIN175, Artificial Intelligence. Peter Ljunglöf. 30 January, 2018

DIT411/TIN175, Artificial Intelligence. Peter Ljunglöf. 30 January, 2018 DIT411/TIN175, Artificial Intelligence Chapter 7: Constraint satisfaction problems CHAPTER 7: CONSTRAINT SATISFACTION PROBLEMS DIT411/TIN175, Artificial Intelligence Peter Ljunglöf 30 January, 2018 1 TABLE

More information

Constraint Satisfaction. AI Slides (5e) c Lin

Constraint Satisfaction. AI Slides (5e) c Lin Constraint Satisfaction 4 AI Slides (5e) c Lin Zuoquan@PKU 2003-2018 4 1 4 Constraint Satisfaction 4.1 Constraint satisfaction problems 4.2 Backtracking search 4.3 Constraint propagation 4.4 Local search

More information

CS 343: Artificial Intelligence

CS 343: Artificial Intelligence CS 343: Artificial Intelligence Constraint Satisfaction Problems Prof. Scott Niekum The University of Texas at Austin [These slides are based on those of Dan Klein and Pieter Abbeel for CS188 Intro to

More information

Constraint Satisfaction

Constraint Satisfaction Constraint Satisfaction Philipp Koehn 1 October 2015 Outline 1 Constraint satisfaction problems (CSP) examples Backtracking search for CSPs Problem structure and problem decomposition Local search for

More information

CS 771 Artificial Intelligence. Constraint Satisfaction Problem

CS 771 Artificial Intelligence. Constraint Satisfaction Problem CS 771 Artificial Intelligence Constraint Satisfaction Problem Constraint Satisfaction Problems So far we have seen a problem can be solved by searching in space of states These states can be evaluated

More information

Constraints. CSC 411: AI Fall NC State University 1 / 53. Constraints

Constraints. CSC 411: AI Fall NC State University 1 / 53. Constraints CSC 411: AI Fall 2013 NC State University 1 / 53 Constraint satisfaction problems (CSPs) Standard search: state is a black box that supports goal testing, application of an evaluation function, production

More information

CS 188: Artificial Intelligence Fall 2011

CS 188: Artificial Intelligence Fall 2011 Announcements Project 1: Search is due next week Written 1: Search and CSPs out soon Piazza: check it out if you haven t CS 188: Artificial Intelligence Fall 2011 Lecture 4: Constraint Satisfaction 9/6/2011

More information

Week 8: Constraint Satisfaction Problems

Week 8: Constraint Satisfaction Problems COMP3411/ 9414/ 9814: Artificial Intelligence Week 8: Constraint Satisfaction Problems [Russell & Norvig: 6.1,6.2,6.3,6.4,4.1] COMP3411/9414/9814 18s1 Constraint Satisfaction Problems 1 Outline Constraint

More information

Constraint Satisfaction Problems

Constraint Satisfaction Problems Constraint Satisfaction Problems Chapter 5 Section 1 3 Constraint Satisfaction 1 Outline Constraint Satisfaction Problems (CSP) Backtracking search for CSPs Local search for CSPs Constraint Satisfaction

More information

Chapter 6 Constraint Satisfaction Problems

Chapter 6 Constraint Satisfaction Problems Chapter 6 Constraint Satisfaction Problems CS5811 - Artificial Intelligence Nilufer Onder Department of Computer Science Michigan Technological University Outline CSP problem definition Backtracking search

More information

Example: Map coloring

Example: Map coloring Today s s lecture Local Search Lecture 7: Search - 6 Heuristic Repair CSP and 3-SAT Solving CSPs using Systematic Search. Victor Lesser CMPSCI 683 Fall 2004 The relationship between problem structure and

More information

What is Search For? CS 188: Artificial Intelligence. Constraint Satisfaction Problems

What is Search For? CS 188: Artificial Intelligence. Constraint Satisfaction Problems CS 188: Artificial Intelligence Constraint Satisfaction Problems What is Search For? Assumptions about the world: a single agent, deterministic actions, fully observed state, discrete state space Planning:

More information

Constraint Satisfaction Problems

Constraint Satisfaction Problems Revised by Hankui Zhuo, March 14, 2018 Constraint Satisfaction Problems Chapter 5 Chapter 5 1 Outline CSP examples Backtracking search for CSPs Problem structure and problem decomposition Local search

More information

Constraint Satisfaction Problems

Constraint Satisfaction Problems Constraint Satisfaction Problems Chapter 5 Chapter 5 1 Outline CSP examples Backtracking search for CSPs Problem structure and problem decomposition Local search for CSPs Chapter 5 2 Constraint satisfaction

More information

CONSTRAINT SATISFACTION

CONSTRAINT SATISFACTION CONSRAI ISFACION oday Constraint satisfaction problems (CSPs) ypes of CSPs Inference Search 1 8-queens problem Exploit the constraints Constraint Satisfaction Problems Advantages of CSPs Use general-purpose

More information

Constraint Satisfaction Problems

Constraint Satisfaction Problems Constraint Satisfaction Problems Berlin Chen Department of Computer Science & Information Engineering National Taiwan Normal University References: 1. S. Russell and P. Norvig. Artificial Intelligence:

More information

Announcements. CS 188: Artificial Intelligence Fall 2010

Announcements. CS 188: Artificial Intelligence Fall 2010 Announcements Project 1: Search is due Monday Looking for partners? After class or newsgroup Written 1: Search and CSPs out soon Newsgroup: check it out CS 188: Artificial Intelligence Fall 2010 Lecture

More information

Constraint Satisfaction Problems. A Quick Overview (based on AIMA book slides)

Constraint Satisfaction Problems. A Quick Overview (based on AIMA book slides) Constraint Satisfaction Problems A Quick Overview (based on AIMA book slides) Constraint satisfaction problems What is a CSP? Finite set of variables V, V 2,, V n Nonempty domain of possible values for

More information

Announcements. CS 188: Artificial Intelligence Spring Today. Example: Map-Coloring. Example: Cryptarithmetic.

Announcements. CS 188: Artificial Intelligence Spring Today. Example: Map-Coloring. Example: Cryptarithmetic. CS 188: Artificial Intelligence Spring 2010 Lecture 5: CSPs II 2/2/2010 Pieter Abbeel UC Berkeley Many slides from Dan Klein Announcements Project 1 due Thursday Lecture videos reminder: don t count on

More information

Constraint Satisfaction Problems. Chapter 6

Constraint Satisfaction Problems. Chapter 6 Constraint Satisfaction Problems Chapter 6 Office hours Office hours for Assignment 1 (ASB9810 in CSIL): Sep 29th(Fri) 12:00 to 13:30 Oct 3rd(Tue) 11:30 to 13:00 Late homework policy You get four late

More information

CS 188: Artificial Intelligence. What is Search For? Constraint Satisfaction Problems. Constraint Satisfaction Problems

CS 188: Artificial Intelligence. What is Search For? Constraint Satisfaction Problems. Constraint Satisfaction Problems CS 188: Artificial Intelligence Constraint Satisfaction Problems Constraint Satisfaction Problems N variables domain D constraints x 1 x 2 Instructor: Marco Alvarez University of Rhode Island (These slides

More information

CS-171, Intro to A.I. Mid-term Exam Fall Quarter, 2014

CS-171, Intro to A.I. Mid-term Exam Fall Quarter, 2014 CS-171, Intro to A.I. Mid-term Exam Fall Quarter, 2014 YOUR NAME: YOUR ID: ID TO RIGHT: ROW: SEAT: The exam will begin on the next page. Please, do not turn the page until told. When you are told to begin

More information

Problem 1 Zero: 11% (~20 students), Partial: 66% (~120 students), Perfect: 23% (~43 students)

Problem 1 Zero: 11% (~20 students), Partial: 66% (~120 students), Perfect: 23% (~43 students) For each question on the Mid-term Exam, Zero below gives the fraction of students who scored zero, Partial gives the fraction who got partial credit, and Perfect gives the fraction who scored 100%. Problem

More information

Constraint Satisfaction. CS 486/686: Introduction to Artificial Intelligence

Constraint Satisfaction. CS 486/686: Introduction to Artificial Intelligence Constraint Satisfaction CS 486/686: Introduction to Artificial Intelligence 1 Outline What are Constraint Satisfaction Problems (CSPs)? Standard Search and CSPs Improvements Backtracking Backtracking +

More information

Constraint Satisfaction Problems

Constraint Satisfaction Problems Constraint Satisfaction Problems Chapter 5 Chapter 5 1 Outline CSP examples Backtracking search for CSPs Problem structure and problem decomposition Local search for CSPs Chapter 5 2 Constraint satisfaction

More information

Constraint Satisfaction Problems. slides from: Padhraic Smyth, Bryan Low, S. Russell and P. Norvig, Jean-Claude Latombe

Constraint Satisfaction Problems. slides from: Padhraic Smyth, Bryan Low, S. Russell and P. Norvig, Jean-Claude Latombe Constraint Satisfaction Problems slides from: Padhraic Smyth, Bryan Low, S. Russell and P. Norvig, Jean-Claude Latombe Standard search problems: State is a black box : arbitrary data structure Goal test

More information

CS 188: Artificial Intelligence Fall 2011

CS 188: Artificial Intelligence Fall 2011 CS 188: Artificial Intelligence Fall 2011 Lecture 5: CSPs II 9/8/2011 Dan Klein UC Berkeley Multiple slides over the course adapted from either Stuart Russell or Andrew Moore 1 Today Efficient Solution

More information

Announcements. Homework 1: Search. Project 1: Search. Midterm date and time has been set:

Announcements. Homework 1: Search. Project 1: Search. Midterm date and time has been set: Announcements Homework 1: Search Has been released! Due Monday, 2/1, at 11:59pm. On edx online, instant grading, submit as often as you like. Project 1: Search Has been released! Due Friday 2/5 at 5pm.

More information

Today. Introduction to Artificial Intelligence COMP 3501 / COMP Lecture 5. Constraint Satisfaction Problems (CSP) CSP Definition

Today. Introduction to Artificial Intelligence COMP 3501 / COMP Lecture 5. Constraint Satisfaction Problems (CSP) CSP Definition Today COMP 3501 / COMP 4704-4 Lecture 5 Finish up 2-player games Discuss homework Constraint Satisfaction Problems Prof. JGH 318 Constraint Satisfaction Problems (CSP) CSP s are our first work on factored

More information

Constraint Satisfaction Problems

Constraint Satisfaction Problems Constraint Satisfaction Problems CE417: Introduction to Artificial Intelligence Sharif University of Technology Spring 2013 Soleymani Course material: Artificial Intelligence: A Modern Approach, 3 rd Edition,

More information

Artificial Intelligence

Artificial Intelligence Artificial Intelligence Constraint Satisfaction Problems Marc Toussaint University of Stuttgart Winter 2015/16 (slides based on Stuart Russell s AI course) Inference The core topic of the following lectures

More information

constraint propagation, answer set programming CS 4100/5100 Foundations of AI

constraint propagation, answer set programming CS 4100/5100 Foundations of AI constraint propagation, answer set programming CS 4100/5100 Foundations of AI Announcements Assignment 1 due today Assignment 2 out tomorrow Project pitches due next week Office hours next week: Tuesday

More information

Artificial Intelligence Constraint Satisfaction Problems

Artificial Intelligence Constraint Satisfaction Problems Artificial Intelligence Constraint Satisfaction Problems Recall Search problems: Find the sequence of actions that leads to the goal. Sequence of actions means a path in the search space. Paths come with

More information

Australia Western Australia Western Territory Northern Territory Northern Australia South Australia South Tasmania Queensland Tasmania Victoria

Australia Western Australia Western Territory Northern Territory Northern Australia South Australia South Tasmania Queensland Tasmania Victoria Constraint Satisfaction Problems Chapter 5 Example: Map-Coloring Western Northern Territory South Queensland New South Wales Tasmania Variables WA, NT, Q, NSW, V, SA, T Domains D i = {red,green,blue} Constraints:

More information

Constraint Satisfaction Problems

Constraint Satisfaction Problems Constraint Satisfaction Problems Robert Platt Northeastern University Some images and slides are used from: 1. AIMA What is a CSP? The space of all search problems states and actions are atomic goals are

More information

Outline. Best-first search

Outline. Best-first search Outline Best-first search Greedy best-first search A* search Heuristics Local search algorithms Hill-climbing search Beam search Simulated annealing search Genetic algorithms Constraint Satisfaction Problems

More information

CSE 473: Artificial Intelligence

CSE 473: Artificial Intelligence CSE 473: Artificial Intelligence Constraint Satisfaction Luke Zettlemoyer Multiple slides adapted from Dan Klein, Stuart Russell or Andrew Moore What is Search For? Models of the world: single agent, deterministic

More information

CS W4701 Artificial Intelligence

CS W4701 Artificial Intelligence CS W4701 Artificial Intelligence Fall 2013 Chapter 6: Constraint Satisfaction Problems Jonathan Voris (based on slides by Sal Stolfo) Assignment 3 Go Encircling Game Ancient Chinese game Dates back At

More information

Constraint Satisfaction Problems (CSPs)

Constraint Satisfaction Problems (CSPs) 1 Hal Daumé III (me@hal3.name) Constraint Satisfaction Problems (CSPs) Hal Daumé III Computer Science University of Maryland me@hal3.name CS 421: Introduction to Artificial Intelligence 7 Feb 2012 Many

More information

Lars Schmidt-Thieme, Information Systems and Machine Learning Lab (ISMLL), University of Hildesheim, Germany, Course on Artificial Intelligence,

Lars Schmidt-Thieme, Information Systems and Machine Learning Lab (ISMLL), University of Hildesheim, Germany, Course on Artificial Intelligence, Course on Artificial Intelligence, winter term 2012/2013 0/35 Artificial Intelligence Artificial Intelligence 3. Constraint Satisfaction Problems Lars Schmidt-Thieme Information Systems and Machine Learning

More information

CS 4100 // artificial intelligence

CS 4100 // artificial intelligence CS 4100 // artificial intelligence instructor: byron wallace Constraint Satisfaction Problems Attribution: many of these slides are modified versions of those distributed with the UC Berkeley CS188 materials

More information

General Methods and Search Algorithms

General Methods and Search Algorithms DM811 HEURISTICS AND LOCAL SEARCH ALGORITHMS FOR COMBINATORIAL OPTIMZATION Lecture 3 General Methods and Search Algorithms Marco Chiarandini 2 Methods and Algorithms A Method is a general framework for

More information

Announcements. CS 188: Artificial Intelligence Fall Reminder: CSPs. Today. Example: 3-SAT. Example: Boolean Satisfiability.

Announcements. CS 188: Artificial Intelligence Fall Reminder: CSPs. Today. Example: 3-SAT. Example: Boolean Satisfiability. CS 188: Artificial Intelligence Fall 2008 Lecture 5: CSPs II 9/11/2008 Announcements Assignments: DUE W1: NOW P1: Due 9/12 at 11:59pm Assignments: UP W2: Up now P2: Up by weekend Dan Klein UC Berkeley

More information

CS 188: Artificial Intelligence Fall 2008

CS 188: Artificial Intelligence Fall 2008 CS 188: Artificial Intelligence Fall 2008 Lecture 5: CSPs II 9/11/2008 Dan Klein UC Berkeley Many slides over the course adapted from either Stuart Russell or Andrew Moore 1 1 Assignments: DUE Announcements

More information

Artificial Intelligence

Artificial Intelligence Contents Artificial Intelligence 5. Constraint Satisfaction Problems CSPs as Search Problems, Solving CSPs, Problem Structure Wolfram Burgard, Andreas Karwath, Bernhard Nebel, and Martin Riedmiller What

More information

Artificial Intelligence

Artificial Intelligence Artificial Intelligence 5. Constraint Satisfaction Problems CSPs as Search Problems, Solving CSPs, Problem Structure Wolfram Burgard, Andreas Karwath, Bernhard Nebel, and Martin Riedmiller SA-1 Contents

More information

Today. CS 188: Artificial Intelligence Fall Example: Boolean Satisfiability. Reminder: CSPs. Example: 3-SAT. CSPs: Queries.

Today. CS 188: Artificial Intelligence Fall Example: Boolean Satisfiability. Reminder: CSPs. Example: 3-SAT. CSPs: Queries. CS 188: Artificial Intelligence Fall 2007 Lecture 5: CSPs II 9/11/2007 More CSPs Applications Tree Algorithms Cutset Conditioning Today Dan Klein UC Berkeley Many slides over the course adapted from either

More information

Solving Problems by Searching: Constraint Satisfaction Problems

Solving Problems by Searching: Constraint Satisfaction Problems Course 16 :198 :520 : Introduction To Artificial Intelligence Lecture 6 Solving Problems by Searching: Constraint Satisfaction Problems Abdeslam Boularias Wednesday, October 19, 2016 1 / 1 Outline We consider

More information

Announcements. Homework 4. Project 3. Due tonight at 11:59pm. Due 3/8 at 4:00pm

Announcements. Homework 4. Project 3. Due tonight at 11:59pm. Due 3/8 at 4:00pm Announcements Homework 4 Due tonight at 11:59pm Project 3 Due 3/8 at 4:00pm CS 188: Artificial Intelligence Constraint Satisfaction Problems Instructor: Stuart Russell & Sergey Levine, University of California,

More information

What is Search For? CS 188: Artificial Intelligence. Example: Map Coloring. Example: N-Queens. Example: N-Queens. Constraint Satisfaction Problems

What is Search For? CS 188: Artificial Intelligence. Example: Map Coloring. Example: N-Queens. Example: N-Queens. Constraint Satisfaction Problems CS 188: Artificial Intelligence Constraint Satisfaction Problems What is Search For? Assumptions about the world: a single agent, deterministic actions, fully observed state, discrete state space Planning:

More information

CS 188: Artificial Intelligence Spring Today

CS 188: Artificial Intelligence Spring Today CS 188: Artificial Intelligence Spring 2006 Lecture 7: CSPs II 2/7/2006 Dan Klein UC Berkeley Many slides from either Stuart Russell or Andrew Moore Today More CSPs Applications Tree Algorithms Cutset

More information

CMU-Q Lecture 7: Searching in solution space Constraint Satisfaction Problems (CSPs) Teacher: Gianni A. Di Caro

CMU-Q Lecture 7: Searching in solution space Constraint Satisfaction Problems (CSPs) Teacher: Gianni A. Di Caro CMU-Q 15-381 Lecture 7: Searching in solution space Constraint Satisfaction Problems (CSPs) Teacher: Gianni A. Di Caro AI PLANNING APPROACHES SO FAR Goal: Find the (best) sequence of actions that take

More information

Set 5: Constraint Satisfaction Problems Chapter 6 R&N

Set 5: Constraint Satisfaction Problems Chapter 6 R&N Set 5: Constraint Satisfaction Problems Chapter 6 R&N ICS 271 Fall 2017 Kalev Kask ICS-271:Notes 5: 1 The constraint network model Outline Variables, domains, constraints, constraint graph, solutions Examples:

More information

Constraint Satisfaction Problems. Chapter 6

Constraint Satisfaction Problems. Chapter 6 Constraint Satisfaction Problems Chapter 6 Constraint Satisfaction Problems A constraint satisfaction problem consists of three components, X, D, and C: X is a set of variables, {X 1,..., X n }. D is a

More information

Example: Map-Coloring. Constraint Satisfaction Problems Western Australia. Example: Map-Coloring contd. Outline. Constraint graph

Example: Map-Coloring. Constraint Satisfaction Problems Western Australia. Example: Map-Coloring contd. Outline. Constraint graph Example: Map-Coloring Constraint Satisfaction Problems Western Northern erritory ueensland Chapter 5 South New South Wales asmania Variables, N,,, V, SA, Domains D i = {red,green,blue} Constraints: adjacent

More information

Class2: Constraint Networks Rina Dechter

Class2: Constraint Networks Rina Dechter Algorithms for Reasoning with graphical models Class2: Constraint Networks Rina Dechter dechter1: chapters 2-3, Dechter2: Constraint book: chapters 2 and 4 Text Books Road Map Graphical models Constraint

More information

Set 5: Constraint Satisfaction Problems

Set 5: Constraint Satisfaction Problems Set 5: Constraint Satisfaction Problems ICS 271 Fall 2014 Kalev Kask ICS-271:Notes 5: 1 The constraint network model Outline Variables, domains, constraints, constraint graph, solutions Examples: graph-coloring,

More information

Set 5: Constraint Satisfaction Problems

Set 5: Constraint Satisfaction Problems Set 5: Constraint Satisfaction Problems ICS 271 Fall 2013 Kalev Kask ICS-271:Notes 5: 1 The constraint network model Outline Variables, domains, constraints, constraint graph, solutions Examples: graph-coloring,

More information

Space of Search Strategies. CSE 573: Artificial Intelligence. Constraint Satisfaction. Recap: Search Problem. Example: Map-Coloring 11/30/2012

Space of Search Strategies. CSE 573: Artificial Intelligence. Constraint Satisfaction. Recap: Search Problem. Example: Map-Coloring 11/30/2012 /0/0 CSE 57: Artificial Intelligence Constraint Satisfaction Daniel Weld Slides adapted from Dan Klein, Stuart Russell, Andrew Moore & Luke Zettlemoyer Space of Search Strategies Blind Search DFS, BFS,

More information

CS 188: Artificial Intelligence Fall 2008

CS 188: Artificial Intelligence Fall 2008 CS 188: Artificial Intelligence Fall 2008 Lecture 4: CSPs 9/9/2008 Dan Klein UC Berkeley Many slides over the course adapted from either Stuart Russell or Andrew Moore 1 1 Announcements Grading questions:

More information

Announcements. CS 188: Artificial Intelligence Fall Large Scale: Problems with A* What is Search For? Example: N-Queens

Announcements. CS 188: Artificial Intelligence Fall Large Scale: Problems with A* What is Search For? Example: N-Queens CS 188: Artificial Intelligence Fall 2008 Announcements Grading questions: don t panic, talk to us Newsgroup: check it out Lecture 4: CSPs 9/9/2008 Dan Klein UC Berkeley Many slides over the course adapted

More information

(QiuXin Hui) 7.2 Given the following, can you prove that the unicorn is mythical? How about magical? Horned? Decide what you think the right answer

(QiuXin Hui) 7.2 Given the following, can you prove that the unicorn is mythical? How about magical? Horned? Decide what you think the right answer (QiuXin Hui) 7.2 Given the following, can you prove that the unicorn is mythical? How about magical? Horned? Decide what you think the right answer is yourself, then show how to get the answer using both

More information

Constraint Satisfaction Problems

Constraint Satisfaction Problems Constraint Satisfaction Problems Soup Must be Hot&Sour Appetizer Pork Dish Total Cost < $30 Chicken Dish Vegetable No Peanuts No Peanuts Not Both Spicy Seafood Rice Constraint Network Not Chow Mein 1 Formal

More information

Constraint Satisfaction

Constraint Satisfaction Constraint Satisfaction Reading: Russell & Norvig Chapter 5, Kumar, Algorithms for constraint satisfaction problems: A survey SEND + MORE = MONEY Assign distinct digits to the letters S, E, N, D, M, O,

More information

What is Search For? CSE 473: Artificial Intelligence. Example: N-Queens. Example: N-Queens. Example: Map-Coloring 4/7/17

What is Search For? CSE 473: Artificial Intelligence. Example: N-Queens. Example: N-Queens. Example: Map-Coloring 4/7/17 CSE 473: Artificial Intelligence Constraint Satisfaction Dieter Fox What is Search For? Models of the world: single agent, deterministic actions, fully observed state, discrete state space Planning: sequences

More information

CS 188: Artificial Intelligence. Recap: Search

CS 188: Artificial Intelligence. Recap: Search CS 188: Artificial Intelligence Lecture 4 and 5: Constraint Satisfaction Problems (CSPs) Pieter Abbeel UC Berkeley Many slides from Dan Klein Recap: Search Search problem: States (configurations of the

More information

Constraint satisfaction problems. CS171, Winter 2018 Introduction to Artificial Intelligence Prof. Richard Lathrop

Constraint satisfaction problems. CS171, Winter 2018 Introduction to Artificial Intelligence Prof. Richard Lathrop Constraint satisfaction problems CS171, Winter 2018 Introduction to Artificial Intelligence Prof. Richard Lathrop Constraint Satisfaction Problems What is a CSP? Finite set of variables, X 1, X 2,, X n

More information

Set 5: Constraint Satisfaction Problems

Set 5: Constraint Satisfaction Problems Set 5: Constraint Satisfaction Problems ICS 271 Fall 2012 Rina Dechter ICS-271:Notes 5: 1 Outline The constraint network model Variables, domains, constraints, constraint graph, solutions Examples: graph-coloring,

More information

Moving to a different formalism... SEND + MORE MONEY

Moving to a different formalism... SEND + MORE MONEY Moving to a different formalism... SEND + MORE -------- MONEY Consider search space for cryptarithmetic. DFS (depth-first search) Is this (DFS) how humans tackle the problem? Human problem solving appears

More information

Constraint Satisfaction Problems (CSP)

Constraint Satisfaction Problems (CSP) Constraint Satisfaction Problems (CSP) (Where we postpone making difficult decisions until they become easy to make) R&N: Chap. 5 1 What we will try to do... Search techniques make choices in an often

More information

Constraint Satisfaction Problems

Constraint Satisfaction Problems Constraint Satisfaction Problems In which we see how treating states as more than just little black boxes leads to the invention of a range of powerful new search methods and a deeper understanding of

More information

Announcements. CS 188: Artificial Intelligence Spring Today. A* Review. Consistency. A* Graph Search Gone Wrong

Announcements. CS 188: Artificial Intelligence Spring Today. A* Review. Consistency. A* Graph Search Gone Wrong CS 88: Artificial Intelligence Spring 2009 Lecture 4: Constraint Satisfaction /29/2009 John DeNero UC Berkeley Slides adapted from Dan Klein, Stuart Russell or Andrew Moore Announcements The Python tutorial

More information

1 Tree Search (12 points)

1 Tree Search (12 points) 1 Tree Search (12 points) Consider the tree shown below. The numbers on the arcs are the arc lengths. Assume that the nodes are expanded in alphabetical order when no other order is specified by the search,

More information

7 Temporal Models (20 points)

7 Temporal Models (20 points) 7 Temporal Models (20 points) 1. For the Rain-Umbrella HMM model (from class and Figure 15.2 in AIMA) with 2 time periods, show how variable elimination operates to answer the following query P (R 1 U

More information

Announcements. CS 188: Artificial Intelligence Spring Production Scheduling. Today. Backtracking Search Review. Production Scheduling

Announcements. CS 188: Artificial Intelligence Spring Production Scheduling. Today. Backtracking Search Review. Production Scheduling CS 188: Artificial Intelligence Spring 2009 Lecture : Constraint Satisfaction 2/3/2009 Announcements Project 1 (Search) is due tomorrow Come to office hours if you re stuck Today at 1pm (Nick) and 3pm

More information

Constraint Satisfaction Problems

Constraint Satisfaction Problems Constraint Satisfaction Problems CHAPTER 6 CSC 370 SPRING 2013 ALAN C. JAMIESN CSP Backtracking Search Problem Structure and Decomposition Local Search SME SLIDE CNTENT FRM RUSSELL & NRVIG PRVIDED SLIDES

More information

Reading: Chapter 6 (3 rd ed.); Chapter 5 (2 nd ed.) For next week: Thursday: Chapter 8

Reading: Chapter 6 (3 rd ed.); Chapter 5 (2 nd ed.) For next week: Thursday: Chapter 8 Constraint t Satisfaction Problems Reading: Chapter 6 (3 rd ed.); Chapter 5 (2 nd ed.) For next week: Tuesday: Chapter 7 Thursday: Chapter 8 Outline What is a CSP Backtracking for CSP Local search for

More information

CS-171, Intro to A.I. Mid-term Exam Winter Quarter, 2014

CS-171, Intro to A.I. Mid-term Exam Winter Quarter, 2014 CS-171, Intro to A.I. Mid-term Exam Winter Quarter, 2014 YOUR NAME: YOUR ID: ID TO RIGHT: ROW: SEAT NO.: The exam will begin on the next page. Please, do not turn the page until told. When you are told

More information

Constraint Satisfaction Problems

Constraint Satisfaction Problems Constraint Satisfaction Problems Tuomas Sandholm Carnegie Mellon University Computer Science Department [Read Chapter 6 of Russell & Norvig] Constraint satisfaction problems (CSPs) Standard search problem:

More information

Mathematical Programming Formulations, Constraint Programming

Mathematical Programming Formulations, Constraint Programming Outline DM87 SCHEDULING, TIMETABLING AND ROUTING Lecture 3 Mathematical Programming Formulations, Constraint Programming 1. Special Purpose Algorithms 2. Constraint Programming Marco Chiarandini DM87 Scheduling,

More information