-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Node Based Graph Representation vs. Edge Based Graph Representation #392
Comments
@wangyoucao577 I think this is a very interesting problem to discuss. Here is some of our summary from previous notes(around 2010/2012) WhyThe major reason of abstracting Node based graphMy personal experience of graph abstraction is mainly based on this strategy. The key point is node based Dijkstra, during Edge based graphTelenav's BJ lab has rich experience on It increases the size of graph, and as you said, hide complexity of ProblemsBesides abstraction, I think there are difference between this two abstractions. |
@CodeBear801 Thanks for the information. Whether should build a As you mentionded, the turn section(section 4) of CRP discussed it a lot, which I found that I haven't really understood before.
[Jay]: It indeed mentions the node based graph representation. It's the classic graph in graph algorithm of computer science that doesn't consider turn by default.
[Jay]: So the author thoughts that edge based graph representation is a traditional and wasteful method...
[Jay] CRP proposes turn table, names it compact representation.
[Jay] Dijkstra algorithm simulates an execution on the edge-based graph representation when relax with turn handling. That's exactly what we do in bidirectional Dijkstra/A*. |
Read ETA Phone Home: How Uber Engineers an Efficient Route again, it mentioned:
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
osrm-backend/src/extractor/edge_based_graph_factory.cpp
Lines 292 to 294 in 3906e34
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?
The text was updated successfully, but these errors were encountered: