CS.462 Artificial Intelligence
190 likes | 471 Vues
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.
CS.462 Artificial Intelligence
E N D
Presentation Transcript
CS.462Artificial 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
Uniform Cost Search (UCS) Graph: 2
UCS Agenda:
O 151 F 71 S 99 Z 75 211 90 A 140 R B P 97 120 101 118 146 138 D 75 M T 111 70 L C Try this Find a path from node A to the goal node B. Use UCS method.
O 151 F 71 S 99 Z 75 211 90 A 140 R B P 97 120 101 118 146 138 D 75 M T 111 70 L C UCS A Z75 T118 S140 T118 S140 O146 S140 O146L229
Informed Search • If we use uniform cost search on this graph What’s wrong ?
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.
Best-first greedy search Graph:
Best-first greedy search Agenda:
Try this Use Best first greedy search path from Arad to Buchraest
A* Search • Evaluation function f(n)= g(n)+ h(n) • g(n) the cost (from the start) to reach the node n. • h(n) estimated cost to get from the node n to the goal. • f(n) estimated total cost of path through n to goal.
A* Search Graph:
A* Search Agenda:
Try this Use A* search path from Arad to Buchraest