Depth-First Searches G5AIAI – Introduction to AI.

Slides:



Advertisements
Similar presentations
Artificial Intelligent
Advertisements

Jecho and Donatus Depth First and Breadth First Search.
Artificial Intelligence By Mr. Ejaz CIIT Sahiwal.
CSM6120 Introduction to Intelligent Systems
Traveling Salesperson Problem
G5AIAI Introduction to AI
Tree Searching. Tree searches A tree search starts at the root and explores nodes from there, looking for a goal node (a node that satisfies certain conditions,
CS 480 Lec 3 Sept 11, 09 Goals: Chapter 3 (uninformed search) project # 1 and # 2 Chapter 4 (heuristic search)
Blind Search1 Solving problems by searching Chapter 3.
CPSC 322, Lecture 5Slide 1 Uninformed Search Computer Science cpsc322, Lecture 5 (Textbook Chpt 3.4) January, 14, 2009.
May 12, 2013Problem Solving - Search Symbolic AI: Problem Solving E. Trentin, DIISM.
Uniform Cost Search Introduction to AI. Uniform cost search A breadth-first search finds the shallowest goal state and will therefore be the cheapest.
SEARCH TECHNIQUES.
Lecture 3 Note: Some slides and/or pictures are adapted from Lecture slides / Books of Dr Zafar Alvi. Text Book - Aritificial Intelligence Illuminated.
State Space Search 2 Chapter 3 Three Algorithms. Backtracking Suppose We are searching depth-first No further progress is possible (i.e., we can only.
SE Last time: Problem-Solving Problem solving: Goal formulation Problem formulation (states, operators) Search for solution Problem formulation:
Breadth-First Searches Introduction to AI. Breadth-First Search Using a breadth-first strategy we expand the root level first and then we expand all those.
Toy Problem: Missionaries and Cannibals
17-Jun-15 Searching in BeeperHunt (Mostly minor variations on old slides)
Artificial Intelligence Problem solving by searching CSC 361 Prof. Mohamed Batouche Computer Science Department CCIS – King Saud University Riyadh, Saudi.
Iterative Deepening Search Introduction to AI. Iterative deepening search The problem with depth-limited search is deciding on a suitable depth parameter.
Artificial Intelligence Methods Rao Vemuri Searching - 2.
For Friday Finish chapter 3 Homework: –Chapter 3, exercise 6 –May be done in groups. –Clarification on part d: an “action” must be running the program.
Artificial Intelligence Course outline Introduction Problem solving Generic algorithms Knowledge Representation and Reasoning Expert Systems Uncertainty.
Review: Search problem formulation Initial state Actions Transition model Goal state (or goal test) Path cost What is the optimal solution? What is the.
Busby, Dodge, Fleming, and Negrusa. Backtracking Algorithm Is used to solve problems for which a sequence of objects is to be selected from a set such.
Tree Searching Breadth First Search Dept First Search.
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.
Trees – Part 2 CS 367 – Introduction to Data Structures.
Artificial Intelligence Search Problem. Search is a problem-solving technique to explores successive stages in problem-solving process.
Search exploring the consequences of possible actions.
G5BAIM Artificial Intelligence Methods Graham Kendall Searching.
For Friday Read chapter 4, sections 1 and 2 Homework –Chapter 3, exercise 7 –May be done in groups.
Introduction to Artificial Intelligence (G51IAI) Dr Rong Qu Blind Searches.
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.
1 Solving problems by searching Chapter 3. Depth First Search Expand deepest unexpanded node The root is examined first; then the left child of the root;
Goal-based Problem Solving Goal formation Based upon the current situation and performance measures. Result is moving into a desirable state (goal state).
Solving problems by searching 1. Outline Problem formulation Example problems Basic search algorithms 2.
Breadth First Search and Depth First Search. Greatest problem in Computer Science Has lead to a lot of new ideas and data structures Search engines before.
Ch. 3 – Search Supplemental slides for CSE 327 Prof. Jeff Heflin.
Artificial Intelligence Search Problem. Search is a problem-solving technique to explores successive stages in problem- solving process.
G5AIAI Introduction to AI Graham Kendall Heuristic Searches.
Source: David Lee Matuszek
Best-first search is a search algorithm which explores a graph by expanding the most promising node chosen according to a specified rule.
SEARCH TECHNIQUES. SEARCH TECHNIQUES Search techniques BlindHeuristic Depth first Search ( DFS ) Breadth first Search ( BFS ) Hill climbing Search A*
Chapter 3 Solving problems by searching. Search We will consider the problem of designing goal-based agents in observable, deterministic, discrete, known.
Lecture 3 Problem Solving through search Uninformed Search
Traveling Salesperson Problem
Last time: Problem-Solving
Iterative Deepening Search
G5AIAI – Introduction to AI
Breadth-First Searches
Prof. Dechter ICS 270A Winter 2003
SOLVING PROBLEMS BY SEARCHING
What to do when you don’t know anything know nothing
Iterative Deepening Search
Artificial Intelligence
Searching for Solutions
Breadth-First Searches
Depth-First Searches Introduction to AI.
Tree Searching.
Artificial Intelligence Problem solving by searching CSC 361
G5BAIM Artificial Intelligence Methods
(1) Breadth-First Search  S Queue S
Tree Searching.
Tree Searching.
Tree Searching.
Problem Solving by Searching Search Methods :
Supplemental slides for CSE 327 Prof. Jeff Heflin
Depth-First Searches.
Presentation transcript:

Depth-First Searches G5AIAI – Introduction to AI

Depth-First Search Depth first search explores one branch of a tree before it starts to explore another branch. It can be implemented by adding newly expanded nodes at the front of the queue. Using the general search algorithm we can implement it as follows: Function DEPTH-FIRST-SEARCH(problem) returns a solution or failure Return GENERAL-SEARCH(problem,ENQUEUE-AT-FRONT) The following slide illustrates a depth-first search of 26 nodes (states) with an initial state of node A and a goal state of node L. Press space to see the example node set.

A CDEFB GHIJKLMNOP QRSTUVWXYZ The example node set Initial state Goal state A L Press space to see a DFS of the example node set

A CDEFB GHIJKL QRSTU A B G Q H R C I S J T D K U LLLLL We begin with our initial state: the node labeled A. Press space to continue This node is then expanded to reveal further (unexpanded) nodes. Press space. Node A is removed from the queue. Each revealed node is added to the FRONT of the queue. Press space to continue. The search then moves to the first node in the queue. Press space to continue Node B is expanded and removed from the queue. Revealed nodes are added to the FRONT of the queue. Press space. Size of Queue: 0 Nodes expanded: 0Current Action:Current level: n/a Queue: EmptyQueue: ASize of Queue: 1 Current level: 0Nodes expanded: 1 Queue: B, C, D, E, F Current Action: ExpandingCurrent level: 1 Queue: G, H, C, D, E, FSize of Queue: 5Size of Queue: 6 Nodes expanded: 2Current level: 2Nodes expanded: 3 Queue: Q, H, C, D, E, FSize of Queue: 5 Nodes expanded: 4 Queue: H, C, D, E, F Current level: 3Current Action: BacktrackingCurrent level: 2Current level: 1Current level: 2Current Action: Expanding Queue: R, C, D, E, F Nodes expanded: 5 Queue: C, D, E, FSize of Queue: 4 Nodes expanded: 6Current level: 3Current Action: BacktrackingCurrent level: 2Current level: 1Current level: 0Current Action: Expanding Queue: I, J, D, E, FSize of Queue: 5 Nodes expanded: 7Current level: 1 Queue: S, J, D, E, F Nodes expanded: 8Current level: 2 Queue: J, D, E, FSize of Queue: 4 Nodes expanded: 9Current level: 3Current Action: BacktrackingCurrent level: 2Current level: 1Current Action: Expanding Queue: T, D, E, F Nodes expanded: 10Current level: 2 Queue: D, E, FSize of Queue: 3 Nodes expanded: 11Current level: 3Current Action: BacktrackingCurrent level: 2Current level: 1Current level: 0Current Action: Expanding Queue: K, L, E, FSize of Queue: 4 Nodes expanded: 12Current level: 1 Queue: U, L, E, F Nodes expanded: 13Current level: 2 Queue: L, E, FSize of Queue: 3 Nodes expanded: 14Current level: 3Current Action: BacktrackingCurrent level: 2Current level: 1 Size of Queue: 0Queue: Empty FINISHED SEARCHCurrent level: 2 Node L is located and the search returns a solution. Press space to end. Press space to begin the search DEPTH-FIRST SEARCH PATTERN The process now continues until the goal state is achieved. Press space. Press space to continue the search LL