CS.462 Artificial Intelligence

16
CS.462 Artificial Intelligence SOMCHAI THANGSATHITYANGKUL Lecture 03 : Search (2)

description

CS.462 Artificial Intelligence. SOMCHAI THANGSATHITYANGKUL Lecture 03 : Search (2). Uniform Cost Search (UCS). Uniform Cost Search: Nodes in agenda keep track of total path length from start to that node Agenda kept in priority queue ordered by path length Get shortest path in queue. - PowerPoint PPT Presentation

Transcript of CS.462 Artificial Intelligence

Page 1: CS.462 Artificial Intelligence

CS.462Artificial Intelligence

SOMCHAI THANGSATHITYANGKUL

Lecture 03 : Search (2)

Page 2: CS.462 Artificial Intelligence

2

Uniform Cost Search (UCS)

• Uniform Cost Search:– Nodes in agenda keep track of total

path length from start to that node– Agenda kept in priority queue ordered

by path length– Get shortest path in queue

Page 3: CS.462 Artificial Intelligence

3

Uniform Cost Search (UCS)

Graph:

2

Page 4: CS.462 Artificial Intelligence

4

UCSAgenda:

Expand node Nodes list

s

{s}

{Bs :2,Cs:4 ,As:5 }

Page 5: CS.462 Artificial Intelligence

5

Try thisFind a path from node A to the goal

node B. Use UCS method.

AB

Z

OS F

C

PR

T L MD

118

75

71 151

140

111 70 75

120

90

99

211

97

146 138

101

Page 6: CS.462 Artificial Intelligence

UCS

6

S140 O146 L229

A

T118 S140 O146

Z75 T118 S140A

B

ZO

S F

C

PR

T L MD

118

75

71 151

140

111 7075

120

90

99

211

97

146 138

101

Page 7: CS.462 Artificial Intelligence

7

Informed Search

• If we use uniform cost search on this graph

What’s wrong ?

Page 8: CS.462 Artificial Intelligence

8

Informed Search

• Informed Search or Heuristic Search methods try to estimate the “distance” to a goal state. A heuristic function h(s) is the estimated distance to the goal state.

• - Best first greedy search - use h(s) instead of g(s) - Always expand the node with the least h(s) - Use a priority queue: - - Push in states with their second half cost h(s)

Pop out the state with the least h(s) first.

Page 9: CS.462 Artificial Intelligence

9

- Best first greedy search

Graph:

Page 10: CS.462 Artificial Intelligence

10

- Best first greedy searchAgenda:

Expand node Nodes list

s

{s:13}

{Bs:10, As:12,Cs :15 }

Page 11: CS.462 Artificial Intelligence

11

Try thisUse Best first greedy search path from Arad to Buchraest

Page 12: CS.462 Artificial Intelligence

12

A* Search

Page 13: CS.462 Artificial Intelligence

13

A* Search

• Evaluation function f(n)= g(n)+h(n)– g(n) the cost (from the start) to reach th

e node n.– h(n) estimated cost to get from the nod

e n to the goal.– f(n) estimated total cost of path throug

h n to goal.

Page 14: CS.462 Artificial Intelligence

14

A* Search

Graph:

Page 15: CS.462 Artificial Intelligence

15

A* Search

Agenda:

Expand node Nodes list

s

{s:13}

{Bs:12, As:17,Cs :19 }

Page 16: CS.462 Artificial Intelligence

16

Try thisUse A* search path from Arad to Buchraest