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

Add dijkstra-search #489

Merged
merged 9 commits into from
Jan 14, 2022
Merged

Conversation

georgios-ts
Copy link
Collaborator

This commit implements a dijkstra_search that traverses a graph
using Dijkstra algorithm and provides the ability to insert callback
functions at specified event points. Python users should subclass
retworkx.visit.DijkstraVisitor and overwrite the appropriate callback functions.

This commit implements a `dijkstra_search` that traverses a graph
using Dijkstra algorithm and provides the ability to insert callback
functions at specified event points. Python users should subclass
`retworkx.visit.DijkstraVisitor` and overwrite the appropriate callback functions.
@mtreinish mtreinish added this to the 0.11.0 milestone Nov 22, 2021
Copy link
Collaborator

@IvanIsCoding IvanIsCoding left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this, after #456 and #469 this feels natural and it will be a great addition.

One thing I would like to debate is not replacing our current implementation of Dijkstra, I understand it is shorter but I find it harder to maintain. It feels less straightforward with details hidden on another part of the code.

@coveralls
Copy link

coveralls commented Nov 23, 2021

Pull Request Test Coverage Report for Build 1698719141

  • 171 of 176 (97.16%) changed or added relevant lines in 4 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.02%) to 98.473%

Changes Missing Coverage Covered Lines Changed/Added Lines %
retworkx-core/src/traversal/dijkstra_visit.rs 101 106 95.28%
Totals Coverage Status
Change from base Build 1693485969: -0.02%
Covered Lines: 11546
Relevant Lines: 11725

💛 - Coveralls

@mtreinish mtreinish mentioned this pull request Jan 4, 2022
Copy link
Collaborator

@IvanIsCoding IvanIsCoding left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, fantastic addition to the 0.11 release

@IvanIsCoding IvanIsCoding merged commit 2bb0e94 into Qiskit:main Jan 14, 2022
InnovativeInventor pushed a commit to InnovativeInventor/retworkx that referenced this pull request Mar 19, 2022
* Add dijkstra-search

This commit implements a `dijkstra_search` that traverses a graph
using Dijkstra algorithm and provides the ability to insert callback
functions at specified event points. Python users should subclass
`retworkx.visit.DijkstraVisitor` and overwrite the appropriate callback functions.

* remove unnecessary test file

* revert changes in `dijkstra.rs`

* cargo fmt

* deduplicate `try_control` macro

* raise if negative weight

* fix release note

Co-authored-by: Matthew Treinish <[email protected]>
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

Successfully merging this pull request may close these issues.

4 participants