SkillAgentSearch skills...

Shortestpath

An interactive HTML5 canvas graph that shows the shortest path between any two nodes.

Install / Use

/learn @lettier/Shortestpath

README

Alt text

Shortest Path

An interactive HTML5 canvas graph where the edge weights are the euclidean pixel distance between any one edge's incident nodes. Upon selecting a source node and a terminal node, you can see the shortest path (if a path does exist) between them by pressing Begin. Dijkstra's algorithm is used to compute the shortest path. To see the shortest path between any other two nodes, press Reset. For a whole new graph, press New Graph.

./source/canvas_version contains the latest version utilizing only the HTML5 canvas object and no other third-party libraries.

./source/fabric_js_version contains the original version that uses the Fabric.js canvas library. Note that Fabric.js 1.4.0 is needed.

Playable at http://www.lettier.com/shortest_path/.

(C) 2014 David Lettier.
http://www.lettier.com/

Related Skills

View on GitHub
GitHub Stars14
CategoryDevelopment
Updated1mo ago
Forks3

Languages

JavaScript

Security Score

80/100

Audited on Feb 23, 2026

No findings