QuickGraph icon indicating copy to clipboard operation
QuickGraph copied to clipboard

Dijkstra for k-shortest paths?

Open davidlfox opened this issue 5 years ago • 2 comments

What's the syntax for using Dijkstra for k-shortest paths e.g. if I want to find the second or third-shortest paths to a vertex by distance?

I thought I was onto something here, but it was just displaying all distances from one vertex.

davidlfox avatar Jun 14 '19 04:06 davidlfox

Dijkstra's algorithm will only find the single shortest path. To find the k-shortest paths you can use Yen's algorithm. This library has an implementation of it with a few tests, but according to #178 the are bug(s) in the implementation.

jnyrup avatar Nov 03 '19 15:11 jnyrup

Hello, I forked this QuickGraph repository (here) and made a fix to the Yen algorithm. Note that I also refactored a lot of the QuickGraph core library in the same time to make it .NET Core compliant.

KeRNeLith avatar Dec 30 '19 14:12 KeRNeLith