CS 188: Artificial Intelligence

Slides:



Advertisements
Similar presentations
Constraint Satisfaction Problems
Advertisements

Constraint Satisfaction Problems (Chapter 6). What is search for? Assumptions: single agent, deterministic, fully observable, discrete environment Search.
Constraint Satisfaction Problems
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.
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)
Constraint Satisfaction Problems. Constraint satisfaction problems (CSPs) Standard search problem: – State is a “black box” – any data structure that.
CPSC 322, Lecture 11Slide 1 Constraint Satisfaction Problems (CSPs) Introduction Computer Science cpsc322, Lecture 11 (Textbook Chpt 4.0 – 4.2) January,
4 Feb 2004CS Constraint Satisfaction1 Constraint Satisfaction Problems Chapter 5 Section 1 – 3.
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.
Constraint Satisfaction Problems
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.
Slide 1 Constraint Satisfaction Problems (CSPs) Introduction Jim Little UBC CS 322 – CSP 1 September 27, 2014 Textbook §
CSPs Tamara Berg CS 560 Artificial Intelligence Many slides throughout the course adapted from Svetlana Lazebnik, Dan Klein, Stuart Russell, Andrew Moore,
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.
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.
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 8520 Spring Paula Matuszek CS 8520: Artificial Intelligence Search 3: Constraint Satisfaction Problems Paula Matuszek Spring, 2013.
CSPs Tamara Berg CS Artificial Intelligence Many slides throughout the course adapted from Svetlana Lazebnik, Dan Klein, Stuart Russell, Andrew.
Chapter 5 Constraint Satisfaction Problems
Constraint Satisfaction Problems (Chapter 6)
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.
1 Constraint Satisfaction Problems (CSP). Announcements Second Test Wednesday, April 27.
Constraint Satisfaction Problems
1 Hojjat Ghaderi [Courtesy of Fahiem Bacchus], University of Toronto, Fall 2006 CSC384: Intro to Artificial Intelligence Backtracking Search I ● Announcements.
Cse 150, Fall 2012Gary Cottrell: Many slides borrowed from David Kriegman! Constraint Satisfaction Problems Introduction to Artificial Intelligence CSE.
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) Introduction
Constraint Satisfaction Problems (Chapter 6)
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
ECE 448, Lecture 7: Constraint Satisfaction Problems
Constraint Satisfaction Problems (CSPs)
Constraint Satisfaction Problems Lecture # 14, 15 & 16
Constraint Satisfaction Problems (CSPs) Introduction
Instructor: Vincent Conitzer
Constraint Satisfaction Problem
Advanced Artificial Intelligence
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
Constraint Satisfaction Problems
Constraint Satisfaction Problems
Artificial Intelligence
CSP Warm-up Assign Red, Green, or Blue
Constraint satisfaction problems
Constraint Satisfaction Problems. A Quick Overview
Constraint Satisfaction Problems
CS 8520: Artificial Intelligence
Constraint Satisfaction Problems
Constraint satisfaction problems
Constraint Satisfaction Problems (CSP)
CS 188: Artificial Intelligence
Presentation transcript:

CS 188: Artificial Intelligence Constraint Satisfaction Problems Please retain proper attribution, including the reference to ai.berkeley.edu. Thanks! Instructor: Jared Saia University of New Mexico [These slides adapted from Dan Klein and Pieter Abbeel]

Constraint Satisfaction Problems N variables domain D constraints x2 x1 coloring problem; silly but good representation for real world problems, e.g. scheduling tasks that need resources – can’t run 2 tasks at the same time if they need the same resource CSPs as a search problem states goal test successor function partial assignment complete; satisfies constraints assign an unassigned variable

What is Search For? Assumptions about the world: a single agent, deterministic actions, fully observed state, discrete state space Planning: sequences of actions The path to the goal is the important thing Paths have various costs, depths Heuristics give problem-specific guidance Identification: assignments to variables The goal itself is important, not the path All paths at the same depth (for some formulations) CSPs are specialized for identification problems

Constraint Satisfaction Problems Standard search problems: State is a “black box”: arbitrary data structure Goal test can be any function over states Successor function can also be anything Constraint satisfaction problems (CSPs): A special subset of search problems State is defined by variables Xi with values from a domain D (sometimes D depends on i) Goal test is a set of constraints specifying allowable combinations of values for subsets of variables Simple example of a formal representation language Allows useful general-purpose algorithms with more power than standard search algorithms Goal test has structure, it ‘s more like a manual describing a set of constraints that have to hold true

CSP Examples

Example: Map Coloring Variables: Domains: Constraints: adjacent regions must have different colors Solutions are assignments satisfying all constraints, e.g.: Implicit: Explicit:

Example: N-Queens Formulation 1: Variables: Domains: Constraints

Example: N-Queens Formulation 2: Variables: Domains: Constraints: Implicit: Explicit:

Example: Cryptarithmetic Variables: Domains: Constraints: 0=7, R=4, W=6, U=2, T=8, F=1; 867 + 867 = 1734

Example: Sudoku 9-way alldiff for each column Variables: Each (open) square Domains: {1,2,…,9} Constraints: 9-way alldiff for each column 9-way alldiff for each row 9-way alldiff for each region (or can have a bunch of pairwise inequality constraints)

Solving CSPs

Standard Search Formulation Standard search formulation of CSPs States defined by the values assigned so far (partial assignments) Initial state: the empty assignment, {} Successor function: assign a value to an unassigned variable Goal test: the current assignment is complete and satisfies all constraints We’ll start with the straightforward, naïve approach, then improve it

Search Methods What would BFS do? {} {WA=g} {WA=r} … {NT=g} … Demo: CS188 javascript demos -> source -> exercises -> csps -> CSPs demos -> CSPs demos.html Settings: Graph = Simple Algorithm = Naïve Search Ordering = None Filtering = None [Demo: coloring -- dfs]

Search Methods What would BFS do? What would DFS do? let’s see! What problems does naïve search have? Demo: CS188 javascript demos -> source -> exercises -> csps -> CSPs demos -> CSPs demos.html Settings: Graph = Simple Algorithm = Naïve Search Ordering = None Filtering = None [Demo: coloring -- dfs]

Video of Demo Coloring -- DFS

Backtracking Search

Backtracking Search Backtracking search is the basic uninformed algorithm for solving CSPs Idea 1: One variable at a time Variable assignments are commutative, so fix ordering -> better branching factor! I.e., [WA = red then NT = green] same as [NT = green then WA = red] Only need to consider assignments to a single variable at each step Idea 2: Check constraints as you go I.e. consider only values which do not conflict previous assignments Might have to do some computation to check the constraints “Incremental goal test” Depth-first search with these two improvements is called backtracking search (not the best name) Can solve n-queens for n  25

Backtracking Example [Demo: coloring -- backtracking]

Video of Demo Coloring – Backtracking

Backtracking Search Demo: CS188 javascript demos -> source -> exercises -> csps -> CSPs demos -> CSPs demos.html Settings: Graph = Simple Algorithm = Backtracking Ordering = None Filtering = None Backtracking = DFS + variable-ordering + fail-on-violation What are the choice points?