CS 414 ARTIFICIAL INTELLIGENCE INFORMED SEARCH Informed searches

  • Slides: 22
Download presentation
CS 414 ARTIFICIAL INTELLIGENCE

CS 414 ARTIFICIAL INTELLIGENCE

INFORMED SEARCH • Informed searches use domain knowledge to guide selection of the best

INFORMED SEARCH • Informed searches use domain knowledge to guide selection of the best path to continue searching • Heuristics are used, which are informed guesses • Heuristic means "serving to aid discovery"

INFORMED SEARCH • Define a heuristic function, h(n) • uses domain-specific information in some

INFORMED SEARCH • Define a heuristic function, h(n) • uses domain-specific information in some way • is computable from the current state description • it estimates • the "goodness" of node n • how close node n is to a goal • the cost of minimal cost path from node n to a goal state

UNINFORMED VS. INFORMED SEARCH Uninformed search: • Distance to goal not taken into account

UNINFORMED VS. INFORMED SEARCH Uninformed search: • Distance to goal not taken into account • Depth-first, breadth-first and uniform-cost searches are uninformed. Informed search : • Information about cost to goal taken into account • there is an estimate available of the cost (distance) from each state (city) to the goal. • This estimate (heuristic) can help you head in 4

INFORMED SEARCH If we use uniform cost search on this graph What’s wrong ?

INFORMED SEARCH If we use uniform cost search on this graph What’s wrong ? ? 5

INFORMED SEARCH If we use uniform cost search on this graph What’s wrong ?

INFORMED SEARCH If we use uniform cost search on this graph What’s wrong ? Cost = 1001 To avoid this problem, heuristic function is needed. 6

GREEDY BEST‐FIRST SEARCH Informed Search or Heuristic Search methods try to estimate the “distance”

GREEDY BEST‐FIRST 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. Greedy best-first search • use h(s) instead of g(s( • Always expand the node with the least h(s( • Use a priority queue: Push in states increasing order of h(s( Pop out the state with the least h(s) first. 7

GREEDY BEST-FIRST SEARCH S h=8 expnd. node Frontier {S: 8} 1 5 A B

GREEDY BEST-FIRST SEARCH S h=8 expnd. node Frontier {S: 8} 1 5 A B h=8 3 D h=∞ 7 E h=∞ 8 C h=4 9 4 G h=0 h=3 5

GREEDY BEST-FIRST SEARCH S h=8 expnd. node Frontier {S: 8} S not goal {C:

GREEDY BEST-FIRST SEARCH S h=8 expnd. node Frontier {S: 8} S not goal {C: 3, B: 4, A: 8} 1 5 A B h=8 3 D h=∞ 7 E h=∞ 8 C h=4 9 4 G h=0 h=3 5

GREEDY BEST-FIRST SEARCH S h=8 expnd. node S C not goal Frontier {S: 8}

GREEDY BEST-FIRST SEARCH S h=8 expnd. node S C not goal Frontier {S: 8} {C: 3, B: 4, A: 8} {G: 0, B: 4, A: 8} 1 5 A B h=8 3 D h=∞ 7 E h=∞ 8 C h=4 9 4 G h=0 h=3 5

GREEDY BEST-FIRST SEARCH expnd. node S C G goal Frontier {S: 8} {C: 3,

GREEDY BEST-FIRST SEARCH expnd. node S C G goal Frontier {S: 8} {C: 3, B: 4, A: 8} {G: 0, B: 4, A: 8} {B: 4, A: 8} not expanded S h=8 1 5 A B h=8 3 D h=∞ 7 E h=∞ 8 C h=4 9 4 G h=0 h=3 5

GREEDY BEST-FIRST SEARCH S h=8 expnd. node Frontier {S: 8} S {C: 3, B:

GREEDY BEST-FIRST SEARCH S h=8 expnd. node Frontier {S: 8} S {C: 3, B: 4, A: 8} C {G: 0, B: 4, A: 8} G {B: 4, A: 8} 1 A 3 D optimal C h=4 7 E 8 B h=8 h=∞ • Fast but not 5 9 h=∞ 4 h=3 5 G h=0 path: S, C, G cost: 13

GREEDY BEST‐FIRST SEARCH Graph : 13

GREEDY BEST‐FIRST SEARCH Graph : 13

TRY THIS Use greedy best first search path from Arad to Buchraest 14

TRY THIS Use greedy best first search path from Arad to Buchraest 14

A* SEARCH Suppose we use greedy best-first search with this graph. Which path do

A* SEARCH Suppose we use greedy best-first search with this graph. Which path do we choose ? ? 15

A* SEARCH Suppose we use greedy best-first search with this graph. Which path do

A* SEARCH Suppose we use greedy best-first search with this graph. Which path do we choose ? Path : A C G Cost : 1000 So, we need heuristic function and real cost to select a path. 16

A* SEARCH Evaluation function f(n)= g(n)+ h(n( • g(n) the cost (from the start)

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. 17

A* SEARCH Graph : 18

A* SEARCH Graph : 18

A* SEARCH Agenda : Expand node s Nodes list {s: 13} {Bs: 12, As:

A* SEARCH Agenda : Expand node s Nodes list {s: 13} {Bs: 12, As: 17, Cs : 19 } 19

TRY THIS Use A*search path from Arad to Buchraest 20

TRY THIS Use A*search path from Arad to Buchraest 20

TRY THIS Use A*search path from Bremen to Munchen G(n) H(n) 21

TRY THIS Use A*search path from Bremen to Munchen G(n) H(n) 21

City H(n) KIE 750 HAM 720 BRE 720 ROS 740 SCH 680 HAN 610

City H(n) KIE 750 HAM 720 BRE 720 ROS 740 SCH 680 HAN 610 BER 590 DUS 540 LEI 410 BON 480 FRA 380 DRE 400 STU 180 MUN 0 22