Closed latot closed 2 years ago
Hi,
Yes, there is a performance difference depending the OD matrix sparsity.
When you call get_distance_matrix()
or get_multi_paths()
, Dijkstra algorithm stop when all nodes are reached (recall that Dijkstra algorithm let find shortest path between an origin node and all nodes of the network).
On the other hand, get_*_pair()
function can run different algorithms, but each one stop when destination node is reached.
For unidirectional search like Dijkstra with early stopping (Dijkstra
) and A*
, it's the same as inflating one baloon until destination node:
For bidirectionnal dijkstra (bi
) or bidirectionnal A*(nba
) , it's like inflating two balloons until contact :
I hope it's clear !
Hi, this is just a tricky question, I would like to know..., if there is a difference between the matrix function and pairs functions, like the shortest path or the distance one. Is there any difference in the performance? I can always do a `` èxpand.grid``` the nodes from a matrix and do it in the pair function, the actual functions (matrix and pair) are helpers to run in a low level function, or they have indeed code to have better performance.
The only thing.., I can think if there is no performance, maybe, is the cost of store the expanded matrix in pairs, some of them can be very heavy in pairs.
Thx!