Breadth-First Searches

Slides:



Advertisements
Similar presentations
Artificial Intelligent
Advertisements

Heuristics Some further elaborations of the art of heuristics and examples.
State Space 3 Chapter 4 Heuristic Search. Three Algorithms Backtrack Depth First Breadth First All work if we have well-defined: Goal state Start state.
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,
Uniform Cost Search Introduction to AI. Uniform cost search A breadth-first search finds the shallowest goal state and will therefore be the cheapest.
1 Breadth First Search AB F I EH DC G FIFO Queue - front.
Lecture 3 Note: Some slides and/or pictures are adapted from Lecture slides / Books of Dr Zafar Alvi. Text Book - Aritificial Intelligence Illuminated.
Breadth First Search
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.
Using Search in Problem Solving
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.
Review: Search problem formulation Initial state Actions Transition model Goal state (or goal test) Path cost What is the optimal solution? What is the.
3.0 State Space Representation of Problems 3.1 Graphs 3.2 Formulating Search Problems 3.3 The 8-Puzzle as an example 3.4 State Space Representation using.
Tree Searching Breadth First Search Dept First Search.
Search exploring the consequences of possible actions.
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;
Depth-First Searches G5AIAI – Introduction to AI.
Brute Force and Exhaustive Search Brute Force and Exhaustive Search Traveling Salesman Problem Knapsack Problem Assignment Problem Selection Sort and Bubble.
Lecture 3 Problem Solving through search Uninformed Search
GRAPH TRAVERSING BY PROF. UZAIR SALMAN
ARTIFICIAL INTELLIGENCE
Traveling Salesperson Problem
Thinking about Algorithms Abstractly
Breadth First and Depth First
Last time: Problem-Solving
Csc 2720 Instructor: Zhuojun Duan
Introduction to Artificial Intelligence
Iterative Deepening Search
Uninformed Search Chapter 3.4.
Uninformed Search Strategies
G5AIAI – Introduction to AI
Artificial Intelligence (CS 370D)
Breadth-First Searches
Prof. Dechter ICS 270A Winter 2003
Alyce Brady CS 470: Data Structures CS 510: Computer Algorithms
Dijkstra’s Algorithm Run by hand Dijkstra's Algorithm (as stated in slide 68 at on the example.
SOLVING PROBLEMS BY SEARCHING
Iterative Deepening Search
Artificial Intelligence
Searching for Solutions
Analysis & Design of Algorithms (CSCE 321)
Depth-First Searches Introduction to AI.
Tree Searching.
Artificial Intelligence Problem solving by searching CSC 361
Example of A* A (4,0) 4 OPEN: (A4) CLOSED: ().
A General Backtracking Algorithm
G5BAIM Artificial Intelligence Methods
Breadth First Search - A B C D E F G H I front FIFO Queue.
(1) Breadth-First Search  S Queue S
CSE 473 University of Washington
Heuristic Search Methods
Breadth First Search s
CPSC 322 Introduction to Artificial Intelligence
CPSC 322 Introduction to Artificial Intelligence
Tree Searching.
Tree Searching.
Tree Searching.
UNINFORMED SEARCH -BFS -DFS -DFIS - Bidirectional
Breadth First Search s
CMSC 471 Fall 2011 Class #4 Tue 9/13/11 Uninformed Search
Tree Searching Strategies
CS203 Lecture 14.
Lecture 4: Tree Search Strategies
Problem Solving by Searching Search Methods :
Supplemental slides for CSE 327 Prof. Jeff Heflin
Depth-First Searches.
Presentation transcript:

Breadth-First Searches

Breadth-First Search Using a breadth-first strategy we expand the root level first and then we expand all those nodes (i.e. those at level 1) before we expand any nodes at level 2. Or to put it another way, all nodes at level d are expanded before any nodes at level d+1. Function BREADTH-FIRST-SEARCH(problem) returns a solution or failure Return GENERAL-SEARCH(problem,ENQUEUE-AT-END) To illustrate this search pattern we will be using an example node set containing 26 nodes (states). The initial state will be node A, and the goal state is node L. Press space to see the example node set.

Press space to see a BFS of the example node set Initial state A A B C D E F Goal state G H I J K L L M N O P Q R S T U V W X Y Z Press space to see a BFS of the example node set

A A B B C C D D E E F F G G H H I I J J K K L L L L L L M N O P Q R S 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 END of the queue. Press space to continue the search. We begin with our initial state: the node labeled A. Press space to continue Node B is expanded then removed from the queue. The revealed nodes are added to the END of the queue. Press space. We then backtrack to expand node C, and the process continues. Press space The search then moves to the first node in the queue. Press space to continue. A A B B C C D D E E F F G G H H I I J J K K L L L L L L M N O P Node L is located and the search returns a solution. Press space to end. Q R S T U Press space to begin the search Press space to continue the search Press space to continue the search Press space to continue the search Press space to continue the search Press space to continue the search Press space to continue the search Press space to continue the search Press space to continue the search Press space to continue the search Size of Queue: 0 Size of Queue: 10 Size of Queue: 9 Size of Queue: 6 Size of Queue: 8 Size of Queue: 1 Size of Queue: 0 Size of Queue: 7 Size of Queue: 5 Queue: Empty Queue: G, H, I, J, K, L, M, N, O, P Queue: A Queue: I, J, K, L, M, N, O, P, Q, R Queue: L, M, N, O, P, Q, R, S, T, U Queue: Empty Queue: E, F, G, H, I, J, K, L Queue: D, E, F, G, H, I, J Queue: J, K, L, M, N, O, P, Q, R, S Queue: K, L, M, N, O, P, Q, R, S, T Queue: F, G, H, I, J, K, L, M, N Queue: B, C, D, E, F Queue: H, I, J, K, L, M, N, O, P, Q Queue: C, D, E, F, G, H Nodes expanded: 8 Nodes expanded: 9 Nodes expanded: 10 Nodes expanded: 11 Nodes expanded: 7 Nodes expanded: 4 Nodes expanded: 5 Nodes expanded: 3 Nodes expanded: 6 Nodes expanded: 2 Nodes expanded: 0 Nodes expanded: 1 Current Action: Backtracking Current Action: Backtracking Current Action: Expanding Current Action: Current Action: Expanding Current Action: Expanding Current Action: Backtracking Current Action: Backtracking Current Action: Backtracking Current Action: Expanding Current Action: Expanding Current Action: Expanding FINISHED SEARCH Current Action: Backtracking Current Action: Backtracking Current Action: Backtracking Current Action: Backtracking Current Action: Expanding Current Action: Expanding Current Action: Expanding Current Action: Backtracking Current Action: Expanding Current level: 2 Current level: 1 Current level: 0 Current level: 0 Current level: 1 Current level: 1 Current level: 1 Current level: 0 Current level: 0 Current level: 1 Current level: n/a Current level: 0 Current level: 1 Current level: 0 Current level: 1 Current level: 2 Current level: 2 Current level: 1 Current level: 1 Current level: 0 Current level: 1 Current level: 2 Current level: 1 Current level: 1 Current level: 2 Current level: 1 Current level: 2 Current level: 0 BREADTH-FIRST SEARCH PATTERN