开发者

How do I determine where I can get from the city by car? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, o开发者_开发知识库r extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 10 years ago.

How do I determine where I can get to from the city (say New York) for 2 hours (can change) by car?


First create a graph :

  • each edge is a road
  • each vertex is a city

Second Give a weight to each road = weight is the time from one city to another using this edge considering traffic etc...

Use Dijkstra's algorithm for example to calculate the min distance between 2 cities

Finally chose all the one with a weight less than 2 hours


I found Google Distance Matrix API. It's kind of what should be )

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜