Coding Dijkstra's shortest path algorithm in React.
You can learn the Dijkstra's algorithm from https://www.youtube.com/watch?v=pVfj6mxhdMw.
Browse https://repl.it/@BalajiMKala/dijkstraReact and click Run button.
Clone or download the code from this repository. Open the folder in Visual Studio code or your preferred text editor. Install packages by running the command in the prompt / terminal"
npm install
and start the development serverwith
npm start
The actual logic is coded in python at https://github.com/balajimk/dijkstraPython
- Double click on the page to add new vertex.
- Click on any vertex to select / deselect the vertex.
- When one vertex is selected, click on another vertex to connect with a edge. This will have a defauly weight/distance of 1.
- Click any edge to select and the change the value by changing the text in the box on top.
- Click any vertex and click on Select Start or Select Target to select the From and To vertices for calculating shortest path.
- Click Calulate to find the shortest path.
- Click Reset path button to re-calculate new values.