1.02k likes | 1.23k Views
Objectives for Lecture 6: Pathfinding. Depth of understanding. After the lecture you are able to…. 1. Chapter: Introduction 1.1 Navigation 1.2 Modelling Streets with Graphs 2. Chapter: Algorithms 2.1 British Museum Algorithm 2.2 Breadth First, Depth First, Best First
E N D
Objectives for Lecture 6: Pathfinding Depth of understanding • After the lecture you are able to…
1. Chapter: Introduction 1.1 Navigation 1.2 ModellingStreetswith Graphs 2. Chapter: Algorithms 2.1 British Museum Algorithm 2.2 Breadth First, Depth First, Best First 2.3 Dijkstra, A* 3. Chapter: Application 4. Chapter: Summary
Introduction – NavigationThe human approach https://mapstyle.withgoogle.com/
Introduction – NavigationThe human approach https://mapstyle.withgoogle.com/
Introduction – NavigationThe human approach https://mapstyle.withgoogle.com/
The human approachtofindingroutes on a streetmapis a veryvisualone. Feasiblepathsaredevelopedbyvisuallytracing different streetlines in thegeneraldirectionofthetarget. Obstacles, deadendsandrestrictionsareintuitivelytakenintoaccount, although – in typicalroutingsituations – no intensive thinkingorreflectioniscarried out. The human actoffinding a pathbetween a startingpointand a destinationcanbeconsidered „intelligent“. As a matter offact, we do not understandthe human approachoffindingroutes on maps in detail. Hence, wecan not modelitdirectly. Instead, searchalgorithmshaveevolved, solvingthe same problemsbysupposedly different means. Somepopularonesoftheseshallbeintroduced in thislecture. The questionthatremainsiswhetheror not thepresentedalgorithmscanthemselvesbeconsidered „intelligent“ solelybecausetheysolve a problemthathumanssolvebymeansof human intelligence.
Introduction – NavigationDefinition „The process or activity of accurately ascertaining one's position and planning and following a route.”https://en.oxforddictionaries.com/definition/navigation
Introduction – NavigationDefinition 1. Navigation HourstoMinutes 2. Path Following MinutestoSeconds 3. Control/ Stabilization SecondstoMiliseconds
Introduction –NavigationHistorical Approaches Paper Map Direct Transmission „Play“ SpecificPaths 1930 IterAvto Paper Map Gyroscope ScrollsMap 1981 electroGyrocator https://ndrive.com/brief-history-gps-car-navigation/
Introduction –NavigationHistorical Approaches Digital Map Dead Reckoning Cassettes 1985 Etak Navigator Digital Color Map Dead Reckoning CD-ROM 1987 Toyota CD-ROM Navigation System https://ndrive.com/brief-history-gps-car-navigation/
Introduction –NavigationHistorical Approaches Digital Color Map GPS 1990 Mazda Eunos Cosmo GPS Dead Reckoning MapMatching Speech Recognition Dynamic Routing Points of Interest (POI) Modern Navigation Systems https://ndrive.com/brief-history-gps-car-navigation/
Introduction – ModellingStreetswithGraphsWhatneedstobemodelled? Road GeometryPosition Length Start - End Road ConnectivityIntersections ConnectionsFly-Over Road AttributesTurn Restrictions Speed Limits Type Segment Segment 2 Segment 1
Introduction – ModellingStreetswithGraphsData Sources GPS Tracks SatelliteImagery https://www.maps.google.de https://buy.garmin.com/de-DE/DE/p/550460
Introduction – ModellingStreetswithGraphsOSM Open SteetMap (OSM) • Worldwide Map Data • Free • Started 2004 in London • 1 000 000 ContributingUsers • DefinesData Modelfor Mapping https://upload.wikimedia.org/wikipedia/commons/thumb/b/b0/Openstreetmap_logo.svg/1200px-Openstreetmap_logo.svg.png
Introduction – ModellingStreetswithGraphsOSM Nodes Definedbylatitude, longitudeandnode id. Representsarbitrarylocations.Attributes specifiedbytags. Node_ID = 1 Lat = 48.1 Lon = 11.5 Node_ID = 2 Lat = 48.4 Lon = 12.5 k : highway v : traffic light k : highway v : bus_stop A tag consistsof a keyand a value. Tags describefeaturesofmapelements. Keys andvaluesarefreetext but conventionsexist.
Introduction – ModellingStreetswithGraphsOSM Ways Definedby an orderedsetofnodes. Groups nodesintolines. Attributes specifiedbytags. Way_ID = 1 Node_ID = 1 Lat = 48.1 Lon = 11.50 Node_ID = 2 Lat = 48.1 Lon = 11.51 Node_ID = 3 Lat = 48.1 Lon = 11.52 k : highway v : primary A tag consistsof a keyand a value. Tags describefeaturesofmapelements. Keys andvaluesarefreetext but conventionsexist.
Introduction – ModellingStreetswithGraphsOSM Relations Definedby an orderedlistofnodes, waysand/orrelations. Defineslogicalorgeographicrelationshipsbetweenotherelements. Relation_ID = 1 A tag consistsof a keyand a value. Tags describefeaturesofmapelements. Keys andvaluesarefreetext but conventionsexist.
Introduction – ModellingStreetswith GraphsGraphs – Basic Elements Node Directed Edge Undirected Edge
Introduction – ModellingStreetswith GraphsGraphs– Basic Elements Weighted Edge 3 Unweighted Edge Edge weightsareinterpretableascost(e.g. time, distance …)
Introduction – ModellingStreetswithGraphsGraphs– Formal Description
Introduction – ModellingStreetswithGraphsFrom OSM toRoutable Graphs Initial Graph OSM Data providesgeometryandspeedlimits 50 km/h 50 km/h 50 km/h 50 km/h 30 km/h 50 km/h 30 km/h 30 km/h
Introduction – ModellingStreetswithGraphsFrom OSM toRoutable Graphs Augmented Graph Edge weights like distancesandtimespansarecalculated 100 m 7.2 s 100 m 7.2 s 50 m 3.6 s 80 m 5.8 s 30 m 3.6 s 100 m 7.2 s 40 m 4.8 s 100 m 12 s
Introduction – ModellingStreetswithGraphsFrom OSM toRoutable Graphs Compressed Graph Graph compressionreducescomplexity: Reductionofcomputationaleffort 100 m 7.2 s 150 m 10.8 s 180 m 13 s 30 m 3.6 s 100 m 7.2 s 40 m 4.8 s 100 m 12 s
Introduction – ModellingStreetswithGraphsFrom OSM toRoutable Graphs Compressed Graph withturn restrictionsandturn penalties Turn restrictionsarederivedfrom OSM tags, turn penaltiesmaybeintroducedfor time optimal routing 10.8 s 13 s 100 m 12 s
Introduction – ModellingStreetswith GraphsLectureAssumptions
AlgorithmsOverview Routing GenerateRoutable Graph Determine Origin / Destination B B B A A A D D D Find Path C C C
AlgorithmsSearch Trees A B C D D B Search Tree Graph A D C
AlgorithmsSearch Trees {A} A B C D D {A, B} {A, B, D} {A, B, C} {A, B, C, D} A searchtreecanbemadefrom a graph Eachchildnodedenotes a paththatis a one-stepextensionofthepathdenotedbyitsparent Convertinggraphsintosearchtrees:Tracing out all possiblepathsuntilnofurtherextensionispossible
AlgorithmsPathfinding: Problem Formulations B B • A : Find a Path • Depth First • Breadth First • Best First A A D D C C • B : Find an optimal Path • Dijkstra • A*
AlgorithmsCompleteness A searchalgorithmiscompleteifitisguaranteedto find anexistingsolution in a finite amountof time. (Almost) all algorithms in thislecture
AlgorithmsPathfindingExample Graph 8 5 4 3 6.4 5
AlgorithmsGround Rules Example Graph Invalid Path PathsneverbitetheirowntailGenerally applicable
AlgorithmsGround Rules Example Graph 1 TiesareresolvedlexicallyApplicableforexamplegraph 2 3
Algorithms – British MuseumDescription • Algorithm: • Randomlyappend Nodes topathwhile not stuck. • Ifdestination was reached: Success • If stuck, startover
AlgorithmsMunich Demo Graph Properties:1. BidirectionalEdges 2. StaticWeights 3. Weights = Distances 4. Main Roads 5. No Turn Restrictions 6. Basic Road Geometry
Algorithms – Depth FirstDescription • Algorithm:From „ArtificialIntelligence“ by Patrick H. Winston • Form a one-element queueconsistingof a zero-lengthpaththatcontainsonlytherootnode • Untilthefirstpath in thequeueterminates at thegoalnodeorthequeueisempty, • Remove thefirstpathfromthequeue; createnewpathsbyextendingthefirstpathto all theneighborsofthe terminal node • Reject all newpathswithloops • Add thenewpaths, ifany, tothefrontofthequeue • Ifthegoalnodeisfound, announcesuccess; otherwiseannouncefailure
Algorithms – Depth FirstDescription • Algorithm:From „ArtificialIntelligence“ by Patrick H. Winston • Form a one-element queueconsistingof a zero-lengthpaththatcontainsonlytherootnode • Untilthefirstpath in thequeueterminates at thegoalnodeorthequeueisempty, • Remove thefirstpathfromthequeue; createnewpathsbyextendingthefirstpathto all theneighborsofthe terminal node • Reject all newpathswithloops • Add thenewpaths, ifany, tothefrontofthequeue • Ifthegoalnodeisfound, announcesuccess; otherwiseannouncefailure Divingintothe Search Tree
Algorithms – DepthFirstCharacteristic Search Tree S G narrowanddeep
Algorithms – DepthFirstPathfindingExample Graph A B Backtrack Backtrace C