我有一个曲线图,它等于权重。我如何才能找到最短路径?
我们可以使用 Dijkstra算法
,找到最短路径。我认为,回溯会在这种情况下使用。但是否有任何其他的方式找到最短路径优化为图等于权重?
I have a graph which is of equal weights. How can I find the shortest path?
We can use DijKstra's Algorithm
and find the shortest path. I think backtracking will be used in this case. But is there any other way to find the shortest path optimally as graph is of equal weights?
BFS是到另一个地方,从一个节点的最短路径的最好方式......它首先找到的所有距离为1,那么2和节点等
BFS is the best way to get the shortest path from one node to another...it first finds all the nodes at distance 1 then 2 and so on