Skip to content

Latest commit

 

History

History
55 lines (46 loc) · 4.77 KB

understanding_osrm_graph_representation.md

File metadata and controls

55 lines (46 loc) · 4.77 KB

Understanding OSRM Graph Representation

OSRM will convert original map data (i.e. OSM) to an edge-expanded graph as first phase in Processing Flow, which exactly will be done by osrm-extract. All subsequent algorithms (i.e. Multi-Level Dijkstra, Contraction Hierarchies) will based on this edge-expanded graph.

Terminology

Name Belongs to Synonym Description
OSM Node OSM An OSM node is a 2D point with latitude and longitude, i.e. a geo-coordinate.
OSM Way OSM An OSM way connects a number of nodes. A way is thus a 2D poly-line, consisting of a number of segments. Several ways can share the same node where they cross.
OSM Relation OSM An OSM relation relates several nodes or ways, or both. It can be used for turn restrictions, routes, and other things. A relation is often not a physical structure, but an abstraction like a bus route for example.
Segment OSRM OSM Segment A segment is a line connect 2 OSM nodes, undirected. A OSM way can be splitted to several segments.
Edge OSRM Node Based Edge A Node Based Edge is a segment with direction. One segment can be splitted to 2 Node Based Edges with different direction. NOTE: This is not a important concept in OSRM.
Graph Node OSRM Edge Based Node Similar with Node Based Edge, Graph Node represents a specific direction (forward or backward) of an segment. There are two graph nodes for a bidirectional segment, but only one if it's a oneway segment. In another word, use a graph node represent a edge.
Graph Edge OSRM Edge Based Edge, Movement Based Edge A Graph Edge is a possible movement(a possible maneuver) taking you from one Graph Node to another. I.e. FromGraphNode-ToGraphNode.
Edge-expanded Graph OSRM Edge-expanded Graph means a graph created by Graph Nodes and Graph Edges. OSRM loads the OSM data, and transforms it into an edge-expanded graph that's better suited for modelling turn costs and turn restrictions.

Process of Convert OSM to OSRM Edge-expanded Graph

node-based-graph_to_edge-based-graph-1 node-based-graph_to_edge-based-graph-2 node-based-graph_to_edge-based-graph-3 node-based-graph_to_edge-based-graph-4 node-based-graph_to_edge-based-graph-5 node-based-graph_to_edge-based-graph-6

Process of Query Based on OSRM Edge-expanded Graph

query-on-edge-based-graph-1 query-on-edge-based-graph-2 query-on-edge-based-graph-3 query-on-edge-based-graph-4 query-on-edge-based-graph-5

Basic Changes of Convert OSM to OSRM Edge-expanded Graph

Here's an image that shows the basic changes in the graph leading up to the edge-based graph. Some details (bidirectional edges) are ignored for the sake of simplicity:
graph_representation_basic_changes

Known Issues

  • via-way restrictions
    From issues #2681 and #4439, multiple vias of via-way restrictions have not been supported yet.

References