Published
Edited
Sep 24, 2019
1 star
Insert cell
Insert cell
graph = ({
a: { b: 10, d: 1 },
b: { a: 1, c: 1, e: 1 },
c: { b: 1, f: 1 },
d: { a: 1, e: 1, g: 1 },
e: { b: 1, d: 1, f: 1, h: 1 },
f: { c: 1, e: 1, i: 1 },
g: { d: 1, h: 1 },
h: { e: 1, g: 1, i: 1 },
i: { f: 1, h: 1 }
})
Insert cell
tree = dijkstra.single_source_shortest_paths(graph, 'a')
Insert cell
path = dijkstra.find_path(graph, 'a', 'i')
Insert cell
dijkstra = require("dijkstrajs").catch(e => window.dijkstra)
Insert cell
require("dijkstra")
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more