4

How does the Google Distance Matrix API calculate the distance from point A to B. Often there are multiple ways to go from A to B and the question is how Google prioritizes different routes to find the one that is used for the distance calculation. Strategies could be:

  1. Fastest
  2. Shortest
  3. Low risk of queues
  4. Etc.

Sincerely, Henning

hboettger
  • 81
  • 2
  • 7
  • 1
    It's probably a shortest-path calculation regardless, with different priorities reflected in lengths of road segments that differ from their actual values. The shortest-path computation itself likely uses hierarchical graph separators or one of the algorithms that exploits low highway dimension. – David Eisenstat Jul 30 '13 at 11:53
  • They uses fastet travel path. – Micromega Jul 30 '13 at 12:01
  • Just what I'm after. The API documentation says nothing about the algorithms. An idea of priorities would be great, but I think we also deserve some description of the benchmarks/assumptions used for road speed estimation etc, especially for journey time data. – geotheory Jul 30 '13 at 16:53

1 Answers1

0

Google map calculation uses a fastest calculation but the distance matrix api can also gives accurate distance in meters. Here is some answer from Nick Johnson unfortunatelynot about the question: What algorithms compute directions from point A to point B on a map?. At least the algorithm is a modified. I think with fastest calculation the map is more flexible. I don't see why they can't switch between both?

Community
  • 1
  • 1
Micromega
  • 12,486
  • 7
  • 35
  • 72
  • Do you have a reference for this? I don't see how the algorithm can be based on both fastest and shortest, unless choosing between equivalent duration journeys/segments. – geotheory Jul 30 '13 at 17:00
  • The algorithm works with time but the distance api also provides distance matrix. with both I don't mean it uses both. Maybe it not useful that you know? But the title says distance matrix. – Micromega Jul 30 '13 at 17:07
  • Its helpful but I think this thread really needs some official referencing. – geotheory Jul 30 '13 at 17:10
  • 1
    Fastest route makes some more sense. Here is a link: http://stackoverflow.com/questions/430142/what-algorithms-compute-directions-from-point-a-to-point-b-on-a-map. – Micromega Jul 30 '13 at 18:00
  • Thanks for the answer and link to an interesting discussion. Just like @geotheory, I am also looking for facts and references to documentation stating what the strategy is. – hboettger Jul 31 '13 at 06:24
  • dijkstra algorithm. good answer here http://stackoverflow.com/questions/39256309/calculate-the-shortest-route/39256428#39256428 – Alex Filatov Aug 31 '16 at 21:40