Introduction to Artificial Intelligence Class 1 Planning & Search Henry Kautz Winter 2007.

Slides:



Advertisements
Similar presentations
Review: Search problem formulation
Advertisements

Finding Search Heuristics Henry Kautz. if State[node] is not in closed OR g[node] < g[LookUp(State[node],closed)] then A* Graph Search for Any Admissible.
October 1, 2012Introduction to Artificial Intelligence Lecture 8: Search in State Spaces II 1 A General Backtracking Algorithm Let us say that we can formulate.
1 Heuristic Search Chapter 4. 2 Outline Heuristic function Greedy Best-first search Admissible heuristic and A* Properties of A* Algorithm IDA*
5-1 Chapter 5 Tree Searching Strategies. 5-2 Satisfiability problem Tree representation of 8 assignments. If there are n variables x 1, x 2, …,x n, then.
AI – Week 5 Implementing your own AI Planner in Prolog – part II : HEURISTICS Lee McCluskey, room 2/09
CSC 423 ARTIFICIAL INTELLIGENCE
CS171 Introduction to Computer Science II Graphs Strike Back.
CSC 282: Design & Analysis of Efficient Algorithms Graph Algorithms Shortest Path Algorithms Fall 2013.
Heuristic State Space Seach Henry Kautz. Assignment.
More on A*; Preview of Logic; Local Search Henry Kautz.
Planning CSE 473 Chapters 10.3 and 11. © D. Weld, D. Fox 2 Planning Given a logical description of the initial situation, a logical description of the.
State Space Search Algorithms CSE 472 Introduction to Artificial Intelligence Autumn 2003.
CPSC 322 Introduction to Artificial Intelligence October 27, 2004.
Review: Search problem formulation
Introduction to Artificial Intelligence A* Search Ruth Bergman Fall 2002.
Informed Search (no corresponding text chapter). Recall: Wanted " An algorithm and associated data structure(s) that can: 1) Solve an arbitrary 8-puzzle.
Using Search in Problem Solving
Introduction to Artificial Intelligence Agents Henry Kautz.
Uninformed Search Reading: Chapter 3 by today, Chapter by Wednesday, 9/12 Homework #2 will be given out on Wednesday DID YOU TURN IN YOUR SURVEY?
Lecture 3 Informed Search CSE 573 Artificial Intelligence I Henry Kautz Fall 2001.
Planning II CSE 473. © Daniel S. Weld 2 Logistics Tournament! PS3 – later today Non programming exercises Programming component: (mini project) SPAM detection.
Using Search in Problem Solving
Class of 28 th August. Announcements Lisp assignment deadline extended (will take it until 6 th September (Thursday). In class. Rao away on 11 th and.
Planning II CSE 573. © Daniel S. Weld 2 Logistics Reading for Wed Ch 18 thru 18.3 Office Hours No Office Hour Today.
State-Space Searches. 2 State spaces A state space consists of –A (possibly infinite) set of states The start state represents the initial problem Each.
State-Space Searches.
Informed Search Idea: be smart about what paths to try.
Dijkstra’s Algorithm and Heuristic Graph Search David Johnson.
Graphs II Robin Burke GAM 376. Admin Skip the Lua topic.
Search: Heuristic &Optimal Artificial Intelligence CMSC January 16, 2003.
Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:
Introduction to search Chapter 3. Why study search? §Search is a basis for all AI l search proposed as the basis of intelligence l inference l all learning.
How are things going? Core AI Problem Mobile robot path planning: identifying a trajectory that, when executed, will enable the robot to reach the goal.
Today’s Topics FREE Code that will Write Your PhD Thesis, a Best-Selling Novel, or Your Next Methods for Intelligently/Efficiently Searching a Space.
Informed (Heuristic) Search
State-Space Searches. 2 State spaces A state space consists of A (possibly infinite) set of states The start state represents the initial problem Each.
Informed search strategies Idea: give the algorithm “hints” about the desirability of different states – Use an evaluation function to rank nodes and select.
Informed Search Strategies Lecture # 8 & 9. Outline 2 Best-first search Greedy best-first search A * search Heuristics.
For Friday Finish reading chapter 4 Homework: –Lisp handout 4.
For Monday Read chapter 4, section 1 No homework..
Search with Costs and Heuristic Search 1 CPSC 322 – Search 3 January 17, 2011 Textbook §3.5.3, Taught by: Mike Chiang.
CS344: Introduction to Artificial Intelligence (associated lab: CS386)
Review: Tree search Initialize the frontier using the starting state While the frontier is not empty – Choose a frontier node to expand according to search.
Search CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
Advanced Artificial Intelligence Lecture 2: Search.
CS621: Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 3 - Search.
Search (continued) CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
Informed Search Reading: Chapter 4.5 HW #1 out today, due Sept 26th.
Informed Search and Heuristics Chapter 3.5~7. Outline Best-first search Greedy best-first search A * search Heuristics.
Graph Algorithms GAM 376 Robin Burke Fall Outline Graphs Theory Data structures Graph search Algorithms DFS BFS Project #1 Soccer Break Lab.
Informed Search CSE 473 University of Washington.
Search Techniques CS480/580 Fall Introduction Trees: – Root, parent, child, sibling, leaf node, node, edge – Single path from root to any node Graphs:
Searching for Solutions
CE 473: Artificial Intelligence Autumn 2011 A* Search Luke Zettlemoyer Based on slides from Dan Klein Multiple slides from Stuart Russell or Andrew Moore.
CSE 326: Data Structures Lecture #17 Heuristic Graph Search Henry Kautz Winter Quarter 2002.
Chapter 3 Solving problems by searching. Search We will consider the problem of designing goal-based agents in observable, deterministic, discrete, known.
Heuristic Search A heuristic is a rule for choosing a branch in a state space search that will most likely lead to a problem solution Heuristics are used.
Heuristic Search Introduction to Artificial Intelligence
Heuristic Search Henry Kautz.
CSE P573 Introduction to Artificial Intelligence Class 1 Planning & Search INTRODUCE MYSELF Relative new faculty member, but 20 years in AI research.
Informed search algorithms
HW 1: Warmup Missionaries and Cannibals
Informed Search Idea: be smart about what paths to try.
State-Space Searches.
State-Space Searches.
HW 1: Warmup Missionaries and Cannibals
Reading: Chapter 4.5 HW#2 out today, due Oct 5th
State-Space Searches.
Informed Search Idea: be smart about what paths to try.
Presentation transcript:

Introduction to Artificial Intelligence Class 1 Planning & Search Henry Kautz Winter 2007

Outline of Course Heuristic search Constraint satisfaction Automated planning Propositional logic First-order logic and logic programming Knowledge engineering Probabilistic reasoning: directed and undirected graphical models Learning graphical models Decision trees and ensemble methods Neural networks

3 Planning Input Description of initial state of world Description of goal state(s) Description of available actions –Optional: Cost for each action Output Sequence of actions that converts the initial state into a goal state May wish to minimize length or cost of plan

Classical Planning Atomic time Deterministic actions Complete knowledge No numeric reward (just goals) Only planner changes world

Route Planning State = intersection Operators = block between intersections Operator cost = length of block

Blocks World Control a robot arm that can pick up and stack blocks. Arm can hold exactly one block Blocks can either be on the table, or on top of exactly one other block State = configuration of blocks { (on-table G), (on B G), (clear B), (holding R) } Operator = pick up or put down a block (put-down R)put on table (stack R B)put on another block

State Space pick-up(R) pick-up(G) stack(R,B) put-down(R) stack(G,R) Planning = Finding (shortest) paths in state graph

STRIPS Representation (define (domain prodigy-bw) (:requirements :strips) (:predicates (on ?x ?y) (on-table ?x) (clear ?x) (arm-empty) (holding ?x))

Problem Instance (define (problem bw-sussman) (:domain prodigy-bw) (:objects A B C) (:init (on-table a) (on-table b) (on c a) (clear b) (clear c) (arm-empty)) (:goal (and (on a b) (on b c)))) goal may be a partial description

Operator Schemas (:action stack :parameters (?obj ?under_obj) :precondition (and (holding ?obj) (clear ?under_obj)) :effect (and (not (holding ?obj)) (not (clear ?under_obj)) (clear ?obj) (arm-empty) (on ?obj ?under_obj))) delete effects – make false add effects – make true

Blocks World Blackbox Planner Demo

Search Algorithms Today: Space-State Search Depth-First Breadth-First Best-First A* Next Class: Local Search Constraint Satisfaction

A General Search Algorithm Search( Start, Goal_test, Criteria ) Open = { Start }; Closed = { }; repeat if (empty(Open)) return fail; select Node from Open using Criteria; if (Goal_test(Node)) return Node; for each Child of node do if (Child not in Closed) Open = Open U { Child }; Closed = Closed U { Node }; Closed list optional

Breadth-First Search Search( Start, Goal_test, Criteria ) Open: fifo_queue; Closed: hash_table; enqueue(Start, Open); repeat if (empty(Open)) return fail; Node = dequeue(Open); if (Goal_test(Node)) return Node; for each Child of node do if (not find(Child, Closed)) enqueue(Child, Open) insert(Child, Closed) Criteria = shortest distance from Start

Depth-First Search Search( Start, Goal_test, Criteria ) Open: stack; Closed: hash_table; push(Start, Open); repeat if (empty(Open)) return fail; Node = pop(Open); if (Goal_test(Node)) return Node; for each Child of node do if (not find(Child, Closed)) push(Child, Open) insert(Child, Closed) Criteria = longest distance from Start

Best-First Search Search( Start, Goal_test, Criteria ) Open: priority_queue; Closed: hash_table; enqueue(Start, Open, heuristic(Start)); repeat if (empty(Open)) return fail; Node = dequeue(Open); if (Goal_test(Node)) return Node; for each Child of node do if (not find(Child, Closed)) enqueue(Child, Open, heuristic(Child)) insert(Child, Closed) Criteria = shortest heuristic estimate of distance to goal

Properties Depth First Simple implementation (stack) Might not terminate Might find non-optimal solution Breadth First Always terminates if solution exists Finds optimal solutions Visits many nodes Best First Always terminates if heuristic is “reasonable” Visits many fewer nodes May find non-optimal solution

Best-First with Manhattan Distance (  x+  y) Heuristic 52 nd St 51 st St 50 th St 10 th Ave 9 th Ave 8 th Ave 7 th Ave6 th Ave5 th Ave4 th Ave 3 rd Ave 2 nd Ave S G 53 nd St

Non-Optimality of Best-First 52 nd St 51 st St 50 th St 10 th Ave 9 th Ave 8 th Ave 7 th Ave6 th Ave5 th Ave4 th Ave 3 rd Ave 2 nd Ave SG 53 nd St

A* Criteria: minimize (distance from start) + (estimated distance to goal) Implementation: priority queue f(n) = g(n) + h(n) f(n) = priority of a node g(n) = true distance from start h(n) = heuristic distance to goal

Optimality of A* Suppose the estimated distance is always less than or equal to the true distance to the goal heuristic is a lower bound heuristic is admissible Then: when the goal is removed from the priority queue, we are guaranteed to have found a shortest path!

Maze Runner Demo

Observations on A* Perfect heuristic: If h(n) = h*(n) (true distance) for all n, then only the nodes on the optimal solution path will be expanded. Null heuristic: If h(n) = 0 for all n, then this is an admissible heuristic and A* acts like breath-first search. Comparing heuristics: If h1(n)  h2(n)  h*(n) for all non-goal nodes, then h2 is as least as good a heuristic as h1 Every node expanded by A* using h2 is also expanded by A* using h1 if h1(n)<h1(n) for some n, then h2 is stronger than h1 Combining heuristics: if h1(n) and h2(n) are admissible, then h3(n) = MAX(h1(n),h2(n)) is admissible Why?

Search Heuristics “Optimistic guess” at distance to a solution Some heuristics are domain specific Manhattan distance for grid-like graphs Euclidean distance for general road maps Rubik’s Cube –Admissible, but weak: # cubits out of place / 8 –Better: MAX( Sum( Manhattan distance edge cubits )/4, Sum( Manhattan distance corner cubits )/4 )

Planning Heuristics A useful non-admissible heuristic for planning is the number of goals that need to be achieved Why not admissible? Good admissible heuristics for planning can be created by relaxing the operators, e.g.: Eliminate preconditions, or Eliminate negative preconditions & effects Use the length of the solution to the relaxed problem as a heuristic for the length of the solution to the original problem

Homework Shakey the robot has to bring coffee to Prof. Kautz. In order to make the coffee, Shakey will need to gather coffee filters, coffee, and Prof. Kautz's mug and bring them to the coffee maker in the kitchen. The coffee and filters are in the supply room, but it is locked. To unlock the supply room, Shakey will need to get the key from Prof. Kautz's office. Represent this problem in STRIPS notation What is the true value of the start state? What is the heuristic value of the start start, based on rhe relaxed problem with no preconditions on actions?