![Page 1: Informed Search - University of Texas at Austinsniekum/classes/343-S19/lectures/lecture4.pdf · Informed Search. Search Heuristics A heuristic is: A function that estimates how close](https://reader034.vdocuments.site/reader034/viewer/2022050413/5f89f954e57c990f2a521868/html5/thumbnails/1.jpg)
CS343:ArtificialIntelligenceInformedSearch
Prof.ScottNiekum
UniversityofTexasatAustin[TheseslidesbasedononescreatedbyDanKleinandPieterAbbeelforCS188IntrotoAIatUCBerkeley.AllCS188materialsareavailableathttp://ai.berkeley.edu.]
![Page 2: Informed Search - University of Texas at Austinsniekum/classes/343-S19/lectures/lecture4.pdf · Informed Search. Search Heuristics A heuristic is: A function that estimates how close](https://reader034.vdocuments.site/reader034/viewer/2022050413/5f89f954e57c990f2a521868/html5/thumbnails/2.jpg)
Today
▪ InformedSearch▪Heuristics▪GreedySearch▪ A*Search
▪ GraphSearch
![Page 3: Informed Search - University of Texas at Austinsniekum/classes/343-S19/lectures/lecture4.pdf · Informed Search. Search Heuristics A heuristic is: A function that estimates how close](https://reader034.vdocuments.site/reader034/viewer/2022050413/5f89f954e57c990f2a521868/html5/thumbnails/3.jpg)
Recap:Search
▪ Searchproblem:▪ States(configurationsoftheworld)▪ Actionsandcosts▪ Successorfunction(worlddynamics)▪ Startstateandgoaltest
▪ Searchtree:▪ Nodes:representplansforreachingstates▪ Planshavecosts(sumofactioncosts)
▪ Searchalgorithm:▪ Systematicallybuildsasearchtree▪ Choosesanorderingofthefringe(unexplorednodes)▪ Optimal:findsleast-costplans
![Page 4: Informed Search - University of Texas at Austinsniekum/classes/343-S19/lectures/lecture4.pdf · Informed Search. Search Heuristics A heuristic is: A function that estimates how close](https://reader034.vdocuments.site/reader034/viewer/2022050413/5f89f954e57c990f2a521868/html5/thumbnails/4.jpg)
Example:PancakeProblem
Cost:Numberofpancakesflipped
![Page 5: Informed Search - University of Texas at Austinsniekum/classes/343-S19/lectures/lecture4.pdf · Informed Search. Search Heuristics A heuristic is: A function that estimates how close](https://reader034.vdocuments.site/reader034/viewer/2022050413/5f89f954e57c990f2a521868/html5/thumbnails/5.jpg)
Example:PancakeProblem
3
2
4
3
3
2
2
2
4
Statespacegraphwithcostsasweights
34
3
4
2
![Page 6: Informed Search - University of Texas at Austinsniekum/classes/343-S19/lectures/lecture4.pdf · Informed Search. Search Heuristics A heuristic is: A function that estimates how close](https://reader034.vdocuments.site/reader034/viewer/2022050413/5f89f954e57c990f2a521868/html5/thumbnails/6.jpg)
GeneralTreeSearch
Action:fliptoptwo Cost:2
Action:flipallfourCost:4Pathtoreachgoal:Flipfour,flipthree
Totalcost:7
![Page 7: Informed Search - University of Texas at Austinsniekum/classes/343-S19/lectures/lecture4.pdf · Informed Search. Search Heuristics A heuristic is: A function that estimates how close](https://reader034.vdocuments.site/reader034/viewer/2022050413/5f89f954e57c990f2a521868/html5/thumbnails/7.jpg)
TheOneQueue
▪ Allthesesearchalgorithmsarethesameexceptforfringestrategies
▪ Conceptually,allfringesarepriorityqueues(i.e.collectionsofnodeswithattachedpriorities)
▪ Practically,forDFSandBFS,youcanavoidthelog(n)overheadfromanactualpriorityqueue,byusingstacksandqueues
▪ Canevencodeoneimplementationthattakesavariablequeuingobject
![Page 8: Informed Search - University of Texas at Austinsniekum/classes/343-S19/lectures/lecture4.pdf · Informed Search. Search Heuristics A heuristic is: A function that estimates how close](https://reader034.vdocuments.site/reader034/viewer/2022050413/5f89f954e57c990f2a521868/html5/thumbnails/8.jpg)
UninformedSearch
![Page 9: Informed Search - University of Texas at Austinsniekum/classes/343-S19/lectures/lecture4.pdf · Informed Search. Search Heuristics A heuristic is: A function that estimates how close](https://reader034.vdocuments.site/reader034/viewer/2022050413/5f89f954e57c990f2a521868/html5/thumbnails/9.jpg)
UniformCostSearch
▪ Strategy:expandlowestpathcost
▪ Thegood:UCSiscompleteandoptimal!
▪ Thebad:▪ Exploresoptionsinevery“direction”▪ Noinformationaboutgoallocation
Start Goal
…
c ≤ 3
c ≤ 2
c ≤ 1
![Page 10: Informed Search - University of Texas at Austinsniekum/classes/343-S19/lectures/lecture4.pdf · Informed Search. Search Heuristics A heuristic is: A function that estimates how close](https://reader034.vdocuments.site/reader034/viewer/2022050413/5f89f954e57c990f2a521868/html5/thumbnails/10.jpg)
VideoofDemoContoursUCSEmpty
![Page 11: Informed Search - University of Texas at Austinsniekum/classes/343-S19/lectures/lecture4.pdf · Informed Search. Search Heuristics A heuristic is: A function that estimates how close](https://reader034.vdocuments.site/reader034/viewer/2022050413/5f89f954e57c990f2a521868/html5/thumbnails/11.jpg)
VideoofDemoContoursUCSPacmanSmallMaze
![Page 12: Informed Search - University of Texas at Austinsniekum/classes/343-S19/lectures/lecture4.pdf · Informed Search. Search Heuristics A heuristic is: A function that estimates how close](https://reader034.vdocuments.site/reader034/viewer/2022050413/5f89f954e57c990f2a521868/html5/thumbnails/12.jpg)
InformedSearch
![Page 13: Informed Search - University of Texas at Austinsniekum/classes/343-S19/lectures/lecture4.pdf · Informed Search. Search Heuristics A heuristic is: A function that estimates how close](https://reader034.vdocuments.site/reader034/viewer/2022050413/5f89f954e57c990f2a521868/html5/thumbnails/13.jpg)
SearchHeuristics
▪ Aheuristicis:▪ Afunctionthatestimateshowcloseastateistoagoal
▪ Designedforaparticularsearchproblem
▪ Examples:Manhattandistance,Euclideandistanceforpathing
10
5
11.2
![Page 14: Informed Search - University of Texas at Austinsniekum/classes/343-S19/lectures/lecture4.pdf · Informed Search. Search Heuristics A heuristic is: A function that estimates how close](https://reader034.vdocuments.site/reader034/viewer/2022050413/5f89f954e57c990f2a521868/html5/thumbnails/14.jpg)
Example:HeuristicFunction
h(x)
![Page 15: Informed Search - University of Texas at Austinsniekum/classes/343-S19/lectures/lecture4.pdf · Informed Search. Search Heuristics A heuristic is: A function that estimates how close](https://reader034.vdocuments.site/reader034/viewer/2022050413/5f89f954e57c990f2a521868/html5/thumbnails/15.jpg)
Example:HeuristicFunction
Heuristic:thenumberofthelargestpancakethatisstilloutofplace
43
0
2
3
3
3
4
4
3
4
4
4
h(x)
![Page 16: Informed Search - University of Texas at Austinsniekum/classes/343-S19/lectures/lecture4.pdf · Informed Search. Search Heuristics A heuristic is: A function that estimates how close](https://reader034.vdocuments.site/reader034/viewer/2022050413/5f89f954e57c990f2a521868/html5/thumbnails/16.jpg)
GreedySearch
![Page 17: Informed Search - University of Texas at Austinsniekum/classes/343-S19/lectures/lecture4.pdf · Informed Search. Search Heuristics A heuristic is: A function that estimates how close](https://reader034.vdocuments.site/reader034/viewer/2022050413/5f89f954e57c990f2a521868/html5/thumbnails/17.jpg)
Example:HeuristicFunction
h(x)
![Page 18: Informed Search - University of Texas at Austinsniekum/classes/343-S19/lectures/lecture4.pdf · Informed Search. Search Heuristics A heuristic is: A function that estimates how close](https://reader034.vdocuments.site/reader034/viewer/2022050413/5f89f954e57c990f2a521868/html5/thumbnails/18.jpg)
GreedySearch
▪ Expandthenodethatseemsclosest…
▪ Whatcangowrong?
![Page 19: Informed Search - University of Texas at Austinsniekum/classes/343-S19/lectures/lecture4.pdf · Informed Search. Search Heuristics A heuristic is: A function that estimates how close](https://reader034.vdocuments.site/reader034/viewer/2022050413/5f89f954e57c990f2a521868/html5/thumbnails/19.jpg)
GreedySearch
▪ Strategy:expandanodethatyouthinkisclosesttoagoalstate▪ Heuristic:estimateofdistancetonearestgoalforeachstate
▪ Bestcase:▪ Best-firsttakesyoustraighttothenearestgoal
▪ Acommoncase:▪ Suboptimalroutetogoalduetoimperfectheuristic▪ Doesnotleadtonearestgoal
▪ Worst-case:likeabadly-guidedDFS
…b
…b
![Page 20: Informed Search - University of Texas at Austinsniekum/classes/343-S19/lectures/lecture4.pdf · Informed Search. Search Heuristics A heuristic is: A function that estimates how close](https://reader034.vdocuments.site/reader034/viewer/2022050413/5f89f954e57c990f2a521868/html5/thumbnails/20.jpg)
VideoofDemoContoursGreedy(Empty)
![Page 21: Informed Search - University of Texas at Austinsniekum/classes/343-S19/lectures/lecture4.pdf · Informed Search. Search Heuristics A heuristic is: A function that estimates how close](https://reader034.vdocuments.site/reader034/viewer/2022050413/5f89f954e57c990f2a521868/html5/thumbnails/21.jpg)
VideoofDemoContoursGreedy(PacmanSmallMaze)
![Page 22: Informed Search - University of Texas at Austinsniekum/classes/343-S19/lectures/lecture4.pdf · Informed Search. Search Heuristics A heuristic is: A function that estimates how close](https://reader034.vdocuments.site/reader034/viewer/2022050413/5f89f954e57c990f2a521868/html5/thumbnails/22.jpg)
A*Search
![Page 23: Informed Search - University of Texas at Austinsniekum/classes/343-S19/lectures/lecture4.pdf · Informed Search. Search Heuristics A heuristic is: A function that estimates how close](https://reader034.vdocuments.site/reader034/viewer/2022050413/5f89f954e57c990f2a521868/html5/thumbnails/23.jpg)
A*Search
UCS Greedy
A*
![Page 24: Informed Search - University of Texas at Austinsniekum/classes/343-S19/lectures/lecture4.pdf · Informed Search. Search Heuristics A heuristic is: A function that estimates how close](https://reader034.vdocuments.site/reader034/viewer/2022050413/5f89f954e57c990f2a521868/html5/thumbnails/24.jpg)
▪ Uniform-costordersbypathcost,orbackwardcostg(n)▪ Greedyordersbygoalproximity,orforwardcosth(n)
▪ A*Searchordersbythesum:f(n)=g(n)+h(n)
CombiningUCSandGreedy
S a d
b
Gh=5
h=6
h=2
1
8
11
2
h=6h=0
c
h=7
3
e h=11
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 25: Informed Search - University of Texas at Austinsniekum/classes/343-S19/lectures/lecture4.pdf · Informed Search. Search Heuristics A heuristic is: A function that estimates how close](https://reader034.vdocuments.site/reader034/viewer/2022050413/5f89f954e57c990f2a521868/html5/thumbnails/25.jpg)
WhenshouldA*terminate?
▪ Shouldwestopwhenweenqueueagoal?
S
B
A
G
2
3
2
2h=1
h=2
h=0h=3
▪ No:onlystopwhenweexpandagoal
![Page 26: Informed Search - University of Texas at Austinsniekum/classes/343-S19/lectures/lecture4.pdf · Informed Search. Search Heuristics A heuristic is: A function that estimates how close](https://reader034.vdocuments.site/reader034/viewer/2022050413/5f89f954e57c990f2a521868/html5/thumbnails/26.jpg)
IsA*Optimal?
▪ WhatwillA*dohere?
▪ Whatwentwrong?
▪ Actualbadgoalcost<estimatedgoodgoalcost
▪ Weneedestimatestobelessthanactualcosts!
A
GS
1 3
h=6
h=0
5h=7
![Page 27: Informed Search - University of Texas at Austinsniekum/classes/343-S19/lectures/lecture4.pdf · Informed Search. Search Heuristics A heuristic is: A function that estimates how close](https://reader034.vdocuments.site/reader034/viewer/2022050413/5f89f954e57c990f2a521868/html5/thumbnails/27.jpg)
Idea:Admissibility
Inadmissible(pessimistic)heuristicsbreakoptimalitybytrappinggoodplansonthefringe
Admissible(optimistic)heuristicscanstillhelptodelaytheevaluationofbadplans,butnever
overestimatethetruecosts
![Page 28: Informed Search - University of Texas at Austinsniekum/classes/343-S19/lectures/lecture4.pdf · Informed Search. Search Heuristics A heuristic is: A function that estimates how close](https://reader034.vdocuments.site/reader034/viewer/2022050413/5f89f954e57c990f2a521868/html5/thumbnails/28.jpg)
AdmissibleHeuristics
▪ Aheuristichisadmissible(optimistic)if:
whereisthetruecosttoanearestgoal
▪ Examples:
▪ Comingupwithadmissibleheuristicsismostofwhat’sinvolvedinusingA*inpractice.
415
![Page 29: Informed Search - University of Texas at Austinsniekum/classes/343-S19/lectures/lecture4.pdf · Informed Search. Search Heuristics A heuristic is: A function that estimates how close](https://reader034.vdocuments.site/reader034/viewer/2022050413/5f89f954e57c990f2a521868/html5/thumbnails/29.jpg)
OptimalityofA*TreeSearch
![Page 30: Informed Search - University of Texas at Austinsniekum/classes/343-S19/lectures/lecture4.pdf · Informed Search. Search Heuristics A heuristic is: A function that estimates how close](https://reader034.vdocuments.site/reader034/viewer/2022050413/5f89f954e57c990f2a521868/html5/thumbnails/30.jpg)
OptimalityofA*TreeSearch
Assume:
▪ Aisanoptimalgoalnode
▪ Bisasuboptimalgoalnode
▪ hisadmissible
Claim:
▪ AwillexitthefringebeforeB
…
![Page 31: Informed Search - University of Texas at Austinsniekum/classes/343-S19/lectures/lecture4.pdf · Informed Search. Search Heuristics A heuristic is: A function that estimates how close](https://reader034.vdocuments.site/reader034/viewer/2022050413/5f89f954e57c990f2a521868/html5/thumbnails/31.jpg)
OptimalityofA*TreeSearch:Blocking
Proof:
▪ ImagineBisonthefringe
▪ SomeancestornofAisonthefringe,too(maybeA!)
▪ Claim:nwillbeexpandedbeforeB
1. f(n)islessorequaltof(A)
Definitionoff-costAdmissibilityofh
…
h=0atagoal
![Page 32: Informed Search - University of Texas at Austinsniekum/classes/343-S19/lectures/lecture4.pdf · Informed Search. Search Heuristics A heuristic is: A function that estimates how close](https://reader034.vdocuments.site/reader034/viewer/2022050413/5f89f954e57c990f2a521868/html5/thumbnails/32.jpg)
OptimalityofA*TreeSearch:Blocking
Proof:
▪ ImagineBisonthefringe
▪ SomeancestornofAisonthefringe,too(maybeA!)
▪ Claim:nwillbeexpandedbeforeB
1. f(n)islessorequaltof(A)2. f(A)islessthanf(B)
Bissuboptimalh=0atagoal
…
![Page 33: Informed Search - University of Texas at Austinsniekum/classes/343-S19/lectures/lecture4.pdf · Informed Search. Search Heuristics A heuristic is: A function that estimates how close](https://reader034.vdocuments.site/reader034/viewer/2022050413/5f89f954e57c990f2a521868/html5/thumbnails/33.jpg)
OptimalityofA*TreeSearch:Blocking
Proof:
▪ ImagineBisonthefringe
▪ SomeancestornofAisonthefringe,too(maybeA!)
▪ Claim:nwillbeexpandedbeforeB
1. f(n)islessorequaltof(A)2. f(A)islessthanf(B)3. nexpandsbeforeB
▪ AllancestorsofAexpandbeforeB
▪ AexpandsbeforeB
▪ A*searchisoptimal
…
![Page 34: Informed Search - University of Texas at Austinsniekum/classes/343-S19/lectures/lecture4.pdf · Informed Search. Search Heuristics A heuristic is: A function that estimates how close](https://reader034.vdocuments.site/reader034/viewer/2022050413/5f89f954e57c990f2a521868/html5/thumbnails/34.jpg)
PropertiesofA*
![Page 35: Informed Search - University of Texas at Austinsniekum/classes/343-S19/lectures/lecture4.pdf · Informed Search. Search Heuristics A heuristic is: A function that estimates how close](https://reader034.vdocuments.site/reader034/viewer/2022050413/5f89f954e57c990f2a521868/html5/thumbnails/35.jpg)
PropertiesofA*
…b
…b
Uniform-Cost A*
![Page 36: Informed Search - University of Texas at Austinsniekum/classes/343-S19/lectures/lecture4.pdf · Informed Search. Search Heuristics A heuristic is: A function that estimates how close](https://reader034.vdocuments.site/reader034/viewer/2022050413/5f89f954e57c990f2a521868/html5/thumbnails/36.jpg)
UCSvsA*Contours
▪ Uniform-costexpandsequallyinall“directions”
▪ A*expandsmainlytowardthegoal,butdoeshedgeitsbetstoensureoptimality
Start Goal
Start Goal
![Page 37: Informed Search - University of Texas at Austinsniekum/classes/343-S19/lectures/lecture4.pdf · Informed Search. Search Heuristics A heuristic is: A function that estimates how close](https://reader034.vdocuments.site/reader034/viewer/2022050413/5f89f954e57c990f2a521868/html5/thumbnails/37.jpg)
VideoofDemoContours(Empty)--UCS
![Page 38: Informed Search - University of Texas at Austinsniekum/classes/343-S19/lectures/lecture4.pdf · Informed Search. Search Heuristics A heuristic is: A function that estimates how close](https://reader034.vdocuments.site/reader034/viewer/2022050413/5f89f954e57c990f2a521868/html5/thumbnails/38.jpg)
VideoofDemoContours(Empty)--Greedy
![Page 39: Informed Search - University of Texas at Austinsniekum/classes/343-S19/lectures/lecture4.pdf · Informed Search. Search Heuristics A heuristic is: A function that estimates how close](https://reader034.vdocuments.site/reader034/viewer/2022050413/5f89f954e57c990f2a521868/html5/thumbnails/39.jpg)
VideoofDemoContours(Empty)–A*
![Page 40: Informed Search - University of Texas at Austinsniekum/classes/343-S19/lectures/lecture4.pdf · Informed Search. Search Heuristics A heuristic is: A function that estimates how close](https://reader034.vdocuments.site/reader034/viewer/2022050413/5f89f954e57c990f2a521868/html5/thumbnails/40.jpg)
Pacman-A*
![Page 41: Informed Search - University of Texas at Austinsniekum/classes/343-S19/lectures/lecture4.pdf · Informed Search. Search Heuristics A heuristic is: A function that estimates how close](https://reader034.vdocuments.site/reader034/viewer/2022050413/5f89f954e57c990f2a521868/html5/thumbnails/41.jpg)
Pacman-Greedy
![Page 42: Informed Search - University of Texas at Austinsniekum/classes/343-S19/lectures/lecture4.pdf · Informed Search. Search Heuristics A heuristic is: A function that estimates how close](https://reader034.vdocuments.site/reader034/viewer/2022050413/5f89f954e57c990f2a521868/html5/thumbnails/42.jpg)
Pacman-UCS
![Page 43: Informed Search - University of Texas at Austinsniekum/classes/343-S19/lectures/lecture4.pdf · Informed Search. Search Heuristics A heuristic is: A function that estimates how close](https://reader034.vdocuments.site/reader034/viewer/2022050413/5f89f954e57c990f2a521868/html5/thumbnails/43.jpg)
Comparison
Greedy UniformCost A*
![Page 44: Informed Search - University of Texas at Austinsniekum/classes/343-S19/lectures/lecture4.pdf · Informed Search. Search Heuristics A heuristic is: A function that estimates how close](https://reader034.vdocuments.site/reader034/viewer/2022050413/5f89f954e57c990f2a521868/html5/thumbnails/44.jpg)
Guessalgorithm(DFS/BFS/UCS/Greedy/A*)
![Page 45: Informed Search - University of Texas at Austinsniekum/classes/343-S19/lectures/lecture4.pdf · Informed Search. Search Heuristics A heuristic is: A function that estimates how close](https://reader034.vdocuments.site/reader034/viewer/2022050413/5f89f954e57c990f2a521868/html5/thumbnails/45.jpg)
Guessalgorithm(DFS/BFS/UCS/Greedy/A*)
![Page 46: Informed Search - University of Texas at Austinsniekum/classes/343-S19/lectures/lecture4.pdf · Informed Search. Search Heuristics A heuristic is: A function that estimates how close](https://reader034.vdocuments.site/reader034/viewer/2022050413/5f89f954e57c990f2a521868/html5/thumbnails/46.jpg)
Guessalgorithm(DFS/BFS/UCS/Greedy/A*)
![Page 47: Informed Search - University of Texas at Austinsniekum/classes/343-S19/lectures/lecture4.pdf · Informed Search. Search Heuristics A heuristic is: A function that estimates how close](https://reader034.vdocuments.site/reader034/viewer/2022050413/5f89f954e57c990f2a521868/html5/thumbnails/47.jpg)
Guessalgorithm(DFS/BFS/UCS/Greedy/A*)
![Page 48: Informed Search - University of Texas at Austinsniekum/classes/343-S19/lectures/lecture4.pdf · Informed Search. Search Heuristics A heuristic is: A function that estimates how close](https://reader034.vdocuments.site/reader034/viewer/2022050413/5f89f954e57c990f2a521868/html5/thumbnails/48.jpg)
Guessalgorithm(DFS/BFS/UCS/Greedy/A*)
![Page 49: Informed Search - University of Texas at Austinsniekum/classes/343-S19/lectures/lecture4.pdf · Informed Search. Search Heuristics A heuristic is: A function that estimates how close](https://reader034.vdocuments.site/reader034/viewer/2022050413/5f89f954e57c990f2a521868/html5/thumbnails/49.jpg)
A*Applications
▪ Videogames
▪ Pathing/routingproblems
▪ Resourceplanningproblems
▪ Robotmotionplanning
▪ Languageanalysis▪ Machinetranslation
▪ Speechrecognition▪ …
![Page 50: Informed Search - University of Texas at Austinsniekum/classes/343-S19/lectures/lecture4.pdf · Informed Search. Search Heuristics A heuristic is: A function that estimates how close](https://reader034.vdocuments.site/reader034/viewer/2022050413/5f89f954e57c990f2a521868/html5/thumbnails/50.jpg)
CreatingAdmissibleHeuristics
▪ Mostoftheworkinsolvinghardsearchproblemsoptimallyisincomingupwithadmissibleheuristics
▪ Often,admissibleheuristicsaresolutionstorelaxedproblems,wherenewactionsareavailable
▪ Inadmissibleheuristicsareoftenusefultoo
15366
![Page 51: Informed Search - University of Texas at Austinsniekum/classes/343-S19/lectures/lecture4.pdf · Informed Search. Search Heuristics A heuristic is: A function that estimates how close](https://reader034.vdocuments.site/reader034/viewer/2022050413/5f89f954e57c990f2a521868/html5/thumbnails/51.jpg)
Example:8Puzzle
▪ Whatarethestates?▪ Howmanystates?▪ Whataretheactions?▪ Howmanysuccessorsfromthestartstate?▪ Whatshouldthecostsbe?
StartState GoalStateActions
![Page 52: Informed Search - University of Texas at Austinsniekum/classes/343-S19/lectures/lecture4.pdf · Informed Search. Search Heuristics A heuristic is: A function that estimates how close](https://reader034.vdocuments.site/reader034/viewer/2022050413/5f89f954e57c990f2a521868/html5/thumbnails/52.jpg)
8PuzzleI
▪ Heuristic:Numberoftilesmisplaced
▪ Whyisitadmissible?
▪ h(start)=
▪ Thisisarelaxed-problemheuristic
8
Averagenodesexpandedwhentheoptimalpathhas…
…4steps …8steps …12steps
UCS 112 6,300 3.6x106
TILES 13 39 227
StartState GoalState
![Page 53: Informed Search - University of Texas at Austinsniekum/classes/343-S19/lectures/lecture4.pdf · Informed Search. Search Heuristics A heuristic is: A function that estimates how close](https://reader034.vdocuments.site/reader034/viewer/2022050413/5f89f954e57c990f2a521868/html5/thumbnails/53.jpg)
8PuzzleII
▪ Whatifwehadaneasier8-puzzlewhereanytilecouldslideanydirectionatanytime,ignoringothertiles?
▪ TotalManhattandistance
▪ Whyisitadmissible?
▪ h(start)= 3+1+2+…=18
Averagenodesexpandedwhentheoptimalpathhas…
…4steps …8steps …12steps
TILES 13 39 227
MANHATTAN 12 25 73
StartState GoalState
![Page 54: Informed Search - University of Texas at Austinsniekum/classes/343-S19/lectures/lecture4.pdf · Informed Search. Search Heuristics A heuristic is: A function that estimates how close](https://reader034.vdocuments.site/reader034/viewer/2022050413/5f89f954e57c990f2a521868/html5/thumbnails/54.jpg)
8PuzzleIII
▪ Howaboutusingtheactualcostasaheuristic?▪ Woulditbeadmissible?▪ Wouldwesaveonnodesexpanded?▪ What’swrongwithit?
▪ WithA*:atrade-offbetweenqualityofestimateandworkpernode▪ Asheuristicsgetclosertothetruecost,youwillexpandfewernodesbutusuallydomoreworkpernodetocomputetheheuristicitself
![Page 55: Informed Search - University of Texas at Austinsniekum/classes/343-S19/lectures/lecture4.pdf · Informed Search. Search Heuristics A heuristic is: A function that estimates how close](https://reader034.vdocuments.site/reader034/viewer/2022050413/5f89f954e57c990f2a521868/html5/thumbnails/55.jpg)
TrivialHeuristics,Dominance
▪ Dominance:ha≥hcif
▪ Heuristicsformasemi-lattice:▪ Maxofadmissibleheuristicsisadmissible
▪ Trivialheuristics▪ Bottomoflatticeisthezeroheuristic(what
doesthisgiveus?)▪ Topoflatticeistheexactheuristic
![Page 56: Informed Search - University of Texas at Austinsniekum/classes/343-S19/lectures/lecture4.pdf · Informed Search. Search Heuristics A heuristic is: A function that estimates how close](https://reader034.vdocuments.site/reader034/viewer/2022050413/5f89f954e57c990f2a521868/html5/thumbnails/56.jpg)
GraphSearch
![Page 57: Informed Search - University of Texas at Austinsniekum/classes/343-S19/lectures/lecture4.pdf · Informed Search. Search Heuristics A heuristic is: A function that estimates how close](https://reader034.vdocuments.site/reader034/viewer/2022050413/5f89f954e57c990f2a521868/html5/thumbnails/57.jpg)
▪ Failuretodetectrepeatedstatescancauseexponentiallymorework.
SearchTreeStateGraph
TreeSearch:ExtraWork!
![Page 58: Informed Search - University of Texas at Austinsniekum/classes/343-S19/lectures/lecture4.pdf · Informed Search. Search Heuristics A heuristic is: A function that estimates how close](https://reader034.vdocuments.site/reader034/viewer/2022050413/5f89f954e57c990f2a521868/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 Texas at Austinsniekum/classes/343-S19/lectures/lecture4.pdf · Informed Search. Search Heuristics A heuristic is: A function that estimates how close](https://reader034.vdocuments.site/reader034/viewer/2022050413/5f89f954e57c990f2a521868/html5/thumbnails/59.jpg)
GraphSearch
▪ Idea:neverexpandastatetwice
▪ Howtoimplement:
▪ Treesearch+setofexpandedstates(“closedset”)▪ Expandthesearchtreenode-by-node,but…▪ Beforeexpandinganode,checktomakesureitsstatehasneverbeen
expandedbefore▪ Ifnotnew,skipit,ifnewaddtoclosedset
▪ Important:storetheclosedsetasaset,notalist
▪ Cangraphsearchwreckcompleteness?Why/whynot?
▪ Howaboutoptimality?
![Page 60: Informed Search - University of Texas at Austinsniekum/classes/343-S19/lectures/lecture4.pdf · Informed Search. Search Heuristics A heuristic is: A function that estimates how close](https://reader034.vdocuments.site/reader034/viewer/2022050413/5f89f954e57c990f2a521868/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 Texas at Austinsniekum/classes/343-S19/lectures/lecture4.pdf · Informed Search. Search Heuristics A heuristic is: A function that estimates how close](https://reader034.vdocuments.site/reader034/viewer/2022050413/5f89f954e57c990f2a521868/html5/thumbnails/61.jpg)
ConsistencyofHeuristics
▪ Mainidea:estimatedheuristiccosts≤actualcosts
▪ Admissibility:heuristiccost≤actualcosttogoal
h(A)≤actualcostfromAtoG
▪ Consistency:heuristic“arc”cost≤actualcostforeacharc
h(A)–h(C)≤cost(AtoC)
i.e.ifthetruecostofanedgefromAtoCisX,thentheh-valueshouldnot
decreasebymorethanXbetweenAandC.
▪ Consequencesofconsistency:
▪ Thefvaluealongapathneverdecreases
h(A)≤cost(AtoC)+h(C)
▪ A*graphsearchisoptimal
3
A
C
G
h=4 h=11
h=2
![Page 62: Informed Search - University of Texas at Austinsniekum/classes/343-S19/lectures/lecture4.pdf · Informed Search. Search Heuristics A heuristic is: A function that estimates how close](https://reader034.vdocuments.site/reader034/viewer/2022050413/5f89f954e57c990f2a521868/html5/thumbnails/62.jpg)
OptimalityofA*GraphSearch
▪ Sketch:considerwhatA*doeswithaconsistentheuristic:
▪ Fact1:Intreesearch,A*expandsnodesinincreasingtotalfvalue(f-contours)
▪ Fact2:Foreverystates,nodesthatreachsoptimallyareexpandedbeforenodesthatreachssuboptimally
▪ Result:A*graphsearchisoptimal
…
f≤ 3
f≤ 2
f≤ 1
![Page 63: Informed Search - University of Texas at Austinsniekum/classes/343-S19/lectures/lecture4.pdf · Informed Search. Search Heuristics A heuristic is: A function that estimates how close](https://reader034.vdocuments.site/reader034/viewer/2022050413/5f89f954e57c990f2a521868/html5/thumbnails/63.jpg)
Optimality
▪ Treesearch:▪ A*isoptimalifheuristicisadmissible▪ UCSisaspecialcase(h=0)
▪ Graphsearch:▪ A*optimalifheuristicisconsistent▪ UCSoptimal(h=0isconsistent)
▪ Consistencyimpliesadmissibility
▪ Ingeneral,mostnaturaladmissibleheuristicstendtobeconsistent,especiallyiffromrelaxedproblems
![Page 64: Informed Search - University of Texas at Austinsniekum/classes/343-S19/lectures/lecture4.pdf · Informed Search. Search Heuristics A heuristic is: A function that estimates how close](https://reader034.vdocuments.site/reader034/viewer/2022050413/5f89f954e57c990f2a521868/html5/thumbnails/64.jpg)
A*:Summary
![Page 65: Informed Search - University of Texas at Austinsniekum/classes/343-S19/lectures/lecture4.pdf · Informed Search. Search Heuristics A heuristic is: A function that estimates how close](https://reader034.vdocuments.site/reader034/viewer/2022050413/5f89f954e57c990f2a521868/html5/thumbnails/65.jpg)
A*:Summary
▪ A*usesbothbackwardcostsand(estimatesof)forwardcosts
▪ A*isoptimalwithadmissible/consistentheuristics
▪ Heuristicdesigniskey:oftenuserelaxedproblems
![Page 66: Informed Search - University of Texas at Austinsniekum/classes/343-S19/lectures/lecture4.pdf · Informed Search. Search Heuristics A heuristic is: A function that estimates how close](https://reader034.vdocuments.site/reader034/viewer/2022050413/5f89f954e57c990f2a521868/html5/thumbnails/66.jpg)
TreeSearchPseudo-Code
![Page 67: Informed Search - University of Texas at Austinsniekum/classes/343-S19/lectures/lecture4.pdf · Informed Search. Search Heuristics A heuristic is: A function that estimates how close](https://reader034.vdocuments.site/reader034/viewer/2022050413/5f89f954e57c990f2a521868/html5/thumbnails/67.jpg)
GraphSearchPseudo-Code