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

3
  • 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. Commented Jul 30, 2013 at 11:53
  • They uses fastet travel path. Commented Jul 30, 2013 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
    Commented Jul 30, 2013 at 16:53

1 Answer 1

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?

6
  • 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
    Commented Jul 30, 2013 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. Commented Jul 30, 2013 at 17:07
  • Its helpful but I think this thread really needs some official referencing.
    – geotheory
    Commented Jul 30, 2013 at 17:10
  • 1
    Fastest route makes some more sense. Here is a link: stackoverflow.com/questions/430142/…. Commented Jul 30, 2013 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
    Commented Jul 31, 2013 at 6:24

Not the answer you're looking for? Browse other questions tagged or ask your own question.