Graphs.jl icon indicating copy to clipboard operation
Graphs.jl copied to clipboard

Standardized output for shortest path algorithms

Open gdalle opened this issue 3 years ago • 4 comments
trafficstars

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 avatar Dec 02 '21 10:12 gdalle

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

abraunst avatar Feb 08 '22 16:02 abraunst

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 avatar Mar 10 '22 08:03 gdalle

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 avatar May 13 '22 11:05 gdalle

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

gdalle avatar Jun 28 '23 10:06 gdalle