问题
I will like to know if anyone has an idea on the concept behind point to point route generation on google maps and nokia maps. What logic was used to determine the route and generate directions from any point on the map to another? I wouldn't mind guesses or something of that sort. I just want to understand, how it works.
回答1:
This is just a guess, but probably something like Dijkstra's algorithm. It most likely is some kind of graph-search algorithm, with each node representing an intersection and each edge representing a section of street.
回答2:
I will also add that the graph here is likely also weighted, with each weight corresponding to how important the road is. For example, Interstate highways may have a greater weight than state highways, which have a greater weight than local roads, which have a greater weight than simple streets. Optionally, toll roads may have a lower weight than non-toll roads.
来源:https://stackoverflow.com/questions/8013411/how-does-google-maps-and-nokia-maps-generate-routes-from-point-to-point