Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dijkstra for k-shortest paths? #195

Open
davidlfox opened this issue Jun 14, 2019 · 2 comments
Open

Dijkstra for k-shortest paths? #195

davidlfox opened this issue Jun 14, 2019 · 2 comments

Comments

@davidlfox
Copy link

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.

@jnyrup
Copy link
Contributor

jnyrup commented Nov 3, 2019

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.

@KeRNeLith
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants