(1) Breadth-First Search  S Queue S

Slides:



Advertisements
Similar presentations
BEST FIRST SEARCH - BeFS
Advertisements

Review: Search problem formulation
Greedy best-first search Use the heuristic function to rank the nodes Search strategy –Expand node with lowest h-value Greedily trying to find the least-cost.
Traveling Salesperson Problem
Uniform Cost Search Introduction to AI. Uniform cost search A breadth-first search finds the shallowest goal state and will therefore be the cheapest.
Artificial Intelligence (CS 461D)
Review: Search problem formulation
Problem Solving and Search in AI Heuristic Search
Informed Search Idea: be smart about what paths to try.
CS344: Introduction to Artificial Intelligence (associated lab: CS386) Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 5: Monotonicity 13 th Jan, 2011.
Heuristic Search In addition to depth-first search, breadth-first search, bound depth-first search, and iterative deepening, we can also use informed or.
Exact methods for ALB ALB problem can be considered as a shortest path problem The complete graph need not be developed since one can stop as soon as in.
Problem Solving by Searching Search Methods : 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 Methods. Informed Search  Uninformed searches  easy  but very inefficient in most cases of huge search tree  Informed searches  uses.
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.
Informed Search I (Beginning of AIMA Chapter 4.1)
Basic Search Procedure 1. Start with the start node (root of the search tree) and place in on the queue 2. Remove the front node in the queue and If the.
CS621: Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 3 - Search.
Informed Search CSE 473 University of Washington.
Heuristic Search Foundations of Artificial Intelligence.
For Monday Read chapter 4 exercise 1 No homework.
Romania. Romania Problem Initial state: Arad Goal state: Bucharest Operators: From any node, you can visit any connected node. Operator cost, the.
Chapter 3 Solving problems by searching. Search We will consider the problem of designing goal-based agents in observable, deterministic, discrete, known.
Chapter 3.5 Heuristic Search. Learning Objectives Heuristic search strategies –Best-first search –A* algorithm Heuristic functions.
Lecture 3: Uninformed Search
Review: Tree search Initialize the frontier using the starting state
Traveling Salesperson Problem
Problem Solving Agents
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.
Department of Computer Science
G5AIAI – Introduction to AI
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.
Motion Planning for a Point Robot (2/2)
Lecture 1B: Search.
Searching for Solutions
Breadth-First Searches
CS Fall 2016 (Shavlik©), Lecture 10, Week 6
Depth-First Searches Introduction to AI.
Artificial Intelligence
Introduction to Artificial Intelligence Lecture 9: Two-Player Games I
BEST FIRST SEARCH -OR Graph -A* Search -Agenda Search CSE 402
CS621: Artificial Intelligence
CSE 473 University of Washington
Heuristic Search Methods
Introducing Underestimates
Chap 4: Searching Techniques
HW 1: Warmup Missionaries and Cannibals
More advanced aspects of search
Informed Search Idea: be smart about what paths to try.
State-Space Searches.
State-Space Searches.
HW 1: Warmup Missionaries and Cannibals
CS621: Artificial Intelligence
Artificial Intelligence
CMSC 471 Fall 2011 Class #4 Tue 9/13/11 Uninformed Search
Reading: Chapter 4.5 HW#2 out today, due Oct 5th
State-Space Searches.
Informed Search Idea: be smart about what paths to try.
Supplemental slides for CSE 327 Prof. Jeff Heflin
Depth-First Searches.
Presentation transcript:

(1) Breadth-First Search  S Queue S We begin with S on the queue. Note that as nodes come off the queue (expanded), their children are placed on the queue. In breadth-first search, the new nodes are always placed at the end of the queue Breadth-First Search

(1) (2) Breadth-First Search  A, F Queue S A F A will be expanded next since it is in front of the queue. Its children are placed at the end of the queue. Breadth-First Search

(1) (2) (3) Breadth-First Search  F, C, F Queue S A F C F Note that S is not listed as a child of A because it was already expanded earlier. Breadth-First Search

 C, F, G, H Queue (1) S (2) (3) A F C F G H Breadth-First Search

(1) (2) (3) (4) Breadth-First Search  F, G, H, D, G Queue S A F C F G

(1) (2) (3) (4) Breadth-First Search  G, H, D, G Queue S A F C F G H Will not expand this because it was already expanded earlier; we can eliminate it from the queue. Breadth-First Search

(1) (2) (3) (4) (5) Breadth-First Search  G, H, D, G Queue S A F C G

(1) (2) (3) (4) (5) S  F  G Breadth-First Search S A C F G H D Since G is expanded (comes off the queue), and it is a goal node, we are done. The solution found by the search algorithm is: S  F  G Breadth-First Search

(1) Depth-First Search  S Queue S Depth-first search works the same way except that the children of a node that is expanded are always placed in front of the queue (so they take priority over nodes that were already on the queue. Depth-First Search

 A, F Queue (1) S (2) A F Depth-First Search

(1) (2) Depth-First Search  C, F2, F1 Queue S A F1 C F2 Note that S is not listed as a child of A because it was already expanded earlier. The subscript for F is only so that we can distinguish between the two instances of F on the queue (but they represent the same F node). Depth-First Search

 D, G, F2, F1 Queue (1) S (2) A F1 (3) C F2 D G Depth-First Search

(1) (2) (3) (4) Depth-First Search  G, F2, F1 Queue S A F1 C F2 Note that D only has G as a child that has not yet been expanded. We use subscripts again to distinguish between different instance of G on the queue. D (4) G Depth-First Search

(1) (2) (3) (4) Depth-First Search  G2, G1, F2, F1 Queue S A F1 C F2 Note that D only has G as a child that has not yet been expanded. We use subscripts again to distinguish between different instance of G on the queue. D (4) G1 G2 Depth-First Search

(1) (2) (3) (4) S  A  C  D  G (5) Depth-First Search  G1, F2, F1 Queue S A C F2 F1 (2) (1) (3) D G1 (4) G2 (5) Since G comes off the queue and it is a goal node, we stop. The solution found by the algorithm is: S  A  C  D  G Depth-First Search

 A, F Queue (1) S 7 2 F 7 A 2 In uniform const search, the queue is always ordered in the increasing costs (i.e., increasing values of g(n) for each node n). The cost value of a node n is computed as the total cost of getting from the start node S to node n. The g(n) values are shown in black boxes. Uniform Cost Search

 A, F Queue (1) S 7 2 (2) F 7 A 2 Uniform Cost Search

 C, F1, F2 Queue (1) S 7 2 (2) F1 7 A 2 4 8 C 6 F2 10 Note that the queue gets ordered according to costs with lowest cost node in front. So, C is the next node to be expanded. Uniform Cost Search

(1) (2) (3)  F1, D, F2, G Queue S F1 A C F2 D G Uniform Cost Search 7 4 8 (3) C 6 F2 10 5 3 D 9 G 11 Uniform Cost Search

(1) (4) (2) (3)  D, H, F2, G1, G2 Queue S F1 A C F2 G2 H D G1 7 2 (2) (4) F1 7 A 2 4 5 2 8 (3) C 6 F2 10 12 G2 H 9 5 3 D 9 G1 11 Since F has been expanded, we can eliminate other instances of it from the tree and the queue. Uniform Cost Search

(1) (4) (2) (3)  D, H, G1, G2 Queue S F1 A C G2 H D G1 7 2 (2) (4) F1 7 A 2 4 5 2 (3) C 6 12 G2 H 9 5 3 D 9 G1 11 Uniform Cost Search

(1) (4) (2) (3) (5)  H, G1, G2, G3 Queue S F A C G2 H D G1 G3 7 2 (2) (4) F 7 A 2 4 5 2 (3) C 6 12 G2 H 9 5 3 (5) D 9 G1 11 3 G3 12 Uniform Cost Search

(1) (4) (2) (3) (6) (5)  G1, G2, G3 Queue S F A C G2 H D G1 G3 7 2 (2) (4) F 7 A 2 4 5 2 (3) C 6 12 G2 (6) H 9 5 3 (5) D 9 G1 11 3 G3 12 Uniform Cost Search

(1) (4) (2) (3) (6) (5) (7)  G2, G3 Queue S F A C G2 H D G1 G3 12 G2 (6) H 9 5 3 (5) D 9 (7) G1 11 3 G3 12 Uniform Cost Search

(1) (4) (2) (3) (6) (5) (7) S  A  C  G S A C F D G1 G2 H G3 11 9 (4) G2 H 12 (5) G3 (6) (7)  G2, G3 Queue Since G comes off the queue and it is a goal node, we stop. The solution found by the algorithm is: S  A  C  G Total Cost: 2 + 4 + 5 = 11 Uniform Cost Search

 F, A Queue (1) S 5 A F 4 h(n) Greedy Search is similar to uniform cost, but this time, the costs are not considered. Instead the nodes on the queue are ordered in the increasing order of the values of h(n), the heuristic value of node n. The h(n) values are the ones shown in the black boxes. Greedy-Best First Search

 G, H, A Queue (1) S 5 A (2) F 4 G H 2 In this case A is not generated as a child of F because it would not have a smaller h value than the version of A already on the queue. Greedy-Best First Search

(1) (2) S  F  G  G, H, A Queue S A F G H 5 A (2) F 4 G H 2 Since G comes off the queue and it is a goal node, we stop. The solution found by the algorithm is: S  F  G Greedy-Best First Search

 A, F Queue h=10 g=0 S 10 2 7 h=5 g=2 7 A h=4 g=7 11 F A* search combines the uniform cost search and the greedy best-first search. Instead of ordering the queue using g(n) values (as in UCS) or ordering only based on the heuristic h(n) (as in greedy search), we order the nodes for expansion in increasing order of f(n) = g(n)+h(n). A* Search

(1) (2)  C, F, F Queue S A F C F A* Search 10 2 7 7 11 4 8 10 14 h=10 g=0 (1) S 10 2 (2) 7 h=5 g=2 7 A h=4 g=7 11 F 4 8 h=4 g=2+4 h=4 g=2+8 10 C 14 F A* Search

(1) (2) (3)  F(11), G, D, F(14) Queue S A F C F G D A* Search 10 2 7 8 h=4 g=2+4 h=4 g=2+8 10 C 14 F 5 3 h=0 g=11 h=3 g=9 11 G D 12 A* Search

(1) (2) (4) (3)  G(11), H, D, G(12), F Queue S A F C F G H G D 10 2 (2) 7 (4) h=5 g=2 7 A h=4 g=7 11 F 4 (3) 8 5 2 h=4 g=2+4 h=4 g=2+8 10 C 14 F h=0 g=12 h=2 g=9 12 G H 11 5 3 h=0 g=11 h=3 g=9 11 G D 12 At this point we can remove the other F from the queue and the tree (but that is not necessary). Since G come off next, we are done with the search. A* Search

The search returns the path S  A  C  G  H, D, G Queue h=10 g=0 (1) S 10 2 (2) 7 (4) h=5 g=2 7 A h=4 g=7 11 F 4 5 2 (3) h=4 g=2+4 h=0 g=12 h=2 g=9 10 C 12 G H 11 5 3 (5) h=0 g=11 h=3 g=9 11 G D 12 The search returns the path S  A  C  G A* Search

Missionaries and Cannibals

Sliding Tile with A*