sources to targets: method of calculation #4166
Answered
by
nilsnolde
ThomasCombettes
asked this question in
Q&A
-
In "sources_to_targets" mode: If I send the same 5 sources and the same 5 targets, the API will return a 5x5 matrix with many identical values. Internally, does Valhalla calculate each cell one by one, or is there a slightly intelligent algorithm that factors in identical routes and returns a 5x5 matrix by computing each route only once? |
Beta Was this translation helpful? Give feedback.
Answered by
nilsnolde
Jun 15, 2023
Replies: 1 comment 2 replies
-
Sounds like #4153 maybe? If not, can you please give both, request & response? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ah are you saying that 5 same sources and 5 same targets are producing basically only 2 unique values? Well, that'd make sense, no?
We're really only doing a 1:many or many:many Dijkstra (which one is depending on costing model & sources/targets size). The 1:many is definitely doing 5 Dijkstras here, but it'll find all destinations at the same spot. The many:many I'm fairly sure it'll actually send off 10 half-Dijkstras with that combo which might in fact be slower than 1:many for bike/ped(/motorscooter?).
Why is that even useful to do 5 same locations to 5 other same locations though?