Skip to content

Latest commit

 

History

History
32 lines (21 loc) · 637 Bytes

README.md

File metadata and controls

32 lines (21 loc) · 637 Bytes

dijkstra

Let's implement the Dijkstra Algorithm.

Inspired by this lesson: https://www.youtube.com/watch?v=pSqmAO-m7Lk

Distance table: Example usecase

Nodes/Vertices 0 1 2 3 4
Distance from node 0 3 1 4 7

Example Weighted Graph

Directed Acyclic Graph

Adjacency list

Adjacency List

Result of Dijkstra shortest path

dijkstra

Result

dijkstra git:(master) go run main.go
Distance array:  [0 3 1 4 7]
Shortest Path:  [2 1 3 4]
Shortest Distance:  7