Open aoles opened 2 years ago
I was able to find a reproducible example on the HD test graph where adding a 3rd location increases the original travel time. This happens regardless of the matrix algorithm used, i.e. both for RPHAST and Dijkstra.
library(openrouteservice)
options(openrouteservice.url = "http://localhost:8082/ors")
coordinates <- list(
c(8.679177, 49.41364),
c(8.686624, 49.423034)
)
(ref <- ors_matrix(coordinates)$durations)
#> [,1] [,2]
#> [1,] 0.00 353.47
#> [2,] 364.28 0.00
coordinates[[3]] <- c(8.679672, 49.413868)
(res <- ors_matrix(coordinates)$durations)
#> [,1] [,2] [,3]
#> [1,] 0.00 353.49 5.96
#> [2,] 364.28 0.00 370.25
#> [3,] 122.96 347.53 0.00
identical(ref, res[-3, -3])
#> [1] FALSE
Created on 2022-06-27 by the reprex package (v2.0.1)
It has been reported by one of the users that adding locations to the matrix query might alter the results for the existing locations, as in the example below.
Created on 2022-06-24 by the reprex package (v2.0.1)
Unfortunately, I was unable to reproduce this locally. The problem might be related the use of virtual edges introduced by the additional locations.