We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
How do i use the new ShortestAll function properly?
Output generated:
1 Shortest distance 1 following path [0 2 3]
Expected output:
2 Shortest distance 1 following path [0 1 3] Shortest distance 1 following path [0 2 3]
Code:
package main import ( "fmt" "github.com/RyanCarrier/dijkstra" "log" ) func main() { graph := dijkstra.NewGraph() //Add the 4 verticies graph.AddVertex(0) graph.AddVertex(1) graph.AddVertex(2) graph.AddVertex(3) //Add the arcs graph.AddArc(0, 1, 1) graph.AddArc(0, 2, 1) graph.AddArc(1, 3, 0) graph.AddArc(2, 3, 0) best, err := graph.ShortestAll(0, 3) if err != nil { log.Fatal(err) } fmt.Println(len(best)) for _, v := range best { fmt.Println("Shortest distance ", v.Distance, " following path ", v.Path) } }
The text was updated successfully, but these errors were encountered:
Turns out I'm actually braindead, I'll fix this at some point, sorry
Sorry, something went wrong.
fix issue #7, keep track of multiple best verticies instead of loggin…
b51cadb
…g when finding solution
Working correctly now. Thanks for letting me know
I can confirm that this works now. Thank you, for the great work!
No branches or pull requests
How do i use the new ShortestAll function properly?
Output generated:
Expected output:
Code:
The text was updated successfully, but these errors were encountered: