https://github.com/thinkphp/dijkstra
Dijkstra's Algorithm for finding the shortest paths between nodes in a weighted graph.
https://github.com/thinkphp/dijkstra
Last synced: 3 months ago
JSON representation
Dijkstra's Algorithm for finding the shortest paths between nodes in a weighted graph.
- Host: GitHub
- URL: https://github.com/thinkphp/dijkstra
- Owner: thinkphp
- Created: 2014-09-04T21:15:42.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2024-06-04T16:24:21.000Z (over 1 year ago)
- Last Synced: 2024-06-04T18:23:53.942Z (over 1 year ago)
- Language: C++
- Homepage:
- Size: 35.2 KB
- Stars: 35
- Watchers: 8
- Forks: 13
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Dijkstra
========
Dijkstra's algorithm, conceived by computer scientist Edsger Dijkstra, is a graph search algorithm that solves in single-source
shortest path problem for a graph with non-negative edge path costs, producing a shortest path tree.

How to use
----------
Include the latest version MooTools Framework, then dijkstra.js into the page:
Sample
-------
#JS
var road = [[1, 2, 1],
[1, 3, 9],
[1, 5, 3],
[2, 4, 3],
[2, 3, 7],
[4, 3, 2],
[4, 1, 1],
[5, 2, 4],
[5, 4, 2]]
var start = 1,
end = 3;
var dij = new Dijkstra(start, end, road );
console.log("Cost = " + dij.getCost() )
console.log("Shortest path from the node "+ start + " to "+ end + " -> "+ dij.getShortestPath() )
#### Problem Set
https://infoarena.ro/problema/dijkstra
## References
http://en.wikipedia.org/wiki/Dijkstra%27s_algorithm