Registry / utility / ryancarrier-dijkstra

ryancarrier-dijkstra

JSON →
library1.4.0gogounverified

A Go implementation of Dijkstra's shortest path algorithm for weighted graphs.

go get github.com/RyanCarrier/dijkstra
INSTALL
IMPORT
SIG · RYANCARRIER-DIJKST
R
ryancarrier-dijkstra
utilitygov1.4.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

dijkstra
github.com/RyanCarrier/dijkstra

Computes the shortest path between two vertices in a weighted graph.

package main import ( "fmt" "github.com/RyanCarrier/dijkstra" ) func main() { graph := dijkstra.NewGraph() graph.AddVertex(0) graph.AddVertex(1) graph.AddArc(0, 1, 5) bestPath, err := graph.Shortest(0, 1) if err != nil { fmt.Println("No path found") return } fmt.Printf("Shortest distance: %d\n", bestPath.Distance) }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
1.4.0latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
ryancarrier-dijkstra — go get ryancarrier-dijkstra · libregistry