What is a Dijkstra Algorithm Visualizer?
A Dijkstra algorithm visualizer shows how shortest-path distances are updated in a weighted graph. It is useful for learning graph algorithms, route planning, priority queues, and coding interview shortest-path problems.
This tool lets you paste weighted edges, choose a start node and target node, then step through the distance table and shortest path.
For the full graph and data structure set, browse the Data Structure Visualizers hub.
How to use this Dijkstra visualizer
- Paste one weighted edge per line, such as
A B 4. - Choose whether edges are undirected or directed.
- Enter a start node and optional target node.
- Click Run Dijkstra.
- Step through each visit and relaxation update.
Dijkstra works on graphs with non-negative edge weights. This tool ignores negative weights so the visualization stays faithful to the algorithm.
Dijkstra vs BFS
Breadth-first search finds shortest paths in an unweighted graph. Dijkstra extends the idea to weighted graphs by always expanding the unvisited node with the smallest known distance.
If you want to compare weighted and unweighted traversal, try the Graph BFS DFS Visualizer alongside this shortest-path tool. To compare Dijkstra-style search with a target heuristic on a grid, use the A Star Pathfinding Visualizer. For negative edges and negative cycle checks, use the Bellman Ford Visualizer. For component connectivity instead of shortest paths, use the Union Find Visualizer.