Search - University of Texas at Austinpstone/Courses/343Hfall17/... · Idea: get DFS’s space...
Transcript of Search - University of Texas at Austinpstone/Courses/343Hfall17/... · Idea: get DFS’s space...
![Page 1: Search - University of Texas at Austinpstone/Courses/343Hfall17/... · Idea: get DFS’s space advantage with BFS’s time / shallow-solution advantages Run a DFS with depth limit](https://reader035.fdocuments.in/reader035/viewer/2022071216/60472a460a9b2a601a060de4/html5/thumbnails/1.jpg)
CS343H:HonorsArtificialIntelligenceSearch
Prof.PeterStone
UniversityofTexasatAustin[TheseslideswerecreatedbyDanKleinandPieterAbbeelforCS188IntrotoAIatUCBerkeley.AllCS188materialsareavailableathttp://ai.berkeley.edu.]
![Page 2: Search - University of Texas at Austinpstone/Courses/343Hfall17/... · Idea: get DFS’s space advantage with BFS’s time / shallow-solution advantages Run a DFS with depth limit](https://reader035.fdocuments.in/reader035/viewer/2022071216/60472a460a9b2a601a060de4/html5/thumbnails/2.jpg)
Today
▪ AgentsthatPlanAhead
▪ SearchProblems
▪ UninformedSearchMethods
▪ Depth-FirstSearch▪ Breadth-FirstSearch▪ Uniform-CostSearch
![Page 3: Search - University of Texas at Austinpstone/Courses/343Hfall17/... · Idea: get DFS’s space advantage with BFS’s time / shallow-solution advantages Run a DFS with depth limit](https://reader035.fdocuments.in/reader035/viewer/2022071216/60472a460a9b2a601a060de4/html5/thumbnails/3.jpg)
AgentsthatPlan
![Page 4: Search - University of Texas at Austinpstone/Courses/343Hfall17/... · Idea: get DFS’s space advantage with BFS’s time / shallow-solution advantages Run a DFS with depth limit](https://reader035.fdocuments.in/reader035/viewer/2022071216/60472a460a9b2a601a060de4/html5/thumbnails/4.jpg)
ReflexAgents
▪ Reflexagents:▪ Chooseactionbasedoncurrentpercept(and
maybememory)▪ Mayhavememoryoramodeloftheworld’s
currentstate▪ Donotconsiderthefutureconsequencesof
theiractions▪ ConsiderhowtheworldIS
▪ Canareflexagentberational?
![Page 5: Search - University of Texas at Austinpstone/Courses/343Hfall17/... · Idea: get DFS’s space advantage with BFS’s time / shallow-solution advantages Run a DFS with depth limit](https://reader035.fdocuments.in/reader035/viewer/2022071216/60472a460a9b2a601a060de4/html5/thumbnails/5.jpg)
VideoofDemoReflex—Success
![Page 6: Search - University of Texas at Austinpstone/Courses/343Hfall17/... · Idea: get DFS’s space advantage with BFS’s time / shallow-solution advantages Run a DFS with depth limit](https://reader035.fdocuments.in/reader035/viewer/2022071216/60472a460a9b2a601a060de4/html5/thumbnails/6.jpg)
VideoofDemoReflex—Stuck
![Page 7: Search - University of Texas at Austinpstone/Courses/343Hfall17/... · Idea: get DFS’s space advantage with BFS’s time / shallow-solution advantages Run a DFS with depth limit](https://reader035.fdocuments.in/reader035/viewer/2022071216/60472a460a9b2a601a060de4/html5/thumbnails/7.jpg)
PlanningAgents
▪ Planningagents:▪ Ask“whatif”▪ Decisionsbasedon(hypothesized)consequences
ofactions▪ Musthaveamodelofhowtheworldevolvesin
responsetoactions▪ Mustformulateagoal(test)▪ ConsiderhowtheworldWOULDBE
▪ Optimalvs.completeplanning
▪ Planningvs.replanning
![Page 8: Search - University of Texas at Austinpstone/Courses/343Hfall17/... · Idea: get DFS’s space advantage with BFS’s time / shallow-solution advantages Run a DFS with depth limit](https://reader035.fdocuments.in/reader035/viewer/2022071216/60472a460a9b2a601a060de4/html5/thumbnails/8.jpg)
VideoofDemo—Suboptimallocalreplanning
![Page 9: Search - University of Texas at Austinpstone/Courses/343Hfall17/... · Idea: get DFS’s space advantage with BFS’s time / shallow-solution advantages Run a DFS with depth limit](https://reader035.fdocuments.in/reader035/viewer/2022071216/60472a460a9b2a601a060de4/html5/thumbnails/9.jpg)
VideoofDemo—Globallyoptimalplanning
![Page 10: Search - University of Texas at Austinpstone/Courses/343Hfall17/... · Idea: get DFS’s space advantage with BFS’s time / shallow-solution advantages Run a DFS with depth limit](https://reader035.fdocuments.in/reader035/viewer/2022071216/60472a460a9b2a601a060de4/html5/thumbnails/10.jpg)
SearchProblems
![Page 11: Search - University of Texas at Austinpstone/Courses/343Hfall17/... · Idea: get DFS’s space advantage with BFS’s time / shallow-solution advantages Run a DFS with depth limit](https://reader035.fdocuments.in/reader035/viewer/2022071216/60472a460a9b2a601a060de4/html5/thumbnails/11.jpg)
SearchProblems
▪ Asearchproblemconsistsof:
▪ Astatespace
▪ Asuccessorfunction (withactions,costs)
▪ Astartstateandagoaltest
▪ Asolutionisasequenceofactions(aplan)whichtransformsthestartstatetoagoalstate
“N”,1.0
“E”,1.0
![Page 12: Search - University of Texas at Austinpstone/Courses/343Hfall17/... · Idea: get DFS’s space advantage with BFS’s time / shallow-solution advantages Run a DFS with depth limit](https://reader035.fdocuments.in/reader035/viewer/2022071216/60472a460a9b2a601a060de4/html5/thumbnails/12.jpg)
SearchProblemsAreModels
![Page 13: Search - University of Texas at Austinpstone/Courses/343Hfall17/... · Idea: get DFS’s space advantage with BFS’s time / shallow-solution advantages Run a DFS with depth limit](https://reader035.fdocuments.in/reader035/viewer/2022071216/60472a460a9b2a601a060de4/html5/thumbnails/13.jpg)
Example:TravelinginRomania
▪ Statespace:▪ Cities
▪ Successorfunction:▪ Roads:Gotoadjacentcitywith
cost=distance▪ Startstate:
▪ Arad▪ Goaltest:
▪ Isstate==Bucharest?
▪ Solution?
![Page 14: Search - University of Texas at Austinpstone/Courses/343Hfall17/... · Idea: get DFS’s space advantage with BFS’s time / shallow-solution advantages Run a DFS with depth limit](https://reader035.fdocuments.in/reader035/viewer/2022071216/60472a460a9b2a601a060de4/html5/thumbnails/14.jpg)
What’sinaStateSpace?
▪ Problem:Pathing▪ States:(x,y)location▪ Actions:NSEW▪ Successor:updatelocation
only▪ Goaltest:is(x,y)=END
▪ Problem:Eat-All-Dots▪ States:{(x,y),dotbooleans}▪ Actions:NSEW▪ Successor:updatelocation
andpossiblyadotboolean▪ Goaltest:dotsallfalse
Theworldstateincludeseverylastdetailoftheenvironment
Asearchstatekeepsonlythedetailsneededforplanning(abstraction)
![Page 15: Search - University of Texas at Austinpstone/Courses/343Hfall17/... · Idea: get DFS’s space advantage with BFS’s time / shallow-solution advantages Run a DFS with depth limit](https://reader035.fdocuments.in/reader035/viewer/2022071216/60472a460a9b2a601a060de4/html5/thumbnails/15.jpg)
StateSpaceSizes?
▪ Worldstate:▪ Agentpositions:120▪ Foodcount:30▪ Ghostpositions:12▪ Agentfacing:NSEW
▪ Howmany▪ Worldstates? 120x(230)x(122)x4(>74trillion!)▪ Statesforpathing? 120▪ Statesforeat-all-dots? 120x(230)(>128billion)
![Page 16: Search - University of Texas at Austinpstone/Courses/343Hfall17/... · Idea: get DFS’s space advantage with BFS’s time / shallow-solution advantages Run a DFS with depth limit](https://reader035.fdocuments.in/reader035/viewer/2022071216/60472a460a9b2a601a060de4/html5/thumbnails/16.jpg)
Quiz:SafePassage
▪ Problem:eatalldotswhilekeepingtheghostsperma-scared▪ Whatdoesthestatespacehavetospecify?▪ (agentposition,dotbooleans,powerpelletbooleans,remainingscaredtime)
![Page 17: Search - University of Texas at Austinpstone/Courses/343Hfall17/... · Idea: get DFS’s space advantage with BFS’s time / shallow-solution advantages Run a DFS with depth limit](https://reader035.fdocuments.in/reader035/viewer/2022071216/60472a460a9b2a601a060de4/html5/thumbnails/17.jpg)
StateSpaceGraphsandSearchTrees
![Page 18: Search - University of Texas at Austinpstone/Courses/343Hfall17/... · Idea: get DFS’s space advantage with BFS’s time / shallow-solution advantages Run a DFS with depth limit](https://reader035.fdocuments.in/reader035/viewer/2022071216/60472a460a9b2a601a060de4/html5/thumbnails/18.jpg)
StateSpaceGraphs
▪ Statespacegraph:Amathematicalrepresentationofasearchproblem▪ Nodesare(abstracted)worldconfigurations▪ Arcsrepresentsuccessors(actionresults)▪ Thegoaltestisasetofgoalnodes(maybeonlyone)
▪ Inastatespacegraph,eachstateoccursonlyonce!
▪ Wecanrarelybuildthisfullgraphinmemory(it’stoobig),butit’sausefulidea
![Page 19: Search - University of Texas at Austinpstone/Courses/343Hfall17/... · Idea: get DFS’s space advantage with BFS’s time / shallow-solution advantages Run a DFS with depth limit](https://reader035.fdocuments.in/reader035/viewer/2022071216/60472a460a9b2a601a060de4/html5/thumbnails/19.jpg)
StateSpaceGraphs
S
G
d
b
p q
c
e
h
a
f
r
Tinysearchgraphforatinysearchproblem
▪ Statespacegraph:Amathematicalrepresentationofasearchproblem▪ Nodesare(abstracted)worldconfigurations▪ Arcsrepresentsuccessors(actionresults)▪ Thegoaltestisasetofgoalnodes(maybeonlyone)
▪ Inastatespacegraph,eachstateoccursonlyonce!
▪ Wecanrarelybuildthisfullgraphinmemory(it’stoobig),butit’sausefulidea
![Page 20: Search - University of Texas at Austinpstone/Courses/343Hfall17/... · Idea: get DFS’s space advantage with BFS’s time / shallow-solution advantages Run a DFS with depth limit](https://reader035.fdocuments.in/reader035/viewer/2022071216/60472a460a9b2a601a060de4/html5/thumbnails/20.jpg)
SearchTrees
▪ Asearchtree:▪ A“whatif”treeofplansandtheiroutcomes▪ Thestartstateistherootnode▪ Childrencorrespondtosuccessors▪ Nodesshowstates,butcorrespondtoPLANSthatachievethosestates▪ Formostproblems,wecanneveractuallybuildthewholetree
“E”,1.0“N”,1.0
Thisisnow/start
Possiblefutures
![Page 21: Search - University of Texas at Austinpstone/Courses/343Hfall17/... · Idea: get DFS’s space advantage with BFS’s time / shallow-solution advantages Run a DFS with depth limit](https://reader035.fdocuments.in/reader035/viewer/2022071216/60472a460a9b2a601a060de4/html5/thumbnails/21.jpg)
StateSpaceGraphsvs.SearchTrees
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 Ga
S
G
d
b
p q
c
e
h
a
f
r
Weconstructbothondemand–andweconstructaslittleas
possible.
EachNODEinthesearchtreeisanentirePATHinthestatespacegraph.
SearchTreeStateSpaceGraph
![Page 22: Search - University of Texas at Austinpstone/Courses/343Hfall17/... · Idea: get DFS’s space advantage with BFS’s time / shallow-solution advantages Run a DFS with depth limit](https://reader035.fdocuments.in/reader035/viewer/2022071216/60472a460a9b2a601a060de4/html5/thumbnails/22.jpg)
Quiz:StateSpaceGraphsvs.SearchTrees
S G
b
a
Considerthis4-stategraph:
Important:Lotsofrepeatedstructureinthesearchtree!
Howbigisitssearchtree(fromS)?
Sowhywouldweeveruseasearchtree?
1)Cannotstore“closedlist”(previouslyvisitednodes)2)Graphhappenstobeatree,sonoreasontostoreclosedlist
![Page 23: Search - University of Texas at Austinpstone/Courses/343Hfall17/... · Idea: get DFS’s space advantage with BFS’s time / shallow-solution advantages Run a DFS with depth limit](https://reader035.fdocuments.in/reader035/viewer/2022071216/60472a460a9b2a601a060de4/html5/thumbnails/23.jpg)
TreeSearch
![Page 24: Search - University of Texas at Austinpstone/Courses/343Hfall17/... · Idea: get DFS’s space advantage with BFS’s time / shallow-solution advantages Run a DFS with depth limit](https://reader035.fdocuments.in/reader035/viewer/2022071216/60472a460a9b2a601a060de4/html5/thumbnails/24.jpg)
SearchExample:Romania
![Page 25: Search - University of Texas at Austinpstone/Courses/343Hfall17/... · Idea: get DFS’s space advantage with BFS’s time / shallow-solution advantages Run a DFS with depth limit](https://reader035.fdocuments.in/reader035/viewer/2022071216/60472a460a9b2a601a060de4/html5/thumbnails/25.jpg)
SearchingwithaSearchTree
▪ Search:▪ Expandoutpotentialplans(treenodes)▪ Maintainafringeofpartialplansunderconsideration▪ Trytoexpandasfewtreenodesaspossible
![Page 26: Search - University of Texas at Austinpstone/Courses/343Hfall17/... · Idea: get DFS’s space advantage with BFS’s time / shallow-solution advantages Run a DFS with depth limit](https://reader035.fdocuments.in/reader035/viewer/2022071216/60472a460a9b2a601a060de4/html5/thumbnails/26.jpg)
GeneralTreeSearch
▪ Importantideas:▪ Fringe▪ Expansion▪ Explorationstrategy
▪ Mainquestion:whichfringenodestoexplore?
![Page 27: Search - University of Texas at Austinpstone/Courses/343Hfall17/... · Idea: get DFS’s space advantage with BFS’s time / shallow-solution advantages Run a DFS with depth limit](https://reader035.fdocuments.in/reader035/viewer/2022071216/60472a460a9b2a601a060de4/html5/thumbnails/27.jpg)
Depth-FirstSearch
![Page 28: Search - University of Texas at Austinpstone/Courses/343Hfall17/... · Idea: get DFS’s space advantage with BFS’s time / shallow-solution advantages Run a DFS with depth limit](https://reader035.fdocuments.in/reader035/viewer/2022071216/60472a460a9b2a601a060de4/html5/thumbnails/28.jpg)
Depth-FirstSearch
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
S
G
d
b
p q
c
e
h
a
f
rqph
fd
ba
c
e
r
Strategy:expandadeepestnodefirst
Implementation:FringeisaLIFOstack
![Page 29: Search - University of Texas at Austinpstone/Courses/343Hfall17/... · Idea: get DFS’s space advantage with BFS’s time / shallow-solution advantages Run a DFS with depth limit](https://reader035.fdocuments.in/reader035/viewer/2022071216/60472a460a9b2a601a060de4/html5/thumbnails/29.jpg)
SearchAlgorithmProperties
![Page 30: Search - University of Texas at Austinpstone/Courses/343Hfall17/... · Idea: get DFS’s space advantage with BFS’s time / shallow-solution advantages Run a DFS with depth limit](https://reader035.fdocuments.in/reader035/viewer/2022071216/60472a460a9b2a601a060de4/html5/thumbnails/30.jpg)
SearchAlgorithmProperties
▪ Complete:Guaranteedtofindasolutionifoneexists?▪ Optimal:Guaranteedtofindtheleastcostpath?▪ Timecomplexity?▪ Spacecomplexity?
▪ Cartoonofsearchtree:▪ bisthebranchingfactor▪ misthemaximumdepth▪ solutionsatvariousdepths
▪ Numberofnodesinentiretree?▪ 1+b+b2+….bm=O(bm)
…b
1 nodeb nodes
b2 nodes
bm nodes
m tiers
![Page 31: Search - University of Texas at Austinpstone/Courses/343Hfall17/... · Idea: get DFS’s space advantage with BFS’s time / shallow-solution advantages Run a DFS with depth limit](https://reader035.fdocuments.in/reader035/viewer/2022071216/60472a460a9b2a601a060de4/html5/thumbnails/31.jpg)
Depth-FirstSearch(DFS)Properties
…b
1 nodeb nodes
b2 nodes
bm nodes
m tiers
▪ WhatnodesDFSexpand?▪ Someleftprefixofthetree.▪ Couldprocessthewholetree!▪ Ifmisfinite,takestimeO(bm)
▪ Howmuchspacedoesthefringetake?▪ Onlyhassiblingsonpathtoroot,soO(bm)
▪ Isitcomplete?▪ mcouldbeinfinite,soonlyifwepreventcycles
(morelater)
▪ Isitoptimal?▪ No,itfindsthe“leftmost”solution,regardlessof
depthorcost
![Page 32: Search - University of Texas at Austinpstone/Courses/343Hfall17/... · Idea: get DFS’s space advantage with BFS’s time / shallow-solution advantages Run a DFS with depth limit](https://reader035.fdocuments.in/reader035/viewer/2022071216/60472a460a9b2a601a060de4/html5/thumbnails/32.jpg)
Breadth-FirstSearch
![Page 33: Search - University of Texas at Austinpstone/Courses/343Hfall17/... · Idea: get DFS’s space advantage with BFS’s time / shallow-solution advantages Run a DFS with depth limit](https://reader035.fdocuments.in/reader035/viewer/2022071216/60472a460a9b2a601a060de4/html5/thumbnails/33.jpg)
Breadth-FirstSearch
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
S
G
d
b
p q
ce
h
a
f
r
Search
Tiers
Strategy:expandashallowestnodefirst
Implementation:FringeisaFIFOqueue
![Page 34: Search - University of Texas at Austinpstone/Courses/343Hfall17/... · Idea: get DFS’s space advantage with BFS’s time / shallow-solution advantages Run a DFS with depth limit](https://reader035.fdocuments.in/reader035/viewer/2022071216/60472a460a9b2a601a060de4/html5/thumbnails/34.jpg)
Breadth-FirstSearch(BFS)Properties
▪ WhatnodesdoesBFSexpand?▪ Processesallnodesaboveshallowestsolution▪ Letdepthofshallowestsolutionbes▪ SearchtakestimeO(bs)
▪ Howmuchspacedoesthefringetake?▪ Hasroughlythelasttier,soO(bs)
▪ Isitcomplete?▪ smustbefiniteifasolutionexists,soyes!
▪ Isitoptimal?▪ Onlyifcostsareall1(moreoncostslater)
…b
1 nodeb nodes
b2 nodes
bm nodes
s tiers
bs nodes
![Page 35: Search - University of Texas at Austinpstone/Courses/343Hfall17/... · Idea: get DFS’s space advantage with BFS’s time / shallow-solution advantages Run a DFS with depth limit](https://reader035.fdocuments.in/reader035/viewer/2022071216/60472a460a9b2a601a060de4/html5/thumbnails/35.jpg)
Quiz:DFSvsBFS
![Page 36: Search - University of Texas at Austinpstone/Courses/343Hfall17/... · Idea: get DFS’s space advantage with BFS’s time / shallow-solution advantages Run a DFS with depth limit](https://reader035.fdocuments.in/reader035/viewer/2022071216/60472a460a9b2a601a060de4/html5/thumbnails/36.jpg)
Quiz:DFSvsBFS
▪ WhenwillBFSoutperformDFS?
▪ WhenwillDFSoutperformBFS?
▪ Whatistheworstcaseforeach?
![Page 37: Search - University of Texas at Austinpstone/Courses/343Hfall17/... · Idea: get DFS’s space advantage with BFS’s time / shallow-solution advantages Run a DFS with depth limit](https://reader035.fdocuments.in/reader035/viewer/2022071216/60472a460a9b2a601a060de4/html5/thumbnails/37.jpg)
VideoofDemoMazeWaterDFS/BFS(part1)
![Page 38: Search - University of Texas at Austinpstone/Courses/343Hfall17/... · Idea: get DFS’s space advantage with BFS’s time / shallow-solution advantages Run a DFS with depth limit](https://reader035.fdocuments.in/reader035/viewer/2022071216/60472a460a9b2a601a060de4/html5/thumbnails/38.jpg)
VideoofDemoMazeWaterDFS/BFS(part2)
![Page 39: Search - University of Texas at Austinpstone/Courses/343Hfall17/... · Idea: get DFS’s space advantage with BFS’s time / shallow-solution advantages Run a DFS with depth limit](https://reader035.fdocuments.in/reader035/viewer/2022071216/60472a460a9b2a601a060de4/html5/thumbnails/39.jpg)
IterativeDeepening
…b
▪ Idea:getDFS’sspaceadvantagewithBFS’stime/shallow-solutionadvantages▪ RunaDFSwithdepthlimit1.Ifnosolution…▪ RunaDFSwithdepthlimit2.Ifnosolution…▪ RunaDFSwithdepthlimit3.…..
▪ Isn’tthatwastefullyredundant?▪ Generallymostworkhappensinthelowestlevelsearched,sonotsobad!
![Page 40: Search - University of Texas at Austinpstone/Courses/343Hfall17/... · Idea: get DFS’s space advantage with BFS’s time / shallow-solution advantages Run a DFS with depth limit](https://reader035.fdocuments.in/reader035/viewer/2022071216/60472a460a9b2a601a060de4/html5/thumbnails/40.jpg)
Cost-SensitiveSearch
BFSfindstheshortestpathintermsofnumberofactions.Itdoesnotfindtheleast-costpath.Wewillnowcoverasimilaralgorithmwhichdoesfindtheleast-costpath.
START
GOAL
d
b
pq
c
e
h
a
f
r
2
9 2
81
8
2
3
2
4
4
15
1
32
2
![Page 41: Search - University of Texas at Austinpstone/Courses/343Hfall17/... · Idea: get DFS’s space advantage with BFS’s time / shallow-solution advantages Run a DFS with depth limit](https://reader035.fdocuments.in/reader035/viewer/2022071216/60472a460a9b2a601a060de4/html5/thumbnails/41.jpg)
UniformCostSearch
![Page 42: Search - University of Texas at Austinpstone/Courses/343Hfall17/... · Idea: get DFS’s space advantage with BFS’s time / shallow-solution advantages Run a DFS with depth limit](https://reader035.fdocuments.in/reader035/viewer/2022071216/60472a460a9b2a601a060de4/html5/thumbnails/42.jpg)
UniformCostSearch
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
Strategy: expand a cheapest node first:
Fringe is a priority queue (priority: cumulative cost) S
G
d
b
p q
c
e
h
a
f
r
3 9 1
16411
5
713
8
1011
17 11
0
6
39
1
1
2
8
8 2
15
1
2
Cost contours
2
![Page 43: Search - University of Texas at Austinpstone/Courses/343Hfall17/... · Idea: get DFS’s space advantage with BFS’s time / shallow-solution advantages Run a DFS with depth limit](https://reader035.fdocuments.in/reader035/viewer/2022071216/60472a460a9b2a601a060de4/html5/thumbnails/43.jpg)
…
UniformCostSearch(UCS)Properties
▪ WhatnodesdoesUCSexpand?▪ Processesallnodeswithcostlessthancheapestsolution!▪ IfthatsolutioncostsC* andarcscostatleastε , thenthe“effective
depth”isroughlyC*/ε▪ TakestimeO(bC*/ε)(exponentialineffectivedepth)
▪ Howmuchspacedoesthefringetake?▪ Hasroughlythelasttier,soO(bC*/ε)
▪ Isitcomplete?▪ Assumingbestsolutionhasafinitecostandminimumarccostispositive,
yes!
▪ Isitoptimal?▪ Yes!(ProofnextlectureviaA*)
b
C*/ε “tiers”c ≤ 3
c ≤ 2
c ≤ 1
![Page 44: Search - University of Texas at Austinpstone/Courses/343Hfall17/... · Idea: get DFS’s space advantage with BFS’s time / shallow-solution advantages Run a DFS with depth limit](https://reader035.fdocuments.in/reader035/viewer/2022071216/60472a460a9b2a601a060de4/html5/thumbnails/44.jpg)
UniformCostIssues
▪ Remember:UCSexploresincreasingcostcontours
▪ Thegood:UCSiscompleteandoptimal!
▪ Thebad:▪ Exploresoptionsinevery“direction”▪ Noinformationaboutgoallocation
▪ We’llfixthatsoon!Start Goal
…
c ≤ 3c ≤ 2
c ≤ 1
![Page 45: Search - University of Texas at Austinpstone/Courses/343Hfall17/... · Idea: get DFS’s space advantage with BFS’s time / shallow-solution advantages Run a DFS with depth limit](https://reader035.fdocuments.in/reader035/viewer/2022071216/60472a460a9b2a601a060de4/html5/thumbnails/45.jpg)
VideoofDemoEmptyUCS
![Page 46: Search - University of Texas at Austinpstone/Courses/343Hfall17/... · Idea: get DFS’s space advantage with BFS’s time / shallow-solution advantages Run a DFS with depth limit](https://reader035.fdocuments.in/reader035/viewer/2022071216/60472a460a9b2a601a060de4/html5/thumbnails/46.jpg)
VideoofDemoMazewithDeep/ShallowWater---DFS,BFS,orUCS?(part1)
![Page 47: Search - University of Texas at Austinpstone/Courses/343Hfall17/... · Idea: get DFS’s space advantage with BFS’s time / shallow-solution advantages Run a DFS with depth limit](https://reader035.fdocuments.in/reader035/viewer/2022071216/60472a460a9b2a601a060de4/html5/thumbnails/47.jpg)
VideoofDemoMazewithDeep/ShallowWater---DFS,BFS,orUCS?(part2)
![Page 48: Search - University of Texas at Austinpstone/Courses/343Hfall17/... · Idea: get DFS’s space advantage with BFS’s time / shallow-solution advantages Run a DFS with depth limit](https://reader035.fdocuments.in/reader035/viewer/2022071216/60472a460a9b2a601a060de4/html5/thumbnails/48.jpg)
VideoofDemoMazewithDeep/ShallowWater---DFS,BFS,orUCS?(part3)
![Page 49: Search - University of Texas at Austinpstone/Courses/343Hfall17/... · Idea: get DFS’s space advantage with BFS’s time / shallow-solution advantages Run a DFS with depth limit](https://reader035.fdocuments.in/reader035/viewer/2022071216/60472a460a9b2a601a060de4/html5/thumbnails/49.jpg)
TheOneQueue
▪ Allthesesearchalgorithmsarethesameexceptforfringestrategies▪ Conceptually,allfringesarepriorityqueues(i.e.collectionsofnodeswithattachedpriorities)
▪ Practically,forDFSandBFS,youcanavoidthelog(n)overheadfromanactualpriorityqueue,byusingstacksandqueues
▪ Canevencodeoneimplementationthattakesavariablequeuingobject
![Page 50: Search - University of Texas at Austinpstone/Courses/343Hfall17/... · Idea: get DFS’s space advantage with BFS’s time / shallow-solution advantages Run a DFS with depth limit](https://reader035.fdocuments.in/reader035/viewer/2022071216/60472a460a9b2a601a060de4/html5/thumbnails/50.jpg)
SearchandModels
▪ Searchoperatesovermodelsoftheworld▪ Theagentdoesn’tactuallytryalltheplansoutintherealworld!
▪ Planningisall“insimulation”
▪ Yoursearchisonlyasgoodasyourmodels…