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

Standardized output for shortest path algorithms #77

Open
gdalle opened this issue Dec 2, 2021 · 4 comments
Open

Standardized output for shortest path algorithms #77

gdalle opened this issue Dec 2, 2021 · 4 comments
Labels
enhancement New feature or request
Milestone

Comments

@gdalle
Copy link
Member

gdalle commented Dec 2, 2021

At the moment, a_star returns a list of edges, while dijkstra_shortest_paths returns a custom state object. Would it make sense to have homogeneous outputs, at least for the single-source case?

@gdalle gdalle added the enhancement New feature or request label Dec 2, 2021
@abraunst
Copy link

abraunst commented Feb 8, 2022

What about returning a named tuple instead of a custom struct?

@gdalle
Copy link
Member Author

gdalle commented Mar 10, 2022

The problem is that not all shortest path algorithms are created equal. While Dijkstra can fill a correct shortest path tree, A* only finds the shortest s-d path with no guarantee on the vertices explored in between

However, normalizing the A* output could help solve #59

@gdalle
Copy link
Member Author

gdalle commented May 13, 2022

In a future version, I think A* should return a vector of nodes instead of edges. And we could add methods for Dijkstra & Co which, when called with a source and and destination, would also return a vector of nodes

@gdalle
Copy link
Member Author

gdalle commented Jun 28, 2023

Related: #264

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants