Technote: Graphhopper vs OSRM vs Gosmore

A new contestant for our Openstreetmap routing competition enters the ring: Graphhopper. Will it stand up against the renowned routers OSRM and Gosmore?

Our needs
Let’s make it clear again: we have tailored our test of OSM routers to our our needs. The results and conclusion may not be valid at all for all routing needs. Be careful with interpreting this test. Each router has strong sides which makes it outstanding in its own field.

For our public multiple stop routing service, we need millions of point-to-point routes each day. RouteXL optimizes the fastest road trip to multiple destinations. For each trip optimization, all intermediate travel durations between stops are needed. E.g. to find the best route via ten locations from one origin, we need 11 x 10 = 110 routes. For 40 locations we need 1.640 routes. And so on.

Previously, OSRM won the battle with Gosmore in its speed. But OSRM was not yet able to run on the small and cheap servers that we use to date. That kept us from implementing it world-wide so far. We were quite happy when another new contestant “volunteered” to join in on our test. Would it combine both strengths: be as fast as OSRM, with the small requirements as Gosmore?

The new router in this test is Graphhopper. On its website it says to be a fast and Open Source road routing engine. It’s business-friendly due to its Apache License and promises to scale from big server to mobile device. Graphhopper is implemented in Java and has a API interface, which makes it easy to integrate with our system. It’s development is quite active.

Test results
We used the same test as before. Random points on a small map were selected. These generated random legs to be routed. The percentage of successful routes and time for route calculation were recorded. Routes were validated by minimum and maximum durations, based on the distance as the crow flies.

Total legs: 10.000 
Total time Gosmore: 671.423sec OSRM: 28.682sec GraphHopper: 23.586sec 
Success Gosmore: 97.6% OSRM: 98% GraphHopper: 99.1% 
Too slow Gosmore: 0% OSRM: 0% GraphHopper: 0% 
Too fast Gosmore: 0% OSRM: 0% GraphHopper: 0%

On these 10.000 legs, Graphhopper is a lot faster than Gosmore, and even faster than our previous winner OSRM. Also its success rate is higher, close to 100%. The new kid on the block takes it all.

But as with OSRM, it won’t run for the whole planet on our “small” 4GB solver servers, that do the routing optimization behind the screens. Also, Graphhopper’s code is still under active development and not stable yet. Backward compatibility is not guaranteed until the first stable release.

We are highly impressed by Graphhopper’s performance. Because demand for our service is growing rapidly and Amazon Web Services has dropped prices for its EC2 servers, we took a chance. We’ve upgraded one solver server to meet Graphhopper’s requirements and installed the software.

We had a bit of trouble getting it up and running, but today we’ve connected it to our routing optimization models. It does a great job and gives the performance boost as indicated by the test results. We’ll monitor closely in the coming period, but for now it is: welcome on board, Graphhopper!