Replies: 2 comments
-
I forgot to say how I'm solving it in the meantime.. I have created my own function that includes missing paths, maybe this can help others. Using the function would be exactly the same as the original pgr_ksp
Use this function as the original one
|
Beta Was this translation helpful? Give feedback.
0 replies
-
@casasvic
please send to vicky at erosion.dev |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Problem
TL;DR: pgr_KSP function ignores options where vertex collection is the same as another better result. If you can get from point A to point B, traversing exactly the same nodes as another solution, this solution is not considered
To Reproduce

Create a topology, in this example we have already created our tables "noded" and "noded_vertices_pgr" using pgr_nodeNetwork and pgr_createTopology
Then after apply pgr_KSP, only show as possible options edge 7, and edge 9+10.
Edge 8 is missing due to have the same vertex collection as edge 7 (vertex 7 and vertex 8, but through edge 8 instead of edge 7). If edge 8 is split (same as example edge 9+10), then it works and returns 3 path results, just because vertex collection for this result would be different
SQL from node 7 to node 8, we allow reverse as well, and limit to 3 paths, but only 2 will return:
Result:

Expectation
Get all shortest paths, even if the vertex combination already exists as result, but have a different edges collection. This includes third path, using nodes 7,8 with edge 8 (almost like the first one, but using edge 8 creating a new path_id=3)
Platform/versions
Beta Was this translation helpful? Give feedback.
All reactions