1
HeuristicGraphSearch: AnotherReasonAIisCool
NickDeibel QuizSection– 5/31/02
ADijkstra-LikeScenario
Yourcompanyownsadeliverytruckthatwillhavetomakemany tripsinadaytovariouswarehouses,alwaysstartingatwarehouseA andendingatwarehouseB.However,itwillneverrepeatvisitthe samewarehousetwiceinoneday.Becauseofdemand,youcannot wastetimerefuelingthetruckuntilitreachesB.Thetruckcan travelatmostKmilesonasingletankofgas.Youaregivena graphwherethenodesrepresentthewarehousesandthedirected edgesrepresentthehighwaysconnectingthetwowarehouses.Each edgeisweightedaccordingtothelengthofthathighway. AsyouwantyourdriverstoavoidtakingpathsoflongerthanK miles,designanalgorithmthattellsyouifthereexistsanysimple pathfromAtoB(nonodes/warehousesrepeated)whoselengthis greaterthanKmiles.
Whoops,That’sREALLYHard
- LongestPathisanNP-Completeproblem.
- Noknownpolynomial-timealgorithmsolvesit.
– Apoly-timealgorithmdoesexistforDAGS.
- Thisisadifficultproblemforevensmallgraphs.
HugeGraphs
- Considersomereallyhuge graphs…
– AllcitiesandtownsintheWorldAtlas – AllstarsintheGalaxy – Allways10blockscanbestacked Huh???
ImplicitlyGeneratedGraphs
- Ahugegraphmaybeimplicitlyspecified byrulesfor
generatingiton-the-fly
- Blocksworld:
– vertex=relativepositionsofallblocks – edge=robotarmstacksoneblock
stack(blue,red) stack(green,red) stack(green,blue) stack(blue,table) stack(green,blue)
BlocksWorld
- Source=initialstateoftheblocks
- Goal=desiredstateoftheblocks
- Pathsourcetogoal=sequenceofactions
(program)forrobotarm!
- nblocks nn vertices
- 10blocks 10billionvertices!