Solving problems by searching Uninformed search algorithms Discussion Class CS 171 Friday, October, 2nd (Please read lecture topic material before and.

Slides:



Advertisements
Similar presentations
BEST FIRST SEARCH - BeFS
Advertisements

Review: Search problem formulation
Informed Search Algorithms
An Introduction to Artificial Intelligence
A* Search. 2 Tree search algorithms Basic idea: Exploration of state space by generating successors of already-explored states (a.k.a.~expanding states).
Problem Solving: Informed Search Algorithms Edmondo Trentin, DIISM.
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*
Lecture 3: Uninformed Search
Artificial Intelligence (CS 461D)
Search Strategies CPS4801. Uninformed Search Strategies Uninformed search strategies use only the information available in the problem definition Breadth-first.
Problem Solving by Searching
SE Last time: Problem-Solving Problem solving: Goal formulation Problem formulation (states, operators) Search for solution Problem formulation:
Review: Search problem formulation
Artificial Intelligence
CS 460 Spring 2011 Lecture 3 Heuristic Search / Local Search.
Problem Solving and Search in AI Heuristic Search
Uninformed Search (cont.)
CS 561, Session 6 1 Last time: Problem-Solving Problem solving: Goal formulation Problem formulation (states, operators) Search for solution Problem formulation:
Informed Search Idea: be smart about what paths to try.
Dijkstra’s Algorithm and Heuristic Graph Search David Johnson.
Informed search algorithms Chapter 4. Outline Best-first search Greedy best-first search A * search Heuristics Memory Bounded A* Search.
Informed search algorithms
Informed search algorithms Chapter 4. Outline Best-first search Greedy best-first search A * search Heuristics.
CHAPTER 4: INFORMED SEARCH & EXPLORATION Prepared by: Ece UYKUR.
1 Shanghai Jiao Tong University Informed Search and Exploration.
Informed search algorithms Chapter 4. Best-first search Idea: use an evaluation function f(n) for each node –estimate of "desirability"  Expand most.
Informed search strategies Idea: give the algorithm “hints” about the desirability of different states – Use an evaluation function to rank nodes and select.
Informed searching. Informed search Blind search algorithms do not consider any information about the states and the goals Often there is extra knowledge.
Informed Search Strategies Lecture # 8 & 9. Outline 2 Best-first search Greedy best-first search A * search Heuristics.
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)
Chapter 4 Informed/Heuristic Search
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.
Lecture 3: Uninformed Search
CSC3203: AI for Games Informed search (1) Patrick Olivier
Search (continued) CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
CS 312: Algorithm Design & Analysis Lecture #37: A* (cont.); Admissible Heuristics Credit: adapted from slides by Stuart Russell of UC Berkeley. This work.
Informed Search and Heuristics Chapter 3.5~7. Outline Best-first search Greedy best-first search A * search Heuristics.
4/11/2005EE562 EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS Lecture 4, 4/11/2005 University of Washington, Department of Electrical Engineering Spring 2005.
A General Introduction to Artificial Intelligence.
Feng Zhiyong Tianjin University Fall  Best-first search  Greedy best-first search  A * search  Heuristics  Local search algorithms  Hill-climbing.
Best-first search Idea: use an evaluation function f(n) for each node –estimate of "desirability"  Expand most desirable unexpanded node Implementation:
Pengantar Kecerdasan Buatan 4 - Informed Search and Exploration AIMA Ch. 3.5 – 3.6.
Informed Search II CIS 391 Fall CIS Intro to AI 2 Outline PART I  Informed = use problem-specific knowledge  Best-first search and its variants.
Informed Search CSE 473 University of Washington.
CPSC 322, Lecture 6Slide 1 Uniformed Search (cont.) Computer Science cpsc322, Lecture 6 (Textbook finish 3.5) Sept, 17, 2012.
CPSC 420 – Artificial Intelligence Texas A & M University Lecture 5 Lecturer: Laurie webster II, M.S.S.E., M.S.E.e., M.S.BME, Ph.D., P.E.
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.
Chapter 3.5 Heuristic Search. Learning Objectives Heuristic search strategies –Best-first search –A* algorithm Heuristic functions.
Review: Tree search Initialize the frontier using the starting state
Last time: Problem-Solving
Artificial Intelligence Problem solving by searching CSC 361
Discussion on Greedy Search and A*
Discussion on Greedy Search and A*
CS 4100 Artificial Intelligence
EA C461 – Artificial Intelligence
Informed search algorithms
Informed search algorithms
Artificial Intelligence
Case study: Strava + Waze
CSE 473 University of Washington
Informed Search Idea: be smart about what paths to try.
Artificial Intelligence
CS 416 Artificial Intelligence
Midterm Review.
Informed Search Idea: be smart about what paths to try.
“If I Only had a Brain” Search
Presentation transcript:

Solving problems by searching Uninformed search algorithms Discussion Class CS 171 Friday, October, 2nd (Please read lecture topic material before and after each lecture on that topic) Thanks to professor Kask Some of the slides (page 2-7) were copied from his lectures. 1

time complexity analysis Suppose goal is at level g: DFS: Best time : g Worst time : 1+ b + b 2 + … + b g BFS: Best time : 1+ b + b 2 + … + b g-1 +1 Worst time : 1+ b + b 2 + … + b g

Comparing BFS and DFS DFS is not optimal, BFS optimal if path cost is a non-decreasing function of depth, but BFS is not optimal in general. Time Complexity worse-case is the same, but – In the worst-case BFS is always better than DFS – Sometime, on the average DFS is better if: many goals, no loops and no infinite paths BFS is much worse memory-wise DFS can be linear space BFS may store the whole search space. In general BFS is better if goal is not deep, if long paths, if many loops, if small search space DFS is better if many goals, not many loops DFS is much better in terms of memory

Number of expanded nodes at each iteration: d = 0 : 1 d = 1 : 1 + b d = 2 : 1 + b + b^2 d = 3 : 1 + b + b^2 + b^3 …. Total ? Iterative deepening search - Complexity

Find BFS, DFS and Iterative deepening orders?

Djikestra (uniformed cost search) 1- create vertex set Queue dist[source] = 0; 2- for each vertex v in Graph: if v ≠ source: dist[v] ← INFINITY prev[v] ← UNDEFINED add v to Q 3- while Q is not empty: // RUN THIS PART FOR V TIMES u ← vertex in Q with min dist[u] // IT TAKES AT LEAST LOG(V) remove u from Q for each neighbor v of u: // RUN THIS PART FOR E TIMES alt ← dist[u] + length(u, v) if alt < dist[v]: dist[v] ← alt prev[v] ← u

Example Answer the following questions about the search problem shown above. Break any ties alphabetically. For the questions that ask for a path? (DFS, BFS and uniform cost)

A* algorithm

A* algorithm- Run it on this example?

A* algorithm Step1: A: 5, Select A Step2: B=5, C=8, Select B Step 3: C=8, D=6, Select D Step 4: D is the goal. Why A* doesn't work correctly?

Consistent heuristics A heuristic is consistent if for every node n, every successor n' of n generated by any action a, h(n) ≤ c(n,a,n') + h(n') If h is consistent, we have f(n’) = g(n’) + h(n’) (by def.) = g(n) + c(n,a,n') + h(n’) (g(n’)=g(n)+c(n.a.n’)) ≥ g(n) + h(n) = f(n) (consistency) f(n’) ≥ f(n) i.e., f(n) is non-decreasing along any path. Theorem: If h(n) is consistent, A* using GRAPH-SEARCH is optimal

Admissible heuristics A heuristic h(n) is admissible if for every node n, h(n) ≤ h* (n), where h* (n) is the true cost to reach the goal state from n. An admissible heuristic never overestimates the cost to reach the goal, i.e., it is optimistic (or at least, never pessimistic) – Example: hSLD(n) (never overestimates actual road distance) Theorem: If h(n) is admissible, A* using TREE-SEARCH is optimal

Question Provide an example of a graph, which is not admissible so A* cannot find optimal answer?