You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What is your docs question about? Ask it
I assumed ShortestPathOneToMany used some clever algorithmic trick (like unidirectional Dijkstra is able to calculate all targets for one source in one go). Now, having read the algorithm source code, it seems to be almost the same as executing ShortestPathOneOne for all targets in sequence. The only difference I can see is that it is reusing the data structures across iterations. Is it only about reducing allocations or is there some deeper optimization that I cannot spot?
What do you suggest?
Add a section to README about how ShortestPathOneToMany works and why it is faster.
Additional context
None
The text was updated successfully, but these errors were encountered:
There is no clever trick. This is all about just reducing amount of allocations as you noticed.
reusing the data structures across iterations
Yes. It's just used in relaxation functions and nothing special:
// ...// cid - ID of queue for certain target nodeifforwProcessed[temp] !=cid||queryDist[temp] >alt {
queryDist[temp] =altprev[temp] =vertex.idforwProcessed[temp] =cidnode:=&bidirectionalVertex{
id: temp,
queryDist: alt,
}
heap.Push(forwQ, node)
}
// ...
We are not planning to make section about this function currently, since it's not a big optimization (at all, lol).
When we have some really useful optimization we'll make docs for it for sure.
LdDl
changed the title
[DOCUMENTATION] Explanation about ShortestPathOneToMany
[DOCUMENTATION | DELAYED] Explanation about ShortestPathOneToMany
Sep 15, 2022
What is your docs question about? Ask it
I assumed
ShortestPathOneToMany
used some clever algorithmic trick (like unidirectional Dijkstra is able to calculate all targets for one source in one go). Now, having read the algorithm source code, it seems to be almost the same as executingShortestPathOneOne
for all targets in sequence. The only difference I can see is that it is reusing the data structures across iterations. Is it only about reducing allocations or is there some deeper optimization that I cannot spot?What do you suggest?
Add a section to README about how
ShortestPathOneToMany
works and why it is faster.Additional context
None
The text was updated successfully, but these errors were encountered: