Skip to content

Node Based Graph Representation vs. Edge Based Graph Representation #392

@wangyoucao577

Description

@wangyoucao577

Read ETA Phone Home: How Uber Engineers an Efficient Route again, it mentioned:

Some people want to model road segments as nodes, and edges as the transition between one road segment to another. This is called edge-based representation, in contrast to the node-based representation mentioned before. Each representation has its own tradeoffs, so it’s important to know what you need before committing to one or the other.

But what exactly tradeoffs between the two models?

Node based vs Edge based graph representation discussed some, e.g., the edge based graph representation(a.k.a., edge-expanded graph representation or arc-based graph representation) is better to process turn costs, but its data size will increase by a factor 3.

As mentioned in Project-OSRM#4851 (comment), OSRM uses edge based graph representation to deal with turn too.
Also, OSRM uses 4 to estimate the increasing, which also explains some reason that why OSRM compiled data is so big. See

// heuristic: node-based graph node is a simple intersection with four edges
// (edge-based nodes)
constexpr std::size_t ESTIMATED_EDGE_COUNT = 4;

Edge based graph representation is perfect for simple turns, include turn costs/restrictions. We don't need to consider turn anymore once the edge based graph generated.
However, complex restrictions or time restrictions are difficult to deal with in this case since we have to process all the information to edge based graph representation and record everything to perform in query. That's why OSRM hasn't support them yet, and maybe they'll never be supported in the future.
Process to edge based graph representation also may affect customzie performance in MLD. The input of osrm-customize are OSM NodeIDs, which means we have to convert OSM NodeIDs -> OSRM Edge Based Graph every time.

Dynamic information, for instance live traffic, become more and more important in these years, as well as the future. Node based graph representation might be better by this trending since it's more near the original graph, and will be easier to perform dynamic information.

A ideally approach might be CRP/MLD implemented on node based graph. Any open source choice?

Metadata

Metadata

Assignees

No one assigned

    Labels

    IdeasIdeas for long-term discussionResearchRead paper/issue/code for better understanding

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions