An interactive web-based tool to learn and visualize Dijkstra’s shortest path algorithm.
This project lets you build custom graphs, step through the algorithm execution, and understand how shortest paths are calculated.
🎥 (Add a screenshot or GIF of your app running here if possible)
- âž• Add nodes and edges with weights
- 🎯 Select a start node
- ▶ Run Dijkstra’s Algorithm step-by-step
- 📊 Live updates of:
- Current step description
- Priority queue
- Shortest distances
- đź–Ľ Graph visualization with nodes, edges & weights
- 🔄 Reset or clear the graph anytime
-
Add Nodes
- Type a node name (e.g.,
A,B,C) and click+.
- Type a node name (e.g.,
-
Add Edges
- Select two nodes (
FromandTo). - Enter a weight (positive number).
- Click
Add Edge.
- Select two nodes (
-
Choose Start Node
- Select which node to start the algorithm from.
-
Run Algorithm
- Click
â–¶ Start Algorithm. - Click
Next Stepto go through the algorithm execution.
- Click
-
Reset or Clear
⟳ Reset→ Restart the algorithm with the same graph.🗑 Clear All→ Remove all nodes & edges.
-
Initialization
- Set all node distances =
Infinity. - Distance of start node =
0. - Add start node to priority queue.
- Set all node distances =
-
Visit Nodes
- Pick the node with the smallest distance from the queue.
- Mark it as visited.
-
Relax Edges
- For each neighbor, check if going through the current node gives a shorter path.
- If yes → update distance and push neighbor into queue.
-
Repeat until all nodes are visited or queue is empty.
-
Result → Shortest path cost from the start node to every other node.
Graph: