找到最短路径平等加权图 [英] Finding shortest path for equal weighted graph
本文介绍了找到最短路径平等加权图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个曲线图,它等于权重。我如何才能找到最短路径?
我们可以使用 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
这篇关于找到最短路径平等加权图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文