Analyzing Search Generic search algorithm add start to frontier - - PowerPoint PPT Presentation

analyzing search generic search algorithm
SMART_READER_LITE
LIVE PREVIEW

Analyzing Search Generic search algorithm add start to frontier - - PowerPoint PPT Presentation

Analyzing Search Generic search algorithm add start to frontier while frontier not empty get state from frontier if state is goal return end if for neighbor of state add neighbor to frontier end for end while Uninformed Search Informed


slide-1
SLIDE 1

Analyzing Search

slide-2
SLIDE 2

Generic search algorithm

add start to frontier while frontier not empty get state from frontier if state is goal return end if for neighbor of state add neighbor to frontier end for end while

slide-3
SLIDE 3

Given only the problem definition:

  • start state
  • goal function
  • a way to generate successors

Depth First

  • FIFO frontier

Breadth First

  • LIFO frontier

Uniform Cost

  • frontier ordered by c(s)

Uninformed Search Informed Search

Given:

  • problem definition
  • heuristic to estimate cost-to-goal

A*

  • frontier ordered by h(s) + c(s)

Greedy

  • frontier ordered by h(s)

h(s): heuristic value of state s c(s): cost to get to state s

slide-4
SLIDE 4

Measuring Performance

1. Completeness: Is the search guaranteed to find a solution (if one exists)? 2. Optimality: Is the search guaranteed to find the lowest-cost solution? 3. Time complexity: How long does it take to find a solution?

○ How many nodes are expanded?

4. Space complexity: How much memory is needed to perform the search?

○ How many nodes get stored in frontier + visited?

b: branching factor d: depth of the goal

slide-5
SLIDE 5

Example Domain

Given a Romanian road map, navigate from Arad to Bucharest.

slide-6
SLIDE 6

Frontier S, T, Z F, R, T, Z B, R, T, Z

DFS

slide-7
SLIDE 7

Frontier Z, T, S O, T, S T, S L, S M, S D, S C, S R, P, S P, S B, S

DFS

slide-8
SLIDE 8

Frontier S, T, Z T, Z, F, R Z, F, R, L F, R, L, O R, L, O, B L, O, B, C, P O, B, C, P, M B, C, P, M

BFS

slide-9
SLIDE 9

Frontier Z=75, T=118, S=140 T=118, S=140, O=146 S=140, O=146, L=229 O=146, R=220, L=229, F=239 R=220, L=229, F=239 L=229, F=239, P=317, C=366 F=239, P=317, M=299, C=366 P=317, M=299, C=366, B=450

UCS

M=299, C=366, B=418 C=366, D=374, B=418 D=374, B=418 B=418

slide-10
SLIDE 10

Frontier S=393, T=447, Z=449 R=413, F=417, T=447, Z=449 P=415, F=417, T=447, Z=449, C=526 F=417, B=418, T=447, Z=449, C=526 B=418, T=447, Z=449, C=526 h(A) = 366 h(C) = 160 h(D) = 242 h(F) = 178 h(L) = 244 h(M) = 241 h(O) = 380 h(P) = 98 h(R) = 193 h(S) = 253 h(T) = 329 h(Z) = 374

A*

slide-11
SLIDE 11

Frontier S=253, T=329, Z=374 F=178, R=193, T=447, Z=449 B=0, R=193, T=447, Z=449 h(A) = 366 h(C) = 160 h(D) = 242 h(F) = 178 h(L) = 244 h(M) = 241 h(O) = 380 h(P) = 98 h(R) = 193 h(S) = 253 h(T) = 329 h(Z) = 374

Greedy

slide-12
SLIDE 12

BFS DFS UCS A* Greedy complete? Y N Y Y N

  • ptimal?

N N Y Y N time efficient? !!! space efficient? !! !!

slide-13
SLIDE 13

Devising Heuristics

  • Must be admissible: never overestimate the cost to reach the goal.
  • Should strive for consistency: h(s) + c(s) non-decreasing along paths.
  • The higher the estimate (subject to admissibility), the better.

Key idea: simplify the problem.

  • Traffic Jam: ignore some of the cars.
  • Path Finding: assume straight roads.
slide-14
SLIDE 14

Clicker Question

Why does A* need an admissible heuristic? a) required for completeness b) required for optimality c) improves time complexity d) improves space complexity e) some other reason

slide-15
SLIDE 15

Clicker Question

A* with an uninformative heuristic (example: h(s) = 5, ∀s) is equivalent to: a) breadth first search b) depth first search c) uniform cost search d) greedy search e) none of these