-
Notifications
You must be signed in to change notification settings - Fork 184
yen_k_shortest_paths with k=2 returns same path twice #1505
Comments
Can reproduce locally. |
@Thuener - do you have a few cycles to help here? |
I will take a look, give me some days plz. |
I suffered from the same problem. For example, l.53 in the source code of And, in this case, I solved this issue by doing the following.
If you do like this, you will get the expected result. About the source code for
|
Nice work @yucho147! Thanks for that detailed explanation. JuliaGraphs members, should we close this issue in favor of the existing one in SimpleWeightedGraphs.jl? In the mean time, this workaround should be sufficient to get things running at least. |
Description of bug
When trying to find the two shortest paths from
source
totarget
,yen_k_shortest_paths
returns the same path twice instead of two different paths that have the same weight.How to reproduce
Expected behavior
I would expect to get back two paths,
[2 4 8]
and[2 6 8]
, which both have the same cost distance.Actual behavior
Instead,
[2 4 8]
is returned twice.Code demonstrating bug
See "how to reproduce" above.
Version information
versioninfo()
] status LightGraphs
[093fc24a] LightGraphs v1.3.0
Additional context
I'm using SimpleWeightedGraphs.jl (v1.1.1). Please let me know if I should open this issue in SimpleWeightedGraphs.jl instead.
The text was updated successfully, but these errors were encountered: