Skip to content

Latest commit

 

History

History
52 lines (37 loc) · 1.67 KB

README.md

File metadata and controls

52 lines (37 loc) · 1.67 KB

TypeScript Dijkstra's algorithm

TypeScript implementation of Dijkstra's algorithm.

Dijkstra's algorithm (or Dijkstra's Shortest Path First algorithm, SPF algorithm) is an algorithm for finding the shortest paths between nodes in a graph. It was conceived by computer scientist Edsger W. Dijkstra in 1956 and published three years later.

Dijkstra's algorithm gif

How it works

Create nodes by setting a value, a size and a color. Then, link them by clicking on the link button and setting a distance between them.

Finally, you can get the shortest path between two nodes by setting an origin and destiny node in the "Calculate shortest path" section.

Demo

You can find a demo of the project here: TypeScript Dijkstra's algorithm demo

Installing

Firstly, install TypeScript (via npm):

npm install -g typescript

Then, clone a copy of the repository:

git clone https://github.com/lluiscamino/ts-dijkstra-algorithm.git

Change to the ts-dijkstra-algorithm folder:

cd ts-dijkstra-algorithm

Install dependencies:

npm install

And finally, compile the code:

tsc -w

Built with

License

This project is licensed under the MIT License - see the LICENSE file for details.