[英]QuickGraph BreadthFirstSearch
I am using QuickGraph library and I need a method to get the distance or the route from a vertex to itself. 我正在使用QuickGraph库,并且需要一种方法来获取从顶点到自身的距离或路线。 My graph is a Directed and weighted also it can be cyclic.
我的图是有向图和加权图,也可以是循环图。 I have read that I need to use bfs but I could not see any implementation for BFS for this.
我已经读过我需要使用bfs,但是为此我看不到BFS的任何实现。
Do you have any idea how I can accomplish this? 你有什么想法我能做到吗?
This might help: There is a BFS algorithm in QuickGraph, see here: https://github.com/rhishi/QuickGraph/blob/master/3.0/sources/QuickGraph/Algorithms/Search/BreadthFirstSearchAlgorithm.cs 这可能会有所帮助:QuickGraph中有一种BFS算法,请参见此处: https : //github.com/rhishi/QuickGraph/blob/master/3.0/sources/QuickGraph/Algorithms/Search/BreadthFirstSearchAlgorithm.cs
and a unit test: https://github.com/rhishi/QuickGraph/blob/master/3.0/sources/QuickGraph.Tests/Algorithms/Search/BreadthFirstSearchAlgirthmTest.cs 和单元测试: https : //github.com/rhishi/QuickGraph/blob/master/3.0/sources/QuickGraph.Tests/Algorithms/Search/BreadthFirstSearchAlgirthmTest.cs
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.