Skip to content
Javascript implementation of Dijkstra's algorithm.
JavaScript HTML
Branch: master
Clone or download

Latest commit

James Jackson
Latest commit a477c71 Feb 24, 2015

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
benchmark
Dijkstras.js
README.md

README.md

dijkstras-js

Javascript implementation of Dijkstra's algorithm

Sample Usage

var d = new Dijkstras();
d.setGraph(
	[
		['A', [['B', 20], ['C', 20]] ], 
		['B', [['A', 30], ['C', 100]] ], 
		['C', [['D', 10], ['A', 20]] ], 
		['D', [['C', 10], ['B', 20]] ]
	]
);
var path = d.getPath('A', 'D');

Resources

http://en.wikipedia.org/wiki/Dijkstra's_algorithm

Fork!

Please fork and improve!

You can’t perform that action at this time.