![Page 1: Informed Search - University of Washington€¦ · Informed Search Instructor: Luke Ze@lemoyer University of Washington [These slides were adapted from Dan Klein and Pieter Abbeel](https://reader035.vdocuments.site/reader035/viewer/2022070113/605c2e5204c077356a706466/html5/thumbnails/1.jpg)
CSE473:Ar+ficialIntelligence
InformedSearch
Instructor:LukeZe@lemoyer
UniversityofWashington[TheseslideswereadaptedfromDanKleinandPieterAbbeelforCS188IntrotoAIatUCBerkeley.AllCS188materialsareavailableath@p://ai.berkeley.edu.]
![Page 2: Informed Search - University of Washington€¦ · Informed Search Instructor: Luke Ze@lemoyer University of Washington [These slides were adapted from Dan Klein and Pieter Abbeel](https://reader035.vdocuments.site/reader035/viewer/2022070113/605c2e5204c077356a706466/html5/thumbnails/2.jpg)
Today
§ InformedSearch§ Heuris+cs§ GreedySearch§ A*Search
§ GraphSearch
![Page 3: Informed Search - University of Washington€¦ · Informed Search Instructor: Luke Ze@lemoyer University of Washington [These slides were adapted from Dan Klein and Pieter Abbeel](https://reader035.vdocuments.site/reader035/viewer/2022070113/605c2e5204c077356a706466/html5/thumbnails/3.jpg)
Recap:Search
![Page 4: Informed Search - University of Washington€¦ · Informed Search Instructor: Luke Ze@lemoyer University of Washington [These slides were adapted from Dan Klein and Pieter Abbeel](https://reader035.vdocuments.site/reader035/viewer/2022070113/605c2e5204c077356a706466/html5/thumbnails/4.jpg)
Recap:Search§ Searchproblem:
§ States(configura+onsoftheworld)§ Ac+onsandcosts§ Successorfunc+on(worlddynamics)§ Startstateandgoaltest
§ Searchtree:§ Nodes:representplansforreachingstates§ Planshavecosts(sumofac+oncosts)
§ Searchalgorithm:§ Systema+callybuildsasearchtree§ Choosesanorderingofthefringe(unexplorednodes)§ Op+mal:findsleast-costplans
![Page 5: Informed Search - University of Washington€¦ · Informed Search Instructor: Luke Ze@lemoyer University of Washington [These slides were adapted from Dan Klein and Pieter Abbeel](https://reader035.vdocuments.site/reader035/viewer/2022070113/605c2e5204c077356a706466/html5/thumbnails/5.jpg)
Example:PancakeProblem
Cost:Numberofpancakesflipped
![Page 6: Informed Search - University of Washington€¦ · Informed Search Instructor: Luke Ze@lemoyer University of Washington [These slides were adapted from Dan Klein and Pieter Abbeel](https://reader035.vdocuments.site/reader035/viewer/2022070113/605c2e5204c077356a706466/html5/thumbnails/6.jpg)
Example:PancakeProblem
![Page 7: Informed Search - University of Washington€¦ · Informed Search Instructor: Luke Ze@lemoyer University of Washington [These slides were adapted from Dan Klein and Pieter Abbeel](https://reader035.vdocuments.site/reader035/viewer/2022070113/605c2e5204c077356a706466/html5/thumbnails/7.jpg)
Example:PancakeProblem
3
2
4
3
3
2
2
2
4
Statespacegraphwithcostsasweights
34
3
4
2
![Page 8: Informed Search - University of Washington€¦ · Informed Search Instructor: Luke Ze@lemoyer University of Washington [These slides were adapted from Dan Klein and Pieter Abbeel](https://reader035.vdocuments.site/reader035/viewer/2022070113/605c2e5204c077356a706466/html5/thumbnails/8.jpg)
GeneralTreeSearch
Ac+on:fliptoptwoCost:2
Ac+on:flipallfourCost:4Pathtoreachgoal:Flipfour,flipthree
Totalcost:7
![Page 9: Informed Search - University of Washington€¦ · Informed Search Instructor: Luke Ze@lemoyer University of Washington [These slides were adapted from Dan Klein and Pieter Abbeel](https://reader035.vdocuments.site/reader035/viewer/2022070113/605c2e5204c077356a706466/html5/thumbnails/9.jpg)
TheOneQueue
§ Allthesesearchalgorithmsarethesameexceptforfringestrategies§ Conceptually,allfringesarepriorityqueues(i.e.collec+onsofnodeswitha@achedpriori+es)
§ Prac+cally,forDFSandBFS,youcanavoidthelog(n)overheadfromanactualpriorityqueue,byusingstacksandqueues
§ Canevencodeoneimplementa+onthattakesavariablequeuingobject
![Page 10: Informed Search - University of Washington€¦ · Informed Search Instructor: Luke Ze@lemoyer University of Washington [These slides were adapted from Dan Klein and Pieter Abbeel](https://reader035.vdocuments.site/reader035/viewer/2022070113/605c2e5204c077356a706466/html5/thumbnails/10.jpg)
UninformedSearch
![Page 11: Informed Search - University of Washington€¦ · Informed Search Instructor: Luke Ze@lemoyer University of Washington [These slides were adapted from Dan Klein and Pieter Abbeel](https://reader035.vdocuments.site/reader035/viewer/2022070113/605c2e5204c077356a706466/html5/thumbnails/11.jpg)
UniformCostSearch
§ Strategy:expandlowestpathcost§ Thegood:UCSiscompleteandop+mal!
§ Thebad:§ Exploresop+onsinevery“direc+on”§ Noinforma+onaboutgoalloca+on Start Goal
…
c ≤ 3
c ≤ 2 c ≤ 1
[Demo:contoursUCSempty(L3D1)][Demo:contoursUCSpacmansmallmaze(L3D3)]
![Page 12: Informed Search - University of Washington€¦ · Informed Search Instructor: Luke Ze@lemoyer University of Washington [These slides were adapted from Dan Klein and Pieter Abbeel](https://reader035.vdocuments.site/reader035/viewer/2022070113/605c2e5204c077356a706466/html5/thumbnails/12.jpg)
VideoofDemoContoursUCSEmpty
![Page 13: Informed Search - University of Washington€¦ · Informed Search Instructor: Luke Ze@lemoyer University of Washington [These slides were adapted from Dan Klein and Pieter Abbeel](https://reader035.vdocuments.site/reader035/viewer/2022070113/605c2e5204c077356a706466/html5/thumbnails/13.jpg)
VideoofDemoContoursUCSPacmanSmallMaze
![Page 14: Informed Search - University of Washington€¦ · Informed Search Instructor: Luke Ze@lemoyer University of Washington [These slides were adapted from Dan Klein and Pieter Abbeel](https://reader035.vdocuments.site/reader035/viewer/2022070113/605c2e5204c077356a706466/html5/thumbnails/14.jpg)
InformedSearch
![Page 15: Informed Search - University of Washington€¦ · Informed Search Instructor: Luke Ze@lemoyer University of Washington [These slides were adapted from Dan Klein and Pieter Abbeel](https://reader035.vdocuments.site/reader035/viewer/2022070113/605c2e5204c077356a706466/html5/thumbnails/15.jpg)
SearchHeuris+cs§ Aheuris+cis:
§ Afunc+onthates#mateshowcloseastateistoagoal§ Designedforapar+cularsearchproblem§ Examples:Manha@an,Euclideandistanceforpathing
10
5
11.2
![Page 16: Informed Search - University of Washington€¦ · Informed Search Instructor: Luke Ze@lemoyer University of Washington [These slides were adapted from Dan Klein and Pieter Abbeel](https://reader035.vdocuments.site/reader035/viewer/2022070113/605c2e5204c077356a706466/html5/thumbnails/16.jpg)
Example:Heuris+cFunc+on
h(x)
![Page 17: Informed Search - University of Washington€¦ · Informed Search Instructor: Luke Ze@lemoyer University of Washington [These slides were adapted from Dan Klein and Pieter Abbeel](https://reader035.vdocuments.site/reader035/viewer/2022070113/605c2e5204c077356a706466/html5/thumbnails/17.jpg)
Example:Heuris+cFunc+onHeuris+c:thenumberofthelargestpancakethatiss+lloutofplace
43
0
2
3
3
3
4
4
3
4
4
4
h(x)
![Page 18: Informed Search - University of Washington€¦ · Informed Search Instructor: Luke Ze@lemoyer University of Washington [These slides were adapted from Dan Klein and Pieter Abbeel](https://reader035.vdocuments.site/reader035/viewer/2022070113/605c2e5204c077356a706466/html5/thumbnails/18.jpg)
GreedySearch
![Page 19: Informed Search - University of Washington€¦ · Informed Search Instructor: Luke Ze@lemoyer University of Washington [These slides were adapted from Dan Klein and Pieter Abbeel](https://reader035.vdocuments.site/reader035/viewer/2022070113/605c2e5204c077356a706466/html5/thumbnails/19.jpg)
Example:Heuris+cFunc+on
h(x)
![Page 20: Informed Search - University of Washington€¦ · Informed Search Instructor: Luke Ze@lemoyer University of Washington [These slides were adapted from Dan Klein and Pieter Abbeel](https://reader035.vdocuments.site/reader035/viewer/2022070113/605c2e5204c077356a706466/html5/thumbnails/20.jpg)
GreedySearch
§ Expandthenodethatseemsclosest…
§ Whatcangowrong?
![Page 21: Informed Search - University of Washington€¦ · Informed Search Instructor: Luke Ze@lemoyer University of Washington [These slides were adapted from Dan Klein and Pieter Abbeel](https://reader035.vdocuments.site/reader035/viewer/2022070113/605c2e5204c077356a706466/html5/thumbnails/21.jpg)
GreedySearch
§ Strategy:expandanodethatyouthinkisclosesttoagoalstate§ Heuris+c:es+mateofdistancetonearestgoalforeachstate
§ Acommoncase:
§ Best-firsttakesyoustraighttothe(wrong)goal
§ Worst-case:likeabadly-guidedDFS
…b
…b
[Demo:contoursgreedyempty(L3D1)][Demo:contoursgreedypacmansmallmaze(L3D4)]
![Page 22: Informed Search - University of Washington€¦ · Informed Search Instructor: Luke Ze@lemoyer University of Washington [These slides were adapted from Dan Klein and Pieter Abbeel](https://reader035.vdocuments.site/reader035/viewer/2022070113/605c2e5204c077356a706466/html5/thumbnails/22.jpg)
VideoofDemoContoursGreedy(Empty)
![Page 23: Informed Search - University of Washington€¦ · Informed Search Instructor: Luke Ze@lemoyer University of Washington [These slides were adapted from Dan Klein and Pieter Abbeel](https://reader035.vdocuments.site/reader035/viewer/2022070113/605c2e5204c077356a706466/html5/thumbnails/23.jpg)
VideoofDemoContoursGreedy(PacmanSmallMaze)
![Page 24: Informed Search - University of Washington€¦ · Informed Search Instructor: Luke Ze@lemoyer University of Washington [These slides were adapted from Dan Klein and Pieter Abbeel](https://reader035.vdocuments.site/reader035/viewer/2022070113/605c2e5204c077356a706466/html5/thumbnails/24.jpg)
A*Search
![Page 25: Informed Search - University of Washington€¦ · Informed Search Instructor: Luke Ze@lemoyer University of Washington [These slides were adapted from Dan Klein and Pieter Abbeel](https://reader035.vdocuments.site/reader035/viewer/2022070113/605c2e5204c077356a706466/html5/thumbnails/25.jpg)
A*Search
UCS Greedy
A*
![Page 26: Informed Search - University of Washington€¦ · Informed Search Instructor: Luke Ze@lemoyer University of Washington [These slides were adapted from Dan Klein and Pieter Abbeel](https://reader035.vdocuments.site/reader035/viewer/2022070113/605c2e5204c077356a706466/html5/thumbnails/26.jpg)
CombiningUCSandGreedy
§ Uniform-costordersbypathcost,orbackwardcostg(n)§ Greedyordersbygoalproximity,orforwardcosth(n)
§ A*Searchordersbythesum:f(n)=g(n)+h(n)
S a d
b
Gh=5
h=6
h=2
1
8
11
2
h=6 h=0
c
h=7
3
e h=11
Example:TegGrenager
S
a
b
c
ed
dG
G
g=0h=6
g=1h=5
g=2h=6
g=3h=7
g=4h=2
g=6h=0
g=9h=1
g=10h=2
g=12h=0
![Page 27: Informed Search - University of Washington€¦ · Informed Search Instructor: Luke Ze@lemoyer University of Washington [These slides were adapted from Dan Klein and Pieter Abbeel](https://reader035.vdocuments.site/reader035/viewer/2022070113/605c2e5204c077356a706466/html5/thumbnails/27.jpg)
WhenshouldA*terminate?
§ Shouldwestopwhenweenqueueagoal?
§ No:onlystopwhenwedequeueagoal
S
B
A
G
2
3
2
2h=1
h=2
h=0h=3
![Page 28: Informed Search - University of Washington€¦ · Informed Search Instructor: Luke Ze@lemoyer University of Washington [These slides were adapted from Dan Klein and Pieter Abbeel](https://reader035.vdocuments.site/reader035/viewer/2022070113/605c2e5204c077356a706466/html5/thumbnails/28.jpg)
IsA*Op+mal?
§ Whatwentwrong?§ Actualbadgoalcost<es+matedgoodgoalcost§ Weneedes+matestobelessthanactualcosts!
A
GS
1 3h=6
h=0
5
h=7
![Page 29: Informed Search - University of Washington€¦ · Informed Search Instructor: Luke Ze@lemoyer University of Washington [These slides were adapted from Dan Klein and Pieter Abbeel](https://reader035.vdocuments.site/reader035/viewer/2022070113/605c2e5204c077356a706466/html5/thumbnails/29.jpg)
AdmissibleHeuris+cs
![Page 30: Informed Search - University of Washington€¦ · Informed Search Instructor: Luke Ze@lemoyer University of Washington [These slides were adapted from Dan Klein and Pieter Abbeel](https://reader035.vdocuments.site/reader035/viewer/2022070113/605c2e5204c077356a706466/html5/thumbnails/30.jpg)
Idea:Admissibility
Inadmissible(pessimis+c)heuris+csbreakop+malityby
trappinggoodplansonthefringe
Admissible(op+mis+c)heuris+csslowdownbadplansbutnever
outweightruecosts
![Page 31: Informed Search - University of Washington€¦ · Informed Search Instructor: Luke Ze@lemoyer University of Washington [These slides were adapted from Dan Klein and Pieter Abbeel](https://reader035.vdocuments.site/reader035/viewer/2022070113/605c2e5204c077356a706466/html5/thumbnails/31.jpg)
AdmissibleHeuris+cs
§ Aheuris+chisadmissible(op+mis+c)if:
whereisthetruecosttoanearestgoal
§ Examples:
§ Comingupwithadmissibleheuris+csismostofwhat’sinvolvedinusingA*inprac+ce.
415
![Page 32: Informed Search - University of Washington€¦ · Informed Search Instructor: Luke Ze@lemoyer University of Washington [These slides were adapted from Dan Klein and Pieter Abbeel](https://reader035.vdocuments.site/reader035/viewer/2022070113/605c2e5204c077356a706466/html5/thumbnails/32.jpg)
Op+malityofA*TreeSearch
![Page 33: Informed Search - University of Washington€¦ · Informed Search Instructor: Luke Ze@lemoyer University of Washington [These slides were adapted from Dan Klein and Pieter Abbeel](https://reader035.vdocuments.site/reader035/viewer/2022070113/605c2e5204c077356a706466/html5/thumbnails/33.jpg)
Op+malityofA*TreeSearch
Assume:§ Aisanop+malgoalnode§ Bisasubop+malgoalnode§ hisadmissible
Claim:§ AwillexitthefringebeforeB
…
![Page 34: Informed Search - University of Washington€¦ · Informed Search Instructor: Luke Ze@lemoyer University of Washington [These slides were adapted from Dan Klein and Pieter Abbeel](https://reader035.vdocuments.site/reader035/viewer/2022070113/605c2e5204c077356a706466/html5/thumbnails/34.jpg)
Op+malityofA*TreeSearch:Blocking
Defini+onoff-costAdmissibilityofh
…
h=0atagoal
Proof:§ ImagineBisonthefringe§ SomeancestornofAisonthefringe,too(maybeA!)
§ Claim:nwillbeexpandedbeforeB1. f(n)islessorequaltof(A)
![Page 35: Informed Search - University of Washington€¦ · Informed Search Instructor: Luke Ze@lemoyer University of Washington [These slides were adapted from Dan Klein and Pieter Abbeel](https://reader035.vdocuments.site/reader035/viewer/2022070113/605c2e5204c077356a706466/html5/thumbnails/35.jpg)
Op+malityofA*TreeSearch:Blocking
Bissubop+malh=0atagoal
…
Proof:§ ImagineBisonthefringe§ SomeancestornofAisonthefringe,too(maybeA!)
§ Claim:nwillbeexpandedbeforeB1. f(n)islessorequaltof(A)2. f(A)islessthanf(B)
![Page 36: Informed Search - University of Washington€¦ · Informed Search Instructor: Luke Ze@lemoyer University of Washington [These slides were adapted from Dan Klein and Pieter Abbeel](https://reader035.vdocuments.site/reader035/viewer/2022070113/605c2e5204c077356a706466/html5/thumbnails/36.jpg)
Op+malityofA*TreeSearch:BlockingProof:§ ImagineBisonthefringe§ SomeancestornofAisonthefringe,too(maybeA!)
§ Claim:nwillbeexpandedbeforeB1. f(n)islessorequaltof(A)2. f(A)islessthanf(B)3. nexpandsbeforeB
§ AllancestorsofAexpandbeforeB§ AexpandsbeforeB§ A*searchisop+mal
…
![Page 37: Informed Search - University of Washington€¦ · Informed Search Instructor: Luke Ze@lemoyer University of Washington [These slides were adapted from Dan Klein and Pieter Abbeel](https://reader035.vdocuments.site/reader035/viewer/2022070113/605c2e5204c077356a706466/html5/thumbnails/37.jpg)
Proper+esofA*
![Page 38: Informed Search - University of Washington€¦ · Informed Search Instructor: Luke Ze@lemoyer University of Washington [These slides were adapted from Dan Klein and Pieter Abbeel](https://reader035.vdocuments.site/reader035/viewer/2022070113/605c2e5204c077356a706466/html5/thumbnails/38.jpg)
Proper+esofA*
…b
…b
Uniform-Cost A*
![Page 39: Informed Search - University of Washington€¦ · Informed Search Instructor: Luke Ze@lemoyer University of Washington [These slides were adapted from Dan Klein and Pieter Abbeel](https://reader035.vdocuments.site/reader035/viewer/2022070113/605c2e5204c077356a706466/html5/thumbnails/39.jpg)
UCSvsA*Contours
§ Uniform-costexpandsequallyinall“direc+ons”
§ A*expandsmainlytowardthegoal,butdoeshedgeitsbetstoensureop+mality
Start Goal
Start Goal
[Demo:contoursUCS/greedy/A*empty(L3D1)][Demo:contoursA*pacmansmallmaze(L3D5)]
![Page 40: Informed Search - University of Washington€¦ · Informed Search Instructor: Luke Ze@lemoyer University of Washington [These slides were adapted from Dan Klein and Pieter Abbeel](https://reader035.vdocuments.site/reader035/viewer/2022070113/605c2e5204c077356a706466/html5/thumbnails/40.jpg)
VideoofDemoContours(Empty)--UCS
![Page 41: Informed Search - University of Washington€¦ · Informed Search Instructor: Luke Ze@lemoyer University of Washington [These slides were adapted from Dan Klein and Pieter Abbeel](https://reader035.vdocuments.site/reader035/viewer/2022070113/605c2e5204c077356a706466/html5/thumbnails/41.jpg)
VideoofDemoContours(Empty)--Greedy
![Page 42: Informed Search - University of Washington€¦ · Informed Search Instructor: Luke Ze@lemoyer University of Washington [These slides were adapted from Dan Klein and Pieter Abbeel](https://reader035.vdocuments.site/reader035/viewer/2022070113/605c2e5204c077356a706466/html5/thumbnails/42.jpg)
VideoofDemoContours(Empty)–A*
![Page 43: Informed Search - University of Washington€¦ · Informed Search Instructor: Luke Ze@lemoyer University of Washington [These slides were adapted from Dan Klein and Pieter Abbeel](https://reader035.vdocuments.site/reader035/viewer/2022070113/605c2e5204c077356a706466/html5/thumbnails/43.jpg)
VideoofDemoContours(PacmanSmallMaze)–A*
![Page 44: Informed Search - University of Washington€¦ · Informed Search Instructor: Luke Ze@lemoyer University of Washington [These slides were adapted from Dan Klein and Pieter Abbeel](https://reader035.vdocuments.site/reader035/viewer/2022070113/605c2e5204c077356a706466/html5/thumbnails/44.jpg)
Comparison
Greedy UniformCost A*
![Page 45: Informed Search - University of Washington€¦ · Informed Search Instructor: Luke Ze@lemoyer University of Washington [These slides were adapted from Dan Klein and Pieter Abbeel](https://reader035.vdocuments.site/reader035/viewer/2022070113/605c2e5204c077356a706466/html5/thumbnails/45.jpg)
A*Applica+ons
§ Videogames§ Pathing/rou+ngproblems§ Resourceplanningproblems§ Robotmo+onplanning§ Languageanalysis§ Machinetransla+on§ Speechrecogni+on§ …
[Demo:UCS/A*pacman+nymaze(L3D6,L3D7)][Demo:guessalgorithmEmptyShallow/Deep(L3D8)]
![Page 46: Informed Search - University of Washington€¦ · Informed Search Instructor: Luke Ze@lemoyer University of Washington [These slides were adapted from Dan Klein and Pieter Abbeel](https://reader035.vdocuments.site/reader035/viewer/2022070113/605c2e5204c077356a706466/html5/thumbnails/46.jpg)
VideoofDemoPacman(TinyMaze)–UCS/A*
![Page 47: Informed Search - University of Washington€¦ · Informed Search Instructor: Luke Ze@lemoyer University of Washington [These slides were adapted from Dan Klein and Pieter Abbeel](https://reader035.vdocuments.site/reader035/viewer/2022070113/605c2e5204c077356a706466/html5/thumbnails/47.jpg)
VideoofDemoEmptyWaterShallow/Deep–GuessAlgorithm
![Page 48: Informed Search - University of Washington€¦ · Informed Search Instructor: Luke Ze@lemoyer University of Washington [These slides were adapted from Dan Klein and Pieter Abbeel](https://reader035.vdocuments.site/reader035/viewer/2022070113/605c2e5204c077356a706466/html5/thumbnails/48.jpg)
Crea+ngHeuris+cs
![Page 49: Informed Search - University of Washington€¦ · Informed Search Instructor: Luke Ze@lemoyer University of Washington [These slides were adapted from Dan Klein and Pieter Abbeel](https://reader035.vdocuments.site/reader035/viewer/2022070113/605c2e5204c077356a706466/html5/thumbnails/49.jpg)
Crea+ngAdmissibleHeuris+cs
§ Mostoftheworkinsolvinghardsearchproblemsop+mallyisincomingupwithadmissibleheuris+cs
§ Oten,admissibleheuris+csaresolu+onstorelaxedproblems,wherenewac+onsareavailable
§ Inadmissibleheuris+csareotenusefultoo
15366
![Page 50: Informed Search - University of Washington€¦ · Informed Search Instructor: Luke Ze@lemoyer University of Washington [These slides were adapted from Dan Klein and Pieter Abbeel](https://reader035.vdocuments.site/reader035/viewer/2022070113/605c2e5204c077356a706466/html5/thumbnails/50.jpg)
Example:8Puzzle
§ Whatarethestates?§ Howmanystates?§ Whataretheac+ons?§ Howmanysuccessorsfromthestartstate?§ Whatshouldthecostsbe?
StartState GoalStateAc+ons
![Page 51: Informed Search - University of Washington€¦ · Informed Search Instructor: Luke Ze@lemoyer University of Washington [These slides were adapted from Dan Klein and Pieter Abbeel](https://reader035.vdocuments.site/reader035/viewer/2022070113/605c2e5204c077356a706466/html5/thumbnails/51.jpg)
8PuzzleI
§ Heuris+c:Numberof+lesmisplaced§ Whyisitadmissible?§ h(start)=§ Thisisarelaxed-problemheuris+c
8
Averagenodesexpandedwhentheop+malpathhas……4steps …8steps …12steps
UCS 112 6,300 3.6x106
TILES 13 39 227
StartState GoalState
Sta+s+csfromAndrewMoore
![Page 52: Informed Search - University of Washington€¦ · Informed Search Instructor: Luke Ze@lemoyer University of Washington [These slides were adapted from Dan Klein and Pieter Abbeel](https://reader035.vdocuments.site/reader035/viewer/2022070113/605c2e5204c077356a706466/html5/thumbnails/52.jpg)
8PuzzleII
§ Whatifwehadaneasier8-puzzlewhereany+lecouldslideanydirec+onatany+me,ignoringother+les?
§ TotalManhaDandistance§ Whyisitadmissible?
§ h(start)= 3+1+2+…=18Averagenodesexpandedwhentheop+malpathhas……4steps …8steps …12steps
TILES 13 39 227MANHATTAN 12 25 73
StartState GoalState
![Page 53: Informed Search - University of Washington€¦ · Informed Search Instructor: Luke Ze@lemoyer University of Washington [These slides were adapted from Dan Klein and Pieter Abbeel](https://reader035.vdocuments.site/reader035/viewer/2022070113/605c2e5204c077356a706466/html5/thumbnails/53.jpg)
8PuzzleIII
§ Howaboutusingtheactualcostasaheuris+c?§ Woulditbeadmissible?§ Wouldwesaveonnodesexpanded?§ What’swrongwithit?
§ WithA*:atrade-offbetweenqualityofes+mateandworkpernode§ Asheuris+csgetclosertothetruecost,youwillexpandfewernodesbutusuallydomoreworkpernodetocomputetheheuris+citself
![Page 54: Informed Search - University of Washington€¦ · Informed Search Instructor: Luke Ze@lemoyer University of Washington [These slides were adapted from Dan Klein and Pieter Abbeel](https://reader035.vdocuments.site/reader035/viewer/2022070113/605c2e5204c077356a706466/html5/thumbnails/54.jpg)
Semi-LawceofHeuris+cs
![Page 55: Informed Search - University of Washington€¦ · Informed Search Instructor: Luke Ze@lemoyer University of Washington [These slides were adapted from Dan Klein and Pieter Abbeel](https://reader035.vdocuments.site/reader035/viewer/2022070113/605c2e5204c077356a706466/html5/thumbnails/55.jpg)
TrivialHeuris+cs,Dominance
§ Dominance:ha≥hcif§ Heuris+csformasemi-lawce:
§ Maxofadmissibleheuris+csisadmissible
§ Trivialheuris+cs§ Bo@omoflawceisthezeroheuris+c(whatdoesthisgiveus?)
§ Topoflawceistheexactheuris+c
![Page 56: Informed Search - University of Washington€¦ · Informed Search Instructor: Luke Ze@lemoyer University of Washington [These slides were adapted from Dan Klein and Pieter Abbeel](https://reader035.vdocuments.site/reader035/viewer/2022070113/605c2e5204c077356a706466/html5/thumbnails/56.jpg)
GraphSearch
![Page 57: Informed Search - University of Washington€¦ · Informed Search Instructor: Luke Ze@lemoyer University of Washington [These slides were adapted from Dan Klein and Pieter Abbeel](https://reader035.vdocuments.site/reader035/viewer/2022070113/605c2e5204c077356a706466/html5/thumbnails/57.jpg)
§ Failuretodetectrepeatedstatescancauseexponen+allymorework.
SearchTreeStateGraph
TreeSearch:ExtraWork!
![Page 58: Informed Search - University of Washington€¦ · Informed Search Instructor: Luke Ze@lemoyer University of Washington [These slides were adapted from Dan Klein and Pieter Abbeel](https://reader035.vdocuments.site/reader035/viewer/2022070113/605c2e5204c077356a706466/html5/thumbnails/58.jpg)
GraphSearch
§ InBFS,forexample,weshouldn’tbotherexpandingthecirclednodes(why?)
S
a
b
d p
a
c
e
p
h
f
r
q
q c G
a
qe
p
h
f
r
q
q c G
a
![Page 59: Informed Search - University of Washington€¦ · Informed Search Instructor: Luke Ze@lemoyer University of Washington [These slides were adapted from Dan Klein and Pieter Abbeel](https://reader035.vdocuments.site/reader035/viewer/2022070113/605c2e5204c077356a706466/html5/thumbnails/59.jpg)
GraphSearch
§ Idea:neverexpandastatetwice§ Howtoimplement:
§ Treesearch+setofexpandedstates(“closedset”)§ Expandthesearchtreenode-by-node,but…§ Beforeexpandinganode,checktomakesureitsstatehasneverbeenexpandedbefore
§ Ifnotnew,skipit,ifnewaddtoclosedset§ Important:storetheclosedsetasaset,notalist§ Cangraphsearchwreckcompleteness?Why/whynot?§ Howaboutop+mality?
![Page 60: Informed Search - University of Washington€¦ · Informed Search Instructor: Luke Ze@lemoyer University of Washington [These slides were adapted from Dan Klein and Pieter Abbeel](https://reader035.vdocuments.site/reader035/viewer/2022070113/605c2e5204c077356a706466/html5/thumbnails/60.jpg)
A*GraphSearchGoneWrong?
S
A
B
C
G
1
1
1
23
h=2
h=1
h=4
h=1
h=0
S(0+2)
A(1+4) B(1+1)
C(2+1)
G(5+0)
C(3+1)
G(6+0)
Statespacegraph Searchtree
![Page 61: Informed Search - University of Washington€¦ · Informed Search Instructor: Luke Ze@lemoyer University of Washington [These slides were adapted from Dan Klein and Pieter Abbeel](https://reader035.vdocuments.site/reader035/viewer/2022070113/605c2e5204c077356a706466/html5/thumbnails/61.jpg)
ConsistencyofHeuris+cs
§ Mainidea:heuris+ccosts≤actualcosts§ Admissibility:heuris+ccost≤actualcosttogoal h(A)≤actualcostfromAtoG
§ Consistency:heuris+c“arc”cost≤actualcostforeacharc h(A)–h(C)≤cost(AtoC)
§ Consequencesofconsistency:§ Thefvaluealongapathneverdecreases h(A)≤cost(AtoC)+h(C)
§ A*graphsearchisop+mal
3
A
C
G
h=4 h=11
h=2
![Page 62: Informed Search - University of Washington€¦ · Informed Search Instructor: Luke Ze@lemoyer University of Washington [These slides were adapted from Dan Klein and Pieter Abbeel](https://reader035.vdocuments.site/reader035/viewer/2022070113/605c2e5204c077356a706466/html5/thumbnails/62.jpg)
Op+malityofA*GraphSearch
![Page 63: Informed Search - University of Washington€¦ · Informed Search Instructor: Luke Ze@lemoyer University of Washington [These slides were adapted from Dan Klein and Pieter Abbeel](https://reader035.vdocuments.site/reader035/viewer/2022070113/605c2e5204c077356a706466/html5/thumbnails/63.jpg)
Op+malityofA*GraphSearch
§ Sketch:considerwhatA*doeswithaconsistentheuris+c:§ Fact1:Intreesearch,A*expandsnodesinincreasingtotalfvalue(f-contours)
§ Fact2:Foreverystates,pathsthatreachsop+mallyareexpandedbeforepathsthatreachssubop+mally
§ Result:A*graphsearchisop+mal
…
f≤3
f≤2
f≤1
![Page 64: Informed Search - University of Washington€¦ · Informed Search Instructor: Luke Ze@lemoyer University of Washington [These slides were adapted from Dan Klein and Pieter Abbeel](https://reader035.vdocuments.site/reader035/viewer/2022070113/605c2e5204c077356a706466/html5/thumbnails/64.jpg)
Op+mality
§ Treesearch:§ A*isop+malifheuris+cisadmissible§ UCSisaspecialcase(h=0)
§ Graphsearch:§ A*op+malifheuris+cisconsistent§ UCSop+mal(h=0isconsistent)
§ Consistencyimpliesadmissibility
§ Ingeneral,mostnaturaladmissibleheuris+cstendtobeconsistent,especiallyiffromrelaxedproblems
![Page 65: Informed Search - University of Washington€¦ · Informed Search Instructor: Luke Ze@lemoyer University of Washington [These slides were adapted from Dan Klein and Pieter Abbeel](https://reader035.vdocuments.site/reader035/viewer/2022070113/605c2e5204c077356a706466/html5/thumbnails/65.jpg)
A*:Summary
![Page 66: Informed Search - University of Washington€¦ · Informed Search Instructor: Luke Ze@lemoyer University of Washington [These slides were adapted from Dan Klein and Pieter Abbeel](https://reader035.vdocuments.site/reader035/viewer/2022070113/605c2e5204c077356a706466/html5/thumbnails/66.jpg)
A*:Summary
§ A*usesbothbackwardcostsand(es+matesof)forwardcosts
§ A*isop+malwithadmissible/consistentheuris+cs
§ Heuris+cdesigniskey:otenuserelaxedproblems
![Page 67: Informed Search - University of Washington€¦ · Informed Search Instructor: Luke Ze@lemoyer University of Washington [These slides were adapted from Dan Klein and Pieter Abbeel](https://reader035.vdocuments.site/reader035/viewer/2022070113/605c2e5204c077356a706466/html5/thumbnails/67.jpg)
TreeSearchPseudo-Code
![Page 68: Informed Search - University of Washington€¦ · Informed Search Instructor: Luke Ze@lemoyer University of Washington [These slides were adapted from Dan Klein and Pieter Abbeel](https://reader035.vdocuments.site/reader035/viewer/2022070113/605c2e5204c077356a706466/html5/thumbnails/68.jpg)
GraphSearchPseudo-Code