/
Example:TravelinginRomaniaIOnholidayinRomania;currentlyinAradIFlightle Example:TravelinginRomaniaIOnholidayinRomania;currentlyinAradIFlightle

Example:TravelinginRomaniaIOnholidayinRomania;currentlyinAradIFlightle - PDF document

natalia-silvester
natalia-silvester . @natalia-silvester
Follow
369 views
Uploaded On 2016-08-18

Example:TravelinginRomaniaIOnholidayinRomania;currentlyinAradIFlightle - PPT Presentation

ExampleThe8puzzle ExampleThe8puzzlecontdIstatesintegerlocationsoftilesignoreintermediatepositionsIactionsmoveblankleftrightupdownignoreunjammingetcIgoaltestgoalstategivenIpathcost ID: 451588

Example:The8-puzzle Example:The8-puzzle(cont'd)Istates:integerlocationsoftiles(ignoreintermediatepositions)Iactions:moveblankleft right down(ignoreunjammingetc.)Igoaltest:=goalstate(given)Ipathcost

Share:

Link:

Embed:

Download Presentation from below link

Download Pdf The PPT/PDF document "Example:TravelinginRomaniaIOnholidayinRo..." is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.


Presentation Transcript

Example:TravelinginRomaniaIOnholidayinRomania;currentlyinAradIFlightleavestomorrowfromBucharestIFormulategoal:beinBucharestIFormulateproblem:states:variouscitiesactions:drivebetweencitiesIFindsolution:sequenceofcities,e.g.,Arad,Sibiu,Fagaras,Bucharest(anysolutionoroptimalsolution?) Example:The8-puzzle Example:The8-puzzle(cont'd)Istates:integerlocationsoftiles(ignoreintermediatepositions)Iactions:moveblankleft,right,up,down(ignoreunjammingetc.)Igoaltest:=goalstate(given)Ipathcost:1permoveINotethattheoptimalsolutionofn-PuzzlefamilyisNP-hard Treesearchalgorithms(cont'd)functionTree-Search(problem,strategy)returnsasolution,orfailureinitializethefrontierusingtheinitialstateofproblemloopdoifthefrontierisemptythenreturnfailurechoosealeafnodeandremoveitfromthefrontierifthenodecontainsagoalstatethenreturnthecorrespondingsolutionexpandthechosennodeandaddtheresultingnodestothefrontierend EvaluatingsearchstrategiesIAstrategyisde nedbypickingtheorderofnodeexpansionIStrategiesareevaluatedalongthefollowingdimensions:Icompleteness|doesitalways ndasolutionifoneexists?Itimecomplexity|numberofnodesgenerated/expandedIspacecomplexity|maximumnumberofnodesinmemoryIoptimality|doesitalways ndaleast-costsolution?ITimeandspacecomplexityaremeasuredintermsofIb|maximumbranchingfactorofthesearchtreeId|depthoftheleast-costsolutionIm|maximumdepthofthestatespace(maybe1) UninformedsearchstrategiesUninformedstrategiesuseonlytheinformationavailableintheproblemde nitionIBreadth- rstsearchIUniform-costsearchIDepth- rstsearchIDepth-limitedsearchIIterativedeepeningsearchIBidirectionalsearch Breadth- rstsearchIExpandtheshallowestunexpandednodeIImplementation:frontierisaFIFOqueue,i.e.,newsuccessorsgoatend Progressofbreadth- rstsearchBreadth- rstsearchonasimplebinarytree.Ateachstage,thenodetobeexpandednextisindicatedbyamarker.Thenodesthatarealreadyexploredaregray.Thenodeswithdashedlinesarenotgeneratedyet. Progressofbreadth- rstsearchBreadth- rstsearchonasimplebinarytree.Ateachstage,thenodetobeexpandednextisindicatedbyamarker.Thenodesthatarealreadyexploredaregray.Thenodeswithdashedlinesarenotgeneratedyet. Progressofbreadth- rstsearchBreadth- rstsearchonasimplebinarytree.Ateachstage,thenodetobeexpandednextisindicatedbyamarker.Thenodesthatarealreadyexploredaregray.Thenodeswithdashedlinesarenotgeneratedyet. Progressofbreadth- rstsearchBreadth- rstsearchonasimplebinarytree.Ateachstage,thenodetobeexpandednextisindicatedbyamarker.Thenodesthatarealreadyexploredaregray.Thenodeswithdashedlinesarenotgeneratedyet. Propertiesofbreadth- rstsearchIComplete:Yes(ifbis nite)ITime:b+b2+b3+:::+bd+b(bd�1)=O(bd+1),i.e.,numberofnodesgeneratedisexponentialindISpace:O(bd+1)(keepseverynodeinmemory)IOptimal:Yes(ifcost=1perstep)Spaceisthebigproblem;caneasilygeneratenodesat100MB/secso24hrs=8604GB. Uniform-costsearchIExpandtheleast-costunexpandednodeIImplementation:frontierisaqueueorderedbypathcostIEquivalenttobreadth- rstifstepcostsareallequal Propertiesofuniform-costsearchIComplete:Yes,ifstepcostITime:#ofnodeswithgcostofoptimalsolution,O(b1+bC=c)whereCisthecostoftheoptimalsolutionISpace:#ofnodeswithgcostofoptimalsolution,O(b1+bC=c)IOptimal:Yes|nodesexpandedinincreasingorderofg(n) Depth- rstsearchIExpanddeepestunexpandednodeIImplementation:frontierisaLIFOqueue,i.e.,putsuccessorsatfront Progressofdepth- rstsearch Progressofdepth- rstsearch Progressofdepth- rstsearch Progressofdepth- rstsearch Progressofdepth- rstsearch Progressofdepth- rstsearch Progressofdepth- rstsearch Progressofdepth- rstsearch Progressofdepth- rstsearch Progressofdepth- rstsearch Progressofdepth- rstsearch Progressofdepth- rstsearch Propertiesofdepth- rstsearchIComplete:No:failsinin nite-depthspaces,spaceswithloopsModifytoavoidrepeatedstatesalongpath)completein nitespacesITime:O(bm):terribleifmismuchlargerthandbutifsolutionsaredense,maybemuchfasterthanbreadth- rstISpace:O(bm),i.e.,linearspace!IOptimal:No Depth-limitedsearchfunctionDepth-Limited-Search(problem,limit)returnsasolution,orfailure/cuto returnRecursive-DLS(Make-Node(problem.Initial-State),problem,limit)functionRecursive-DLS(node,problem,limit)returnsasolution,orfailure/cuto ifproblem.Goal-Test(node.State)thenreturnSolution(node)elseiflimit=0thenreturncuto elsecuto -occurred? falseforeachactioninproblem.Actions(node.State)dochild Child-Node(problem,node,action)result Recursive-DLS(child,problem,limit-1)ifresult=cuto thencuto -occurred? trueelseifresult6=failurethenreturnresultifcuto -occurred?thenreturncuto elsereturnfailure IterativedeepeningsearchfunctionIterative-Deepening-Search(problem)returnsasolution,orfailurefordepth 0to1doresult Depth-Limited-Search(problem,depth)ifresult6=cuto thenreturnresult Summaryofalgorithms Criterion Breadth-Uniform-Depth-Depth-Iter. FirstCostFirstLimitedDeep. Complete? YesYesNoYesYes Time O(bd+1)O(b1+bC=c)O(bm)O(bl)O(bd) Space O(bd+1)O(b1+bC=c)O(bm)O(bl)O(bd) Optimal? YesYesNoNoYes SummaryIProblemformulationusuallyrequiresabstractingawayreal-worlddetailstode neastatespacethatcanfeasiblybeexplored.IThereareavarietyofuninformedsearchstrategiesavailable.IIterativedeepeningsearchusesonlylinearspaceandnotmuchmoretimethanotheruninformedalgorithms.

Related Contents


Next Show more