阅读背景:

无加权图的最短路径(最少节点)

来源:互联网 

I'm trying build a method which returns the shortest path from one node to another in an unweighted graph. I considered the use of Dijkstra's but this seems a bit overkill since I only want one pair. Instead I have implemented a breadth-first search, but the trouble is that my returning list contains some of the nodes that I don't want - how can I modify my code to achieve my goal?I'm trying build a method which returns the sho




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: