Upload
gilead
View
36
Download
0
Tags:
Embed Size (px)
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
Citation preview
CS.462Artificial Intelligence
SOMCHAI THANGSATHITYANGKUL
Lecture 03 : Search (2)
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
3
Uniform Cost Search (UCS)
Graph:
2
4
UCSAgenda:
Expand node Nodes list
s
{s}
{Bs :2,Cs:4 ,As:5 }
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
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
7
Informed Search
• If we use uniform cost search on this graph
What’s wrong ?
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.
9
- Best first greedy search
Graph:
10
- Best first greedy searchAgenda:
Expand node Nodes list
s
{s:13}
{Bs:10, As:12,Cs :15 }
11
Try thisUse Best first greedy search path from Arad to Buchraest
12
A* Search
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.
14
A* Search
Graph:
15
A* Search
Agenda:
Expand node Nodes list
s
{s:13}
{Bs:12, As:17,Cs :19 }
16
Try thisUse A* search path from Arad to Buchraest