Skip to content

Instantly share code, notes, and snippets.

View TobiahRex's full-sized avatar
🛠️
Building ... 👷🏻‍♂️

Tobiah Rex TobiahRex

🛠️
Building ... 👷🏻‍♂️
View GitHub Profile
@TobiahRex
TobiahRex / dijkstra.js
Created June 9, 2018 03:43 — forked from stella-yc/dijkstra.js
Dijkstra's Algorithm in Javascript using a weighted graph
const problem = {
start: {A: 5, B: 2},
A: {C: 4, D: 2},
B: {A: 8, D: 7},
C: {D: 6, finish: 3},
D: {finish: 1},
finish: {}
};
const lowestCostNode = (costs, processed) => {