Repository navigation
Description
Hello,
I am currently writing a plugin for the open-source Geographic Information System (GIS) OrbisGIS called GDMS-topology consisting of several graph traversal tools and network analysis measures (e.g., closeness and betweenness centrality) for use on transportation networks. The issue is that these centrality measures require the calculation of all shortest paths in the network, and depending on the network, this calculation can take a very long time.
I have tested the NetworkAnalyzer plugin for Cytoscape on Nantes (Métropole), France using a graph produced from the IGN's BD TOPO route data. The graph has about 180 000 nodes and 235 000 edges, and the calculation has been running for almost a week on a personal computer. To try to cut down on this calculation time, I have become interested in contraction hiearchies. I looked for a Java implementation and I found GraphHopper.
I originally tried using JGraphT-SNA, a Java library based on JGraphT where these centrality measures and many other social network analysis algorithms are implemented. I used JGraphT-SNA to calculate closeness centrality on Nantes, but the calculation was about 7 times slower than NetworkAnalyzer. I'm hoping that a GraphHopper-based (and more specifically, a contraction hierarchies-based) implementation of these centrality measures will be much quicker.
For this reason, I have a few questions:
- Though GraphHopper was designed for use with OSM data, I would like to use it on graphs constructed in OrbisGIS. A graph in OrbisGIS consists of a table of nodes and a table of edges listing start nodes and end nodes. Do you think it will be relatively easy to make the connection between an OrbisGIS graph and GraphHopper? I would be possible to supply the tables in .csv format, for example. I'm looking into
LevelGraphStorage. - I was also wondering if you could explain the format GraphHopper uses to store the graph. GraphHopper seems to produce three files:
edges,loc2idIndexandnodes. I would be particularly interested in the case where we calculate the contraction hierarchies, make some updates to the graph (delete a road, for example), and recalculate the contraction hiearchies. Is it necessary to start over, or can the contraction hierarchies be updated in an efficient manner? - What heuristics are used to establish the node order necessary for calculating the contraction hierarchies?
- Which weight is used in determining the shortest path? (Only distance?) Is it possible to use different weights?
Thank you for your time and help!
Activity
karussell commentedon Dec 5, 2012
are there really no faster ways? probably the contraction hierarchy itself as we assign more important nodes a higher level ... (?)
yes this should be easy. Either implement Graph (or extend GraphStorage) or fill LevelGraphStorage with your tsv data.
in theory it is necessary to start over, but under specific circumstances it is ok to apply minor modifications (but not optimal in terms of speed). I'll search ...
the edge difference, the original edges count and the contracted neighbors:
https://github.com/graphhopper/graphhopper/blob/master/src/main/java/com/graphhopper/routing/ch/PrepareContractionHierarchies.java#L218
you can use everything for weight. look into the PrepareCH class again where I'm doing:
iter.distance(prepareWeightCalc.getWeight(iter.distance(), iter.flags()));
this looks a bit strange but it calculates newDistance = time = distance / velocity. Some further explanations why this is necessary:
karussell commentedon Dec 5, 2012
search for "Dynamic highway-node routing." it is not that easy/quick.
karussell commentedon Dec 6, 2012
3 notes (or how you could try to avoid CH):
Or combine the points somehow (e.g. do some random routing and reuse the SSP tree)
agouge commentedon Dec 6, 2012
Thanks for all the info!
I wrote some code to load my csv data (produced by my
ST_Graphfunction) into a LevelGraphStorage. I'll soon redo myST_ClosenessCentralityfunction in order to see if GraphHopper can offer some speed improvements by means of contraction hierarchies.I'll keep you up to date!
karussell commentedon Dec 18, 2012
All things clarified here and would you close this? (no problem if you reopen at a later time)
agouge commentedon Dec 19, 2012
Yes, thanks!
rakeshramesh commentedon Feb 7, 2013
I need help in executing this file ..I want to find the node ordering for my given input..can u kindly tell me the steps ?/
karussell commentedon Feb 7, 2013
Please avoid posting your questions more than once - they won't get answered faster with this tactic - see #14 !
rakeshramesh commentedon Feb 7, 2013
sorry ....I wasn't able to view it earlier as the filter was applied ....
karussell commentedon Apr 22, 2013
@agouge do you have a comparison of the speed from graphhopper vs. jgrapht-sna? Preferable normal dijkstra + dijkstra-CH :) !
fixing graphhopper#5, avoid virtual edges in public response of MapMa…
added test to ensure no virtual edge is returned, graphhopper#5
Allow multiple waypoints (#5)
Merge of navigation repository (#2071)
RSPS-621: Add Monaco tests (graphhopper#5)
Merge pull request graphhopper#5 from karololszacki/transport-mode-part2