Open LdDl opened 3 years ago
Trying to do parallelism (not working for currently - WIP): https://github.com/LdDl/ch/tree/optional-parallelism
go.exe test -count=1 -v -timeout 30s -run ^TestParallelShortestPath$ github.com/LdDl/ch
Trying to do parallelism (not working for currently - WIP): https://github.com/LdDl/ch/tree/optional-parallelism
go.exe test -count=1 -v -timeout 30s -run ^TestParallelShortestPath$ github.com/LdDl/ch
Result is right sometimes, but it is inconsistent still:
Contraction Order: 187853 / 187853, Remain vertices in heap: 0. Currect shortcuts num: 390850
When for sure it should be
Contraction Order: 187852 / 187853, Remain vertices in heap: 0. Currect shortcuts num: 395295
Oh well The problem is in graph.insertShortcuts(batchShortcuts) calls. They could not be parallelized since they are inserting incident edges and thus leads us to wrong dijkstra() calls (and this is why the results are inconsistent)
Is your feature request related to a problem? Please describe. Let's take a laptop:
Run test (with debugged flag ON) on it for this Graph file containing ~211k edges:
Bassicaly it has taken ~10seconds to preprocess graph. It's not that bad. But.
Let's take another Graph file containing 251k edges:
Now it's about 70+ minutes. I guess the problem with that graph is (a) topology + (b) a lot of Dijkstra function calls during contraction process on last ~10k steps in priority queue (vertices sorted by importance).
Something needs to be done with preparing contraction hierarchies: improve heuristics (I don't think that ~[edges_num*2] number of generated shortcuts is a good ...) / delete unnecessary calculations / refactor code (probably find hidden bugs)
Additional context Used heuristics currently:
2 .Lazy update heuristic: