I’m upgrading from Graphopper 0.6 to GH 0.12. I have a suite of 84049 tests which compares routing results between improvements of routing algorithm.
Passing a test means that geometry of the result is close enough according to Hausdorff distance.
All tests were done with exact same PBF file with elevation.
With Bidirectional Dijkstra on CH graphs and Astar on graphs without CH.
On new GH only node based traversal is used.
We use Graphopper for routing but have custom encoder and weighting function.
After upgrading to GH 0.12 93.65% of tests passes. But some have weird results.
For example this one: Blue is new version. Red is old one. Blue pin is origin.
Path with extra 90° turn in it is longer and has larger weight then one without.
And the problem is if I set waypoints so that new version returns same path as old, weight of this path is lower then the path it found by itself. Difference in weight is 6.
This can only be reproduced with full planet import. Even importing just the Italy problem doesn’t appear.
During debugging I saved all edges for which weight was calculated during path search for this example:
It seem some VirtualEdgeIterator edges were traversed to Africa. In current GH version (0.6.0) this looks like this (red lines). They end somewhere in Russia. This happens in both cases correct and wrong in old and new.
Here are weights of edges. And path with 10+56=66 is taken over path with weight 60.
Distance of edges also look weird. Street edges look fine. But those long edges are 500km and more and have only distance of 5 or 58. Old GH is the same.
Here is even bigger problem:
Difference in weight is 5000 which is twice the weight in old version. New path is also longer has larger duration and has more uphill/downhill.
If we look in this example more:
A ----------------- B
A-B current 5883.979672842171
A-B new 11138.015028445223
A x B current 5883.966151234559
A x B new 5883.9663680501535
Disabling CH fixes most of this issues but can’t be used in practice.
Disabling CH doesn’t fix all problems. For example this one is strange:
Same distance/duration/uphill/downhill but weights differ for 2.6104560787819224. (New one is worse)
Retesting failing test cases with CH disabled fixes 60% of them.
Interestingly even in tests which have same results in geometry there is occasionally weight difference between versions (old GH vs new) from -10500 to 15211. Average difference is around 0. But there are 19-700 cases per sport where result is completely the same and weights differ. Sometimes they are better and sometimes worse. This also happens with CH disabled.
There are also some tests where origin/destination is snapped to different point in new version.
I assume that algorithm itself is fine but does anyone know what could be the issue in weighting for this weird results?