Quiz 4-26-’07 Search.

Slides:



Advertisements
Similar presentations
BEST FIRST SEARCH - BeFS
Advertisements

Solving problems by searching
Informed search algorithms
Review: Search problem formulation
Informed Search Algorithms
A* Search. 2 Tree search algorithms Basic idea: Exploration of state space by generating successors of already-explored states (a.k.a.~expanding states).
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.
Weighted graphs Example Consider the following graph, where nodes represent cities, and edges show if there is a direct flight between each pair of cities.
CSE 390B: Graph Algorithms Based on CSE 373 slides by Jessica Miller, Ruth Anderson 1.
DIJKSTRA’s Algorithm. Definition fwd search Find the shortest paths from a given SOURCE node to ALL other nodes, by developing the paths in order of increasing.
Solving Problem by Searching
1 Heuristic Search Chapter 4. 2 Outline Heuristic function Greedy Best-first search Admissible heuristic and A* Properties of A* Algorithm IDA*
ICS-171:Notes 4: 1 Notes 4: Optimal Search ICS 171 Summer 1999.
Problem Solving Agents A problem solving agent is one which decides what actions and states to consider in completing a goal Examples: Finding the shortest.
Search Strategies Reading: Russell’s Chapter 3 1.
UNINFORMED SEARCH Problem - solving agents Example : Romania  On holiday in Romania ; currently in Arad.  Flight leaves tomorrow from Bucharest.
CPSC 322, Lecture 9Slide 1 Search: Advanced Topics Computer Science cpsc322, Lecture 9 (Textbook Chpt 3.6) January, 23, 2009.
Review: Search problem formulation
Using Search in Problem Solving
Graphs & Graph Algorithms 2 Nelson Padua-Perez Bill Pugh Department of Computer Science University of Maryland, College Park.
Pathfinding Algorithms Josh Palmer Rachael Beers.
Solving problems by searching
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.
Using Dijkstra’s Algorithm to Find a Shortest Path from a to z 1.
Dijkstras Algorithm Named after its discoverer, Dutch computer scientist Edsger Dijkstra, is an algorithm that solves the single-source shortest path problem.
Shortest Path Problem Weight of the graph –Nonnegative real number assigned to the edges connecting to vertices Weighted graphs –When a graph.
Quiz Th. Oct. 20 Chapters 1,2,3,4. S B AD E C F G straight-line distances h(S-G)=10 h(A-G)=7 h(D-G)=1 h(F-G)=1 h(B-G)=10 h(E-G)=8 h(C-G)=20.
Informed search strategies Idea: give the algorithm “hints” about the desirability of different states – Use an evaluation function to rank nodes and select.
COMP261 Lecture 7 A* Search. A* search Can we do better than Dijkstra's algorithm? Yes! –want to explore more promising paths, not just shortest so far.
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.
Advanced Artificial Intelligence Lecture 2: Search.
CSC3203: AI for Games Informed search (1) Patrick Olivier
Informed Search CSE 473 University of Washington.
A* Path Finding Ref: A-star tutorial.
CPSC 322, Lecture 6Slide 1 Uniformed Search (cont.) Computer Science cpsc322, Lecture 6 (Textbook finish 3.5) Sept, 17, 2012.
Ch. 3 – Search Supplemental slides for CSE 327 Prof. Jeff Heflin.
Decision Maths 1 Shortest path algorithm Dijkstra’s Algorithm A V Ali :
Chapter 3.5 and 3.6 Heuristic Search Continued. Review:Learning Objectives Heuristic search strategies –Best-first search –A* algorithm Heuristic functions.
Dijkstra animation. Dijksta’s Algorithm (Shortest Path Between 2 Nodes) 2 Phases:initialization;iteration Initialization: 1. Included:(Boolean) 2. Distance:(Weight)
Spanning Trees Dijkstra (Unit 10) SOL: DM.2 Classwork worksheet Homework (day 70) Worksheet Quiz next block.
Romania. Romania Problem Initial state: Arad Goal state: Bucharest Operators: From any node, you can visit any connected node. Operator cost, the.
Shortest Path Algorithms By: Nick Bielik Aaron Staranowicz Mike Knadle.
Graphs - II CS 2110, Spring Where did David leave that book? 2.
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.
Review: Tree search Initialize the frontier using the starting state
Uniformed Search (cont.) Computer Science cpsc322, Lecture 6
Solving problems by searching
Shortest Path from G to C Using Dijkstra’s Algorithm
Network Flow Problems – Shortest Path Problem
Discrete Math 2 Weighted Graph Search Tree
Heuristic Search Henry Kautz.
Uniformed Search (cont.) Computer Science cpsc322, Lecture 6
The A* Algorithm Héctor Muñoz-Avila.
Dijkstra’s Algorithm We are given a directed weighted graph
Lecture 1B: Search.
A* Path Finding Ref: A-star tutorial.
EA C461 – Artificial Intelligence
CSE 373: Data Structures and Algorithms
Artificial Intelligence
Search Exercise Search Tree? Solution (Breadth First Search)?
(1) Breadth-First Search  S Queue S
CSE 473 University of Washington
Visualizations Dijkstra’s Algorithm
Informed Search Idea: be smart about what paths to try.
Shortest Path Solutions
ECE457 Applied Artificial Intelligence Fall 2007 Lecture #2
Artificial Intelligence
Informed Search Idea: be smart about what paths to try.
Supplemental slides for CSE 327 Prof. Jeff Heflin
Presentation transcript:

Quiz 4-26-’07 Search

Dijkstra’s Shortest Path Algorithm: Consider the following algorithm to find the shortest distance between two cities (S  G) A. Maintain a list of cities C that you have visited so far. Cache the total path-cost g(c) and the predecessor city p(c) for every city c in C. B. Maintain a list of neighboring cities F (the fringe) that are not in C: Cache the total path-cost g(f) and the predecessor city p(f) for every city f in F. Cities in F are ordered according to their total path cost g(f) C. At every iteration of the algorithm, starting at S, visit the city in the fringe that has the lowest path-cost Add it to C and remove it from F. D. Add all new neighboring cities (including their g(f) and p(f)) into the fringe that are not already in C. (They could already be in F though with a different predecessor) E. If more than 1 copy of a city is in the fringe, only retain the one with lowest g(f). Delete all other copies. F. If you reach G, reconstruct the path from SG and report g(G) and the path. 1. [2pts] Work out the first 3 steps of Dijkstra’s algorithm and uniform cost search (UC with repeated states). This means: visit and expand the first 3 nodes starting at 0. Use the graph to the right. “0” is the source and “6” is the goal. 2. [2pts] Is this algorithm an instance of a informed or an uninformed search algorithm? (explain) 3. [2pts] Is this algorithm an instance of a tree search or a graph search 4. [2pts] Is this algorithm complete? (explain) 5. [2pts] Is this algorithm optimal? (explain – you may describe it as an instance of some algorithm in the book and refer to results described in the book)

Solution Notation for Dijkstra: node (total path cost, predecessor) Notation for Uniform cost: node (total path cost) Dijkstra Nodes visited and expanded: 0 (0, null), 1 (1.1, 0), 3 (3.5, 1) Uniform cost Nodes visited and expanded: 0 (0), 1 (1.1), 0 (2.2) Uninformed (since does not use any estimate of the cost from node to a goal) Graph search (since the algorithm maintains a list of already expanded nodes) Yes, it is complete (guaranteed to find a solution) Yes, it is optimal (because it is uniform cost search with a detection of repeated states)