Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Create simple_paths_generator_with_score.rs #1284
base: main
Are you sure you want to change the base?
Create simple_paths_generator_with_score.rs #1284
Changes from 13 commits
cb54aa0
096f239
295badd
11f4e55
5f0600c
8b691bd
0f494c4
c035b30
3f3577d
56feb61
311846c
0423f95
9c5a37b
59b4b59
5ba73bb
8ff5edf
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How is this different from the already existing https://github.com/Qiskit/rustworkx/blob/main/rustworkx-core/src/shortest_path/dijkstra.rs#L100 function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have not review this specific Dijkastra, but petgraph dijkastra returns only score of each node between source & target. but how to find the path from source -> target is not clear from that score. thats why i have updated the code to return the previous node as, that it followed to reach to the destination.
like - if the path for lowest score was A->B-->C->D, it will return the score, also Node (C), which is the previous node, similarly for C , it will return score & B as previous node, and for B it will return A as previous node, which we can use to reach till A from D.
Let me know if I am missing something on existing Dijkastra functioning.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general it'd be better to rework this as a while loop so the exit conditions are a bit more clear.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it actually back tracks the path till source, if the next node is source, then it exits.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see the current status, even though its same with comment one will get to know the exit state.