You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current implementation only includes a way to find single source shortest paths in graphs with positive edges using Dijkstra. It would be useful to have an implementation where this restriction is not necessary. This would require the Bellman–Ford algorithm.
Ideally, I would like to see three functions: .dijkstra and .bellmanFord and simply .shortestPaths which chooses the appropriate underlying algorithm among the previous two. This would require keeping track of whether there are any negative edges (by counting them).
The text was updated successfully, but these errors were encountered:
Given that checking for negative edges requires Θ(E) ( maybe until edges are handled diffrently by the library #90 ) , is the .shortestPaths function still wanted? Should I include it in #88 ?
All shortestPath implementations we have are Ω(E) so the asymptotic complexity is not harmed by including an initial check for negative edges. Hence I think it makes sense even if #90 is not implemented.
The current implementation only includes a way to find single source shortest paths in graphs with positive edges using Dijkstra. It would be useful to have an implementation where this restriction is not necessary. This would require the Bellman–Ford algorithm.
Ideally, I would like to see three functions:
.dijkstra
and.bellmanFord
and simply.shortestPaths
which chooses the appropriate underlying algorithm among the previous two. This would require keeping track of whether there are any negative edges (by counting them).The text was updated successfully, but these errors were encountered: