He Heur urist stic ic Sea earc rch h Computer ter Sc Science - - PowerPoint PPT Presentation

he heur urist stic ic sea earc rch
SMART_READER_LITE
LIVE PREVIEW

He Heur urist stic ic Sea earc rch h Computer ter Sc Science - - PowerPoint PPT Presentation

He Heur urist stic ic Sea earc rch h Computer ter Sc Science ce cpsc3 c322 22, , Lectur ture e 7 (Te Text xtbo book ok Chpt 3.6) Sept, t, 19, 2012 CPSC 322, Lecture 7 Slide 1 Course urse Announcements ouncements Marks ks


slide-1
SLIDE 1

CPSC 322, Lecture 7 Slide 1

He Heur urist stic ic Sea earc rch h

Computer ter Sc Science ce cpsc3 c322 22, , Lectur ture e 7 (Te Text xtbo book

  • k Chpt 3.6)

Sept, t, 19, 2012

slide-2
SLIDE 2

CPSC 322, Lecture 7 Slide 2

Course urse Announcements

  • uncements

Marks ks for As Assig ignme nment nt0: 0: wi will ll be posted ed on Co Connect t on Fir ir If f you are confuse used d on basic search h algorith ithm, m, different erent search strategies….. Check learning g goals at the end of le lectu tures.

  • res. Work

rk on the Pr Practice tice Ex Exercises ises and and Pl Please come to office ce hours

Giuseppe Tue 2 pm, my office. Nathaniel Tomer Fri 11am, X150 (Learning Center) Tatsuro Oya Wed 11am, X150 (Learning Center) Mehran Kazemi Mon 11 am, X150 (Learning Center)

Assignment1: nment1: will will also be posted d on Fri

slide-3
SLIDE 3

CPSC 322, Lecture 7 Slide 3

Lecture cture Ov Overview view

  • Recap

cap

  • Sea

earch ch wit ith h Cos

  • sts

ts

  • Su

Summ mmary ary Uni ninf nformed

  • rmed Se

Sear arch

  • Heuristic Search
slide-4
SLIDE 4

CPSC 322, Lecture 7 Slide 4

Recap: cap: Se Search ch with th Cost sts

  • Sometimes there are costs associated with arcs.
  • The cost of a path is the sum of the costs of its arcs.
  • Optimal solution: not the one that minimizes the

number of links, but the one that minimizes cost

  • Lowest-Cost-First Search: expand paths from the

frontier in order of their costs.

slide-5
SLIDE 5

CPSC 322, Lecture 7 Slide 5

Recap cap Uninforme nformed d Se Search ch

Complete Optimal Time Space DFS N N O(bm) O(mb) BFS Y Y O(bm) O(bm) IDS Y Y O(bm) O(mb) LCFS Y Costs > 0 Y Costs >=0 O(bm) O(bm)

slide-6
SLIDE 6

CPSC 322, Lecture 7 Slide 6

Recap cap Uninforme nformed d Se Search ch

  • Why are all these strategies called uninformed?

Because they do not consid ider er any informati mation n about the states tes (end nodes) to decide which path to expand first on the frontier eg

(n0, n2, n3 n3 12), (n0, n3 n3  8) , (n0, n1, n4 n4  13)

In other words, they are general they do not take into account the specif cific ic nature e of the problem em.

slide-7
SLIDE 7

CPSC 322, Lecture 7 Slide 7

Lecture cture Ov Overview view

  • Recap

cap

  • Sea

earch ch wit ith h Cos

  • sts

ts

  • Sum

ummary mary Uni ninf nformed

  • rmed Sea

earch

  • Heuristic Search
slide-8
SLIDE 8

CPSC 322, Lecture 7 Slide 8

Uninformed/Blind search algorithms do not take into account the goal until they are at a goal node. Often there is extra knowledge that can be used to guide the search: an an estim imate ate of the distan tance ce from node n to a goal node.

This is called a heurist ristic ic Heuristic uristic Se Search rch

slide-9
SLIDE 9

CPSC 322, Lecture 7 Slide 9

More re fo formall mally

Definition (search heuristic) A search heuristic h(n) is an estimate of the cost of the shortest path from node n to a goal node.

  • h can be extended to paths: h(n0,…,nk)=h(nk)
  • For now think of h(n) as only using readily obtainable

information (that is easy to compute) about a node.

slide-10
SLIDE 10

CPSC 322, Lecture 7 Slide 10

More re fo formall mally y (co cont.) nt.)

Definition (admissibl sible e heuristi stic) A search heuristic h(n) is admissible if it is never an

  • verestimate of the cost from n to a goal.
  • There is never a path from n to a goal that has path length less

than h(n).

  • another way of saying this: h(n) is a lower bound on the cost of

getting from n to the nearest goal.

slide-11
SLIDE 11

CPSC 322, Lecture 3 Slide 11

Ex Example mple Ad Admissible issible Heuristic ristic Fu Functions ctions

G Se Search h problem: em: robot has to find a route from start location to goal location on a grid (discrete space with

  • bstacles)

Fi Final l cost (quality of the solution) is the number of steps

slide-12
SLIDE 12

CPSC 322, Lecture 3 Slide 12

Ex Example mple Ad Admissible issible Heuristic ristic Fu Functions ctions

If no obstacles, cost of optimal solution is…

slide-13
SLIDE 13

CPSC 322, Lecture 3 Slide 13

Ex Example mple Ad Admissible issible Heuristic ristic Fu Functions ctions

If there are obstacle, the optimal solution without

  • bstacles is an admissible heuristic

G

slide-14
SLIDE 14

CPSC 322, Lecture 3 Slide 14

Ex Example mple Ad Admissible issible Heuristic ristic Fu Functions ctions

  • Similarly, If the nodes are points on a Euclidean plane and

the cost is the distance, we can use the straight-line distance from n to the closest goal as the value of h(n).

slide-15
SLIDE 15

CPSC 322, Lecture 3 Slide 15

Ex Example mple Heuristic ristic Fu Functions ctions

  • In the 8-puzzle, we can use the number of misplaced tiles
slide-16
SLIDE 16

CPSC 322, Lecture 3 Slide 16

Ex Example mple Heuristic ristic Fu Functions ctions

  • Another one we can use the number of moves between

each tile's current position and its position in the solution

1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8

slide-17
SLIDE 17

CPSC 322, Lecture 7 Slide 17

How w to to Construct struct a Heuristic ristic

You identify relaxed version of the problem:

  • where one or more constraints have been dropped
  • problem with fewer restrictions on the actions

Ro Robot: the agent can move through walls Dr Driver er: the agent can move straight 8puzzl zle: (1) tiles can move anywhere (2) tiles can move to any adjacent square

Re Result: lt: The cost of an optimal solution to the relaxed problem is an admissible heuristic for the original problem (because it is always weakly less costly to solve

a less constrained problem!)

slide-18
SLIDE 18

CPSC 322, Lecture 7 Slide 18

How w to to Construct struct a Heuristic ristic (co cont. t.)

You should identify constraints which, when dropped, make the problem extremely easy to solve

  • this is important because heuristics are not useful if they're as hard

to solve as the original problem!

This was the case in our examples

Robot: allowi wing the agent to move through walls. Optimal solution to this relaxed problem is Manhattan distance Driver: allowi wing the agent to move straight. Optimal solution to this relaxed problem is straight-line distance 8puzzle: (1) tiles can move anywh where e Optimal solution to this relaxed problem is number of misplaced tiles (2) tiles can move to any adjacent square….

slide-19
SLIDE 19

CPSC 322, Lecture 3 Slide 19

An Another

  • ther approach

roach to to co construct struct heuristics ristics

So Solutio tion n cost for a subprob

  • ble

lem

1 3 8 2 5 7 6 4 1 2 3 8 4 7 6 5 1 3 @ 2 @ @ @ 4 1 2 3 @ 4 @ @ @

Current node Goal node

Original Problem SubProblem

slide-20
SLIDE 20

CPSC 322, Lecture 8

Heuristics: uristics: Dominance inance

If h2(n) ≥ h1(n) for every state n (both admissible) then h2 dominates h1 Whi hich h o

  • ne

ne is is be bett tter er fo for sea earch ch (why?)

8puzzl zle: (1) tiles can move anywhere (2) tiles can move to any adjacent square (Original problem: tiles can move to an adjacent square if it is empty) search costs for the 8-puzzle (average number of paths expanded): (d = depth of the solution)

d=12 IDS = 3,644,035 paths A*(h1) = 227 paths A*(h2) = 73 paths d=24 IDS = too many paths A*(h1) = 39,135 paths A*(h2) = 1,641 paths

slide-21
SLIDE 21

CPSC 322, Lecture 8 Slide 21

Heuristics: uristics: Dominance inance

If h2(n) ≥ h1(n) for all n then h2 dominates h1 Is Is h2 be bett tter er fo for sea earch ch (why?)

8puzzl zle: (1) tiles can move anywhere (2) tiles can move to any adjacent square (Original problem: tiles can move to an adjacent square if it is empty) search costs for the 8-puzzle (average number of paths expanded):

d=12 IDS = 3,644,035 paths A*(h1) = 227 paths A*(h2) = 73 paths d=24 IDS = too many paths A*(h1) = 39,135 paths A*(h2) = 1,641 paths

It depends yes no

slide-22
SLIDE 22

CPSC 322, Lecture 3 Slide 22

Combining mbining Heurist ristics ics

How to combine ne heuris istics tics when there e is no domina nanc nce? e? If h1(n) is admissible and h2(n) is also admissible then h(n)= ………………… is also admissible … and dominates all its components

slide-23
SLIDE 23

CPSC 322, Lecture 3 Slide 23

Combining mbining Heurist ristics: ics: Ex Example mple

In 8-puzz zzle, e, solutio tion n cost t for the 1,2,3, ,3,4 4 subpro roble lem is substantially more accurate than Manhattan distance in some cases es So…..

slide-24
SLIDE 24

CPSC 322, Lecture 3 Slide 24

Adm dmis issi sibl ble e he heur uris istic tic fo for Vac acuu uum m wor

  • rld

ld?

states? Where it is dirty and robot location actions? Left, Right, Suck Possible goal test? no dirt at all locations

slide-25
SLIDE 25

CPSC 322, Lecture 7 Slide 25

Learning Goals for today’s class

  • Const

struct uct admiss ssib ible le heuristics stics for a given problem.

  • Ve

Verify fy Heurist stic ic Dominance ce.

  • Co

Combine ne admissib sible le heurist istics ics

  • From previous classes

Define/read/write/trace/debug different search algorithms

  • With / Without cost
  • Informed / Uninformed
slide-26
SLIDE 26

Next xt Class ss

  • Best-First Search
  • Combining LCFS and BFS: A* (finish 3.6)
  • A* Optimality

CPSC 322, Lecture 7 Slide 26