4 heuristics search v2
TRANSCRIPT
-
8/9/2019 4 Heuristics Search V2
1/29
Informed search algorithms
Chapter 4
-
8/9/2019 4 Heuristics Search V2
2/29
Material
Chapter 4 Section 1 3
Exclude memory-ounded heuristic
search
-
8/9/2019 4 Heuristics Search V2
3/29
!e"ie#$ %ree search
& search strategy is defined y pic'ing theorder of node expansion
-
8/9/2019 4 Heuristics Search V2
4/29
(est-first search
Idea$ use an e"aluation functionf(n) for each node estimate of )desiraility*
Implementation$
+rder the nodes in fringe in decreasing order of desiraility
Special cases$ greedy est-first search
&,search
Expand most desirale unexpanded node
-
8/9/2019 4 Heuristics Search V2
5/29
!omania #ith step costs in 'm
-
8/9/2019 4 Heuristics Search V2
6/29
.reedy est-first search
E"aluation function f(n) = h(n) /heuristic0
estimate of cost from nto goal
e2g2 hSLD(n) straight-line distance from nto (ucharest
.reedy est-first search expands the node
that appearsto e closest to goal
-
8/9/2019 4 Heuristics Search V2
7/29
.reedy est-first searchexample
-
8/9/2019 4 Heuristics Search V2
8/29
.reedy est-first searchexample
-
8/9/2019 4 Heuristics Search V2
9/29
.reedy est-first searchexample
-
8/9/2019 4 Heuristics Search V2
10/29
.reedy est-first searchexample
-
8/9/2019 4 Heuristics Search V2
11/29
roperties of greedy est-firstsearch
Complete56o can get stuc' in loopse2g2 Iasi6eamtIasi6eamt
%ime5 +/m0 ut a good heuristic cangi"e dramatic impro"ement
Space5 +/m0 -- 'eeps all nodes inmemory
+ptimal5 6o
-
8/9/2019 4 Heuristics Search V2
12/29
&,search
Idea$ a"oid expanding paths that arealready expensi"e
E"aluation function f(n) = g(n) + h(n)
g(n) cost so far to reach n
h(n) estimated cost from nto goal
f(n) estimated total cost of path throughnto goal
-
8/9/2019 4 Heuristics Search V2
13/29
&,search example
-
8/9/2019 4 Heuristics Search V2
14/29
&,search example
-
8/9/2019 4 Heuristics Search V2
15/29
&,search example
-
8/9/2019 4 Heuristics Search V2
16/29
&,search example
-
8/9/2019 4 Heuristics Search V2
17/29
&,search example
-
8/9/2019 4 Heuristics Search V2
18/29
&,search example
-
8/9/2019 4 Heuristics Search V2
19/29
+ptimality of &,
&,expands nodes in order of increasing f"alue
.radually adds )f-contours) of nodes
Contour ihas all nodes #ith f=fi #here fi< fi+1
-
8/9/2019 4 Heuristics Search V2
20/29
-
8/9/2019 4 Heuristics Search V2
21/29
;ocal search algorithms
In many optimi
-
8/9/2019 4 Heuristics Search V2
22/29
Example$ n-?ueens
ut n?ueens on an n noard #ith not#o ?ueens on the same ro# column ordiagonal
-
8/9/2019 4 Heuristics Search V2
23/29
@ill-climing search
);i'e climing E"erest in thic' fog #ithamnesia)
-
8/9/2019 4 Heuristics Search V2
24/29
@ill-climing search
rolem$ depending on initial state canget stuc' in local maxima
-
8/9/2019 4 Heuristics Search V2
25/29
@ill-climing search$ A-?ueens prolem
h numer of pairs of ?ueens that are attac'ing each other either directlyor indirectly
h = 17for the ao"e state
-
8/9/2019 4 Heuristics Search V2
26/29
@ill-climing search$ A-?ueens prolem
& local minimum #ith h = 1
-
8/9/2019 4 Heuristics Search V2
27/29
;ocal eam search
:eep trac' of kstates rather than Bust one
Start #ith ' randomly generated states
&t each iteration all the successors of all 'states are generated
If any one is a goal state stop= else selectthe ' est successors from the completelist and repeat2
-
8/9/2019 4 Heuristics Search V2
28/29
.enetic algorithms
& successor state is generated y comining t#o parentstates
Start #ith krandomly generated states /population0 & state is represented as a string o"er a finite alphaet
/often a string of s and 1s0 E"aluation function /fitness function02 @igher "alues foretter states2
roduce the next generation of states y selectioncrosso"er and mutation
-
8/9/2019 4 Heuristics Search V2
29/29
.enetic algorithms
>itness function$ numer of non-attac'ing pairs of ?ueens /min max A D FG GA0
G4F/G4HG3HGH110 31 G3F/G4HG3HGH110 GJ etc