-
Notifications
You must be signed in to change notification settings - Fork 164
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
Shortest Path Panic #1117
Comments
The code is panicking when accessing the scores for the shortest path but the culprit is probably this: Maybe the subgraph does not have the current |
Ok I think get why you are getting a panic. The good news is there is no bug in Here is a short snippet to reproduce the same error message you posted:
Subgraph generates new node indices, hence you need to account for that in your code. You should not call shortest path functions with the old node indices. The fix from our side will be to add a more clear error message so you get an |
Information
What is the current behavior?
I see a panic when running
rustworkx.dijkstra_shortest_paths
andrustworkx.dijkstra_shortest_path_lengths
on a graph produced byPyGraph.subgraph
. The subgraphs are quite small, hundreds of nodes while the main graph is 100k nodes.Running on the larger graph seems to work fine. I think it may be due to the fact that the node ids remain the same as the one in the original graph, but they might be accessed in a way that goes out of bounds in the subgraph?
What is the expected behavior?
Steps to reproduce the problem
Pseudocode:
The error occurs on
rustworkx/rustworkx-core/src/distancemap.rs
Line 52 in eb896fb
The text was updated successfully, but these errors were encountered: