CS188 Fall 2018 Section 2: Graph Search + CSPs

Similar documents
Midterm I. Introduction to Artificial Intelligence. CS 188 Fall You have approximately 3 hours.

Midterm I. Introduction to Artificial Intelligence. CS 188 Fall You have approximately 3 hours.

Announcements. CS 188: Artificial Intelligence Fall 2010

CSE 573: Artificial Intelligence

CSE 473: Artificial Intelligence

CS 188: Artificial Intelligence Fall 2011

1. (15 points) Consider the crossword puzzle

The exam is closed book, closed calculator, and closed notes except your one-page crib sheet.

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

CS 4100 // artificial intelligence

CS 188: Artificial Intelligence. Recap Search I

CS 343: Artificial Intelligence

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

CS188 Spring 2010 Section 2: CSP s

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

CS 343: Artificial Intelligence

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

CS 188: Artificial Intelligence. Recap: Search

Constraint Satisfaction Problems

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

CSCI 446: Artificial Intelligence

Artificial Intelligence Informed Search

Constraint Satisfaction Problems

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

Introduction to AI Spring 2006 Dan Klein Midterm Solutions

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

Introduction to Fall 2014 Artificial Intelligence Midterm Solutions

Introduction to Fall 2010 Artificial Intelligence Midterm Exam

Introduction to Fall 2008 Artificial Intelligence Midterm Exam

521495A: Artificial Intelligence

Constraint Satisfaction Problems (CSPs)

CS 188: Artificial Intelligence Fall 2008

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

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

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

CS 188: Artificial Intelligence Fall 2008

CS 188: Artificial Intelligence

Constraint Satisfaction Problems

Week 8: Constraint Satisfaction Problems

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

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

CS 188: Artificial Intelligence Spring Announcements

CS 5522: Artificial Intelligence II

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

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

Informed Search A* Algorithm

Constraint Satisfaction Problems Part 2

(Due to rounding, values below may be only approximate estimates.) We will supply these numbers as they become available.

Today. Informed Search. Graph Search. Heuristics Greedy Search A* Search

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

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

ARTIFICIAL INTELLIGENCE (CS 370D)

CS 188: Artificial Intelligence Fall 2011

Informed Search Lecture 5

Grad AI Fall, 2007 Homework 1

CS 188: Artificial Intelligence

Constraint Satisfaction

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

CS 188: Artificial Intelligence Spring Today

Constraint Satisfaction Problems. Chapter 6

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

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

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

CS 188: Artificial Intelligence Spring Announcements

Artificial Intelligence

Artificial Intelligence

Outline. Informed Search. Recall: Uninformed Search. An Idea. Heuristics Informed search techniques More on heuristics Iterative improvement

CS 343H: Artificial Intelligence

CS 730/730W/830: Intro AI

CS188: Artificial Intelligence, Fall 2008

CS 771 Artificial Intelligence. Constraint Satisfaction Problem

CSCI 204 Introduction to Computer Science II

Constraint Satisfaction Problems

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

CS W4701 Artificial Intelligence

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

Constraint Satisfaction Problems. Chapter 6

CS 188: Artificial Intelligence

Constraint Satisfaction Problems

Lecture 6: Constraint Satisfaction Problems (CSPs)

15-780: Graduate AI Homework Assignment #2 Solutions

CS 188: Artificial Intelligence

Name: UW CSE 473 Midterm, Fall 2014

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

4 Search Problem formulation (23 points)

CS 188 Introduction to Artificial Intelligence Fall 2018 Note 1

CPS 170: Artificial Intelligence Search

Local Search Methods. CS 188: Artificial Intelligence Fall Announcements. Hill Climbing. Hill Climbing Diagram. Today

Search : Lecture 2. September 9, 2003

Constraint satisfaction search. Combinatorial optimization search.

PAC-MAN is one of the most popular game

Q1. [11 pts] Foodie Pacman

Introduction to Artificial Intelligence Midterm 1. CS 188 Spring You have approximately 2 hours.

Constraint Satisfaction Problems

Recap: Search Problem. CSE 473: Artificial Intelligence. Space of Search Strategies. Constraint Satisfaction. Example: N-Queens 4/9/2012

Announcements. CS 188: Artificial Intelligence Fall Robot motion planning! Today. Robotics Tasks. Mobile Robots

CS 188: Artificial Intelligence Fall Announcements

Artificial Intelligence Constraint Satisfaction Problems

Foundations of Artificial Intelligence

ˆ The exam is closed book, closed calculator, and closed notes except your one-page crib sheet.

Transcription:

CS88 Fall 08 Section : Graph Search + CSPs Search and Heuristics Imagine a car-like agent wishes to exit a maze like the one shown below: The agent is directional and at all times faces some direction d (N, S, E, W ). With a single action, the agent can either move forward at an adjustable velocity v or turn. The turning actions are left and right, which change the agent s direction by 90 degrees. Turning is only permitted when the velocity is zero (and leaves it at zero). The moving actions are fast and slow. Fast increments the velocity by and slow decrements the velocity by ; in both cases the agent then moves a number of squares equal to its NEW adjusted velocity. Any action that would result in a collision with a wall crashes the agent and is illegal. Any action that would reduce v below 0 or above a maximum speed V max is also illegal. The agent s goal is to find a plan which parks it (stationary) on the exit square using as few actions (time steps) as possible. As an example: if the agent shown were initially stationary, it might first turn to the east using (right), then move one square east using fast, then two more squares east using fast again. The agent will of course have to slow to turn.. If the grid is M by N, what is the size of the state space? Justify your answer. You should assume that all configurations are reachable from the start state. The size of the state space is 4MN(V max + ). The state representation is (direction facing, x, y, speed). Note that the speed can take any value in {0,..., V max }.. Is the Manhattan distance from the agent s location to the exit s location admissible? Why or why not? No, Manhattan distance is not an admissible heuristic. The agent can move at an average speed of greater than (by first speeding up to V max and then slowing down to 0 as it reaches the goal), and so can reach the goal in less time steps than there are squares between it and the goal. A specific example: the target is 6 squares away, and the agent s velocity is already 4. By taking only 4 slow actions, it reaches the goal with a velocity of 0.. State and justify a non-trivial admissible heuristic for this problem which is not the Manhattan distance to the exit. There are many answers to this question. Here are a few, in order of weakest to strongest: (a) The number of turns required for the agent to face the goal. (b) Consider a relaxation of the problem where there are no walls, the agent can turn and change speed arbitrarily. In this relaxed problem, the agent would move with V max, and then suddenly stop at the goal, thus taking d manhattan /V max time. (c) We can improve the above relaxation by accounting for the deceleration dynamics. In this case the agent will have to slow down to 0 when it is about to reach the goal. Note that this heuristic will always return a greater value than the previous one, but is still not an overestimate of the true cost to reach the goal. We can say that this heuristic dominates the previous one.

4. If we used an inadmissible heuristic in A* graph search, would the search be complete? Would it be optimal? If the heuristic function is bounded, then A* graph search would visit all the nodes eventually, and would find a path to the goal state if there exists one. An inadmissible heuristic does not guarantee optimality as it can make the good optimal goal look as though it is very far off, and take you to a suboptimal goal. 5. If we used an admissible heuristic in A* graph search, is it guaranteed to return an optimal solution? What if the heuristic was consistent? Admissible heuristics do not necessarily guarantee optimality; they are only guaranteed to return an optimal solution if they are consistent as well. 6. Give a general advantage that an inadmissible heuristic might have over an admissible one. The time to solve an A* search problem is a function of two factors: the number of nodes expanded, and the time spent per node. An inadmissible heuristic may be faster to compute, leading to a solution that is obtained faster due to less time spent per node. It can also be a closer estimate to the actual cost function (even though at times it will overestimate!), thus expanding less nodes. We lose the guarantee of optimality by using an inadmissible heuristic. But sometimes we may be okay with finding a suboptimal solution to a search problem.

Course Scheduling You are in charge of scheduling for computer science classes that meet Mondays, Wednesdays and Fridays. There are 5 classes that meet on these days and professors who will be teaching these classes. You are constrained by the fact that each professor can only teach one class at a time. The classes are:. Class - Intro to Programming: meets from 8:00-9:00am. Class - Intro to Artificial Intelligence: meets from 8:0-9:0am. Class - Natural Language Processing: meets from 9:00-0:00am 4. Class 4 - Computer Vision: meets from 9:00-0:00am 5. Class 5 - Machine Learning: meets from 0:0-:0am The professors are:. Professor A, who is qualified to teach Classes,, and 5.. Professor B, who is qualified to teach Classes, 4, and 5.. Professor C, who is qualified to teach Classes,, and 4.. Formulate this problem as a CSP problem in which there is one variable per class, stating the domains (after enforcing unary constraints), and binary constraints. Constraints should be specified formally and precisely, but may be implicit rather than explicit. Variables Domains (or unary constraints) C {A, C} C {A} C {B, C} C 4 {B, C} C 5 {A, B} Binary Constraints C C C C C C 4 C C 4. Draw the constraint graph associated with your CSP. C C C C 4 C 5

(Optional) CSPs: Trapped Pacman Pacman is trapped! He is surrounded by mysterious corridors, each of which leads to either a pit (P), a ghost (G), or an exit (E). In order to escape, he needs to figure out which corridors, if any, lead to an exit and freedom, rather than the certain doom of a pit or a ghost. The one sign of what lies behind the corridors is the wind: a pit produces a strong breeze (S) and an exit produces a weak breeze (W), while a ghost doesn t produce any breeze at all. Unfortuantely, Pacman cannot measure the the strength of the breeze at a specific corridor. Instead, he can stand between two adjacent corridors and feel the max of the two breezes. For example, if he stands between a pit and an exit he will sense a strong (S) breeze, while if he stands between an exit and a ghost, he will sense a weak (W) breeze. The measurements for all intersections are shown in the figure below. Also, while the total number of exits might be zero, one, or more, Pacman knows that two neighboring squares will not both be exits. 6 s s S W 5 S w 4 Pacman models this problem using variables X i for each corridor i and domains P, G, and E.. State the binary and/or unary constraints for this CSP (either implicitly or explicitly). Binary: X = P or X = P, X = E or X = E, Unary: X P, X = E or X 4 = E, X 4 = P or X 5 = P, X P, X 5 = P or X 6 = P, X = P or X 6 = P, X 4 P i, j, Adj(i, j)and (X i = EandX j = E). Cross out the values from the domains of the variables that will be deleted in enforcing arc consistency. X P X G E X G E X 4 G E X 5 P X 6 P G E 4

. According to MRV, which variable or variables could the solver assign first? X or X 5 (tie breaking) 4. Assume that Pacman knows that X 6 = G. List all the solutions of this CSP or write none if no solutions exist. (P,E,G,E,P,G) (P,G,E,G,P,G) The CSP described above has a circular structure with 6 variables. Now consider a CSP forming a circular structure that has n variables (n > ), as shown below. Also assume that the domain of each variable has cardinality d. n 5. Explain precisely how to solve this general class of circle-structured CSPs efficiently (i.e. in time linear in the number of variables), using methods covered in class. Your answer should be at most two sentences. We fix X j for some j and assign it a value from its domain (i.e. use cutset conditioning on one variable). The rest of the CSP now forms a tree structure, which can be efficiently solved without backtracking by enforcing arc consistency. We try all possible values for our selected variable X j until we find a solution. 6. If standard backtracking search were run on a circle-structured graph, enforcing arc consistency at every step, what, if anything, can be said about the worst-case backtracking behavior (e.g. number of times the search could backtrack)? A tree structured CSP can be solved without any backtracking. Thus, the above circle-structured CSP can be solved after backtracking at most d times, since we might have to try up to d values for X j before finding a solution. 5