Is the directions API deterministic?

Hi ORS Team,

As always, many thanks for open sourcing Your amazing work!

My question is in it’s essence stated in the title. Given a fixed graph file, profile, etc. would two calls with the same parameters to the directions API always produce the same sequence of coordinates up to floating point errors?

Building on that, given two routes R1 := (A → B) and R2 := (C → D), that have a common sub-path (X → Y), i.e. R1 = (A → X → Y → B) and R2 = (C → X → Y → D), would the directions API produce the same sequence of coordinates for the path (X → Y) in both cases (up to floating point errors)?



Hi Alex,
should be the case as you described. If nothing changes, the routes should be the same. The algorithms are deterministic and optimal.

1 Like