JuliaGraphs / Graphs.jl

An optimized graphs package for the Julia programming language
http://juliagraphs.org/Graphs.jl/
Other
457 stars 90 forks source link

Standardized output for shortest path algorithms #77

Open gdalle opened 2 years ago

gdalle commented 2 years ago

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?

abraunst commented 2 years ago

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

gdalle commented 2 years ago

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 commented 2 years ago

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 commented 1 year ago

Related: https://github.com/JuliaGraphs/Graphs.jl/issues/264