如何找到地铁站的最佳路线 [英] How do I find the best possible route for metro stations

查看:160
本文介绍了如何找到地铁站的最佳路线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,我正在尝试创建一个应用程序,您可以在其中输入起始和结束目的地。然后程序会显示你应该乘坐哪些火车和/或你下车哪个火车站转换到另一条航线。



我尝试了什么:



我甚至不知道从哪里开始,我试过在谷歌上查找,并且有一个看起来如此陌生的A *算法me。

So, I am trying to create an Application where you enter your starting and ending destination. The program then displays which are the trains you should take and/or which station do you get off to switch to another line.

What I have tried:

I don't even know where to begin with, I have tried looking up ON google, and there was A* Algorithm which looks so alien to me.

推荐答案

从某种形式的数据库开始,列出所有站点,它们之间的距离,以及它们是单行还是多行。如果你在一张纸上画一个简化的地铁,你可以开始考虑如何计算最佳路线。
Start with some form of database that lists all stations, the distance between them, and whether they are on single or multiple lines. If you draw a simplified metro on a piece of paper you can start thinking about how you would calculate the optimum routes.


引用:

如何找到地铁站的最佳路线

How do I find the best possible route for metro stations



首先,您需要定义什么使路线成为最佳。

然后练习寻找站点之间的最佳路线,看看你需要什么信息来找到答案。

熟悉'A *算法'。

然后你推断出如何应用'A *算法'。


First of all, you need to define what makes a route the 'best'.
Then practice at finding the best route between stations, see what information you need to find the answer.
Get familiar with the 'A* Algorithm'.
Then you deduce how to apply to 'A* Algorithm'.


我们不做你的功课:设置是有原因的。它就是为了让你思考你被告知的事情,并试着理解它。它也在那里,以便您的导师可以识别您身体虚弱的区域,并将更多的注意力集中在补救措施上。



亲自尝试,你可能会发现它不是像你想的那么难! A *可能会起作用,或者您可能想要查看旅行推销员算法的修改。



如果您遇到特定问题,请询问此问题,我们会尽力帮助。但我们不打算为你做这一切!
We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.

Try it yourself, you may find it is not as difficult as you think! A* will probably work, or you might want to look at a modification of the Traveling Salesman algorithm.

If you meet a specific problem, then please ask about that and we will do our best to help. But we aren't going to do it all for you!


这篇关于如何找到地铁站的最佳路线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆