views:

211

answers:

2

Hello, 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.

I want to plug QuickGraph into a game and thus generating all the paths is not allowed from the time limitations the environment imposes.

Any other suggestions to solve my problem in C# are welcome

Thanks in advance, Xtapodi

A: 

You'll have to use Dijkstra's shortest path algorithm. With this algorithm you won't have to calculate all shortest paths to all other nodes, but it still has to calculate a lot of shortest paths to ensure the path to node B is guaranteed the shortest.

Steven
I need to use A* as i mentioned and i need an answer on QuickGraph or an alternative library not a wikipedia link.Thanks in advance, Xtapodi.
Xtapodi
+1  A: 

Quickgraph 3.3 has a built-in implementation of A* :

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

which version of quickgraph are you using ?

digEmAll