Supplemental slides for CSE 327 Prof. Jeff Heflin

Slides:



Advertisements
Similar presentations
Solving problems by searching
Advertisements

Review: Search problem formulation
Traveling Salesperson Problem
Artificial Intelligence Chapter 9 Heuristic Search Biointelligence Lab School of Computer Sci. & Eng. Seoul National University.
1 Heuristic Search Chapter 4. 2 Outline Heuristic function Greedy Best-first search Admissible heuristic and A* Properties of A* Algorithm IDA*
Blind Search1 Solving problems by searching Chapter 3.
Search Strategies CPS4801. Uninformed Search Strategies Uninformed search strategies use only the information available in the problem definition Breadth-first.
Review: Search problem formulation
Informed Search Idea: be smart about what paths to try.
Review: Search problem formulation Initial state Actions Transition model Goal state (or goal test) Path cost What is the optimal solution? What is the.
Ch. 3 – Search Supplemental slides for CSE 327 Prof. Jeff Heflin.
Problem Solving by Searching Search Methods : informed (Heuristic) search.
Informed search strategies Idea: give the algorithm “hints” about the desirability of different states – Use an evaluation function to rank nodes and select.
For Friday Finish reading chapter 4 Homework: –Lisp handout 4.
For Monday Read chapter 4, section 1 No homework..
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.
Supplemental slides for CSE 327 Prof. Jeff Heflin
CS621: Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 3 - Search.
Goal-based Problem Solving Goal formation Based upon the current situation and performance measures. Result is moving into a desirable state (goal state).
Ch. 3 – Search Supplemental slides for CSE 327 Prof. Jeff Heflin.
Heuristic Functions. A Heuristic is a function that, when applied to a state, returns a number that is an estimate of the merit of the state, with respect.
Ch. 3 – Search Supplemental slides for CSE 327 Prof. Jeff Heflin.
Ch. 4 – Informed Search Supplemental slides for CSE 327 Prof. Jeff Heflin.
G5AIAI Introduction to AI Graham Kendall Heuristic Searches.
CS621: Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 3: Search, A*
For Monday Read chapter 4 exercise 1 No homework.
Chapter 3 Solving problems by searching. Search We will consider the problem of designing goal-based agents in observable, deterministic, discrete, known.
Solving problems by searching Chapter 3. Types of agents Reflex agent Consider how the world IS Choose action based on current percept Do not consider.
Lecture 3: Uninformed Search
Review: Tree search Initialize the frontier using the starting state
Solving problems by searching
Last time: Problem-Solving
Heuristic Functions.
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.
Informed Search and Exploration
Artificial Intelligence (CS 370D)
Artificial Intelligence Problem solving by searching CSC 361
HW #1 Due 29/9/2008 Write Java Applet to solve Goats and Cabbage “Missionaries and cannibals” problem with the following search algorithms: Breadth first.
Artificial Intelligence
Discussion on Greedy Search and A*
Discussion on Greedy Search and A*
Solving problems by searching
Lecture 1B: Search.
CS 4100 Artificial Intelligence
Searching for Solutions
Week 4 Jan 29th 2016.
Informed search algorithms
Informed search algorithms
Depth-First Searches Introduction to AI.
BEST FIRST SEARCH -OR Graph -A* Search -Agenda Search CSE 402
G5BAIM Artificial Intelligence Methods
Artificial Intelligence Chapter 9 Heuristic Search
Warm-up: DFS Graph Search
(1) Breadth-First Search  S Queue S
CSE 473 University of Washington
CPSC 322 Introduction to Artificial Intelligence
Chap 4: Searching Techniques
HW 1: Warmup Missionaries and Cannibals
Informed Search Idea: be smart about what paths to try.
Supplemental slides for CSE 327 Prof. Jeff Heflin
HW 1: Warmup Missionaries and Cannibals
CS621: Artificial Intelligence
Midterm Review.
Reading: Chapter 4.5 HW#2 out today, due Oct 5th
Artificial Intelligence: Theory and Practice Ch. 3. Search
Informed Search Idea: be smart about what paths to try.
Informed Search.
Depth-First Searches.
Presentation transcript:

Supplemental slides for CSE 327 Prof. Jeff Heflin Ch. 3 – Search Supplemental slides for CSE 327 Prof. Jeff Heflin

8-Puzzle Transition Model 7 2 4 5 6 8 3 1 state s actions a blank-right blank-left blank-up blank-down 7 2 4 5 6 8 3 1 7 2 4 5 6 8 3 1 7 4 5 2 6 8 3 1 7 2 4 5 3 6 8 1 RESULT(s,a)

8-puzzle Search Tree initial state 7 2 4 5 8 6 3 1 7 2 4 8 6 5 3 1 7 2

Tree Search Algorithm function Tree-Search(problem) returns a solution, or failure initialize the frontier using the initial state of problem loop do if the frontier is empty then return failure choose a leaf node and remove it from the frontier if the node contains a goal state then return the corresponding solution expand the chosen node, adding the resulting nodes to the frontier From Figure 3.7, p. 77

Repeated States A B C A C A B G B C A B G initial state goal state State space Search tree A B A C G B C initial state goal state A C A B G B C A B G

Graph Search Algorithm function Graph-Search(problem) returns a solution, or failure initialize the frontier using the initial state of problem initialize the explored set to be empty loop do if the frontier is empty then return failure choose a leaf node and remove it from the frontier if the node contains a goal state then return the corresponding solution add the node to the explored set expand the chosen node, adding the resulting nodes to the frontier, but only if not in the frontier or explored set From Figure 3.7, p. 77

Depth-first Search A not generated on frontier B C in memory deleted D 1 A not generated on frontier 2 7 B C in memory deleted 3 6 8 9 D E F G blue = in memory, green = on frontier, red = out of memory, clear = not generated 4 5 H I

Breadth-first Search A not generated on frontier B C in memory deleted 1 A not generated on frontier 2 3 B C in memory deleted 4 5 6 7 D E F G 8 9 H I

Uniform Cost Search I B G not generated on frontier C G in memory State space Search tree 1 10 I G I g(n)=0 4 B 5 2 3 C B g(n)=4 G g(n)=10 not generated 4 on frontier 3 C G g(n)=7 g(n)=9 in memory deleted

Uninformed Search Summary depth-first breadth-first uniform cost queuing add to front (LIFO) add to back (FIFO) by path cost complete? no yes yes, if all step costs are greater than 0 optimal? yes, if identical step costs time expensive space modest

A* Example n’s state h(n) A g B 5 C 7 D 8 E 1 F G D 9 3 B 4 2 5 G A E D 9 3 B 4 2 5 G A E 5 6 2 F C Have already expanded the same state. No need to calculate f(n) 1 A g(n)=0, h(n)=6, f(n)=0+6=6 3 B 4 D E Lower cost node is on frontier 2 f=2+5=7 f=3+8=11 f= 5 +1=6 E 5* G B C f=12+0=12 f= 9+5=14 f=10+7=17

Heuristics in A* Use A* to solve the 8-puzzle: initial state: goal state: 1 2 3 4 6 8 7 5 1 2 3 4 5 6 7 8 path cost is the total number of moves made Consider these heuristics H1: The number of tiles out of place H2: Sum of distances of tiles from goal positions Ignore moves that return you to the previous state

A* on 8-puzzle Heuristic = H1 1 f=0+3=3 2 f=1+3=4 3 f=1+3=4 f=2+3=5 6 8 7 5 Heuristic = H1 2 1 2 3 4 6 8 7 5 f=1+3=4 3 1 2 3 4 6 7 5 8 f=1+3=4 1 2 3 4 8 7 6 5 f=2+3=5 1 2 3 4 6 8 7 5 f=2+4=6 4 1 2 3 4 6 7 5 8 f=2+2=4 1 2 4 6 3 7 5 8 f=2+4=6 Whether or not this node is expanded depends on how you break ties. It could be expanded at any time or not at all. 1 3 4 2 6 7 5 8 f=3+3=6 1 2 3 4 6 7 5 8 f=3+3=6 5 1 2 3 4 5 6 7 8 f=3+1=4 The notation f=x+y=z is used to show the f(n) calculation for each node, where f=f(n)=z, x=g(n), y=h(n). 1 2 3 4 5 6 7 8 f=4+2=6 6 1 2 3 4 5 6 7 8 f=4+0=4

A* on 8-puzzle Heuristic = H2 1 f=0+4=4 f=1+5=6 2 f=1+3=4 3 f=2+2=4 7 5 Heuristic = H2 1 2 3 4 6 8 7 5 f=1+5=6 2 1 2 3 4 6 7 5 8 f=1+3=4 3 1 2 3 4 6 7 5 8 f=2+2=4 1 2 4 6 3 7 5 8 f=2+4=6 1 3 4 2 6 7 5 8 f=3+3=6 1 2 3 4 6 7 5 8 f=3+3=6 4 1 2 3 4 5 6 7 8 f=3+1=4 1 2 3 4 5 6 7 8 f=4+2=6 5 1 2 3 4 5 6 7 8 f=4+0=4

Summary of Search Algorithms type ordering optimal? complete? efficient? depth-first uninformed LIFO no if lucky breadth-first FIFO yesa yes uniform cost g(n) yesb greedy informed h(n) usually A* g(n)+h(n) yesc a – if step costs are identical b – if step costs > 0 c – if heuristic is admissible and consistent