简体   繁体   English

在quickgraph中获取2个节点之间的最短路径

[英]Getting shortest path between 2 nodes in quickgraph

i want to ask if there is any way to generate the shortest path from node A to node B without generating the shortest paths to all the other nodes (stop when node B is in the examined set) with A-star in QuickGraph. 我想询问是否有任何方法可以生成从节点A到节点B的最短路径,而不生成QuickGraph中带有A-star的所有其他节点的最短路径(当节点B在检查集中时停止)。

I want to plug QuickGraph into a game and thus generating all the paths is not allowed from the time limitations the environment imposes. 我想将QuickGraph插入到游戏中,因此不允许从环境施加的时间限制中生成所有路径。

Any other suggestions to solve my problem in C# are welcome 我欢迎任何其他建议来解决我在C#中遇到的问题

Thanks in advance, Xtapodi 提前谢谢,Xtapodi

我们如何才能获得完整的路径而不是距离?

Quickgraph 3.3 has a built-in implementation of A* : Quickgraph 3.3有一个内置的A *实现:

QuickGraph.Algorithms.ShortestPath.AStarShortestPathAlgorithm<TVertex,TEdge>

which version of quickgraph are you using ? 您使用的是哪个版本的quickgraph?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM