有一个 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算法
贝尔曼福特
弗洛伊德沃肖尔
Floyd Warshall
即使 BFS算法可能的选择。
上一篇:如果用做循环数组问题数组、问题
下一篇:阵列的GCD阵列、GCD