寻找最短路径 [英] Find Shortest Path

查看:166
本文介绍了寻找最短路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一个 M *ñ网​​格,这是填充黑色和白色。给出的开始点和结束点。只有白点可以通过,如何找到起点和终点之间的最短路径?

There’s a M*N grid, which was filled by black and white color. Given the start point and end point. Only white points could be passed, how to find the shortest path between start and end?

有什么想法会深深AP preciated。

Any thoughts will be deeply appreciated.

推荐答案

有多种算法,对于这个问题,但一些重要的算法是:

There are multiple algorithm for that matter, but some of the important algorithms are :

Dijkstra算法

贝尔曼福特

弗洛伊德沃肖尔<​​/A>

Floyd Warshall

即使 BFS算法可能的选择。

这篇关于寻找最短路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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