Skip to main content
Z

Dijkstra's Algorithm Visualizer — Interactive Pathfinding

Interactive Dijkstra pathfinding on a grid — draw walls, move start/goal, generate mazes, step through the search. Runs in your browser.

Free No signup Client-side Privacy friendly Updated

Move the indigo token with / WASD (or tap an adjacent cell) from the green start to the red goal. Walls block you.

Moves: Time: 🎉 Reached the goal!
/

Pseudocode

How to use

  1. 1 Draw walls by clicking and dragging on the grid; drag the green start or red goal to move them.
  2. 2 Press Play to watch Dijkstra expand outward from the start in order of distance.
  3. 3 Use Maze for instant obstacles, or Step through one node at a time.
  4. 4 When the goal is reached, the shortest path is highlighted in gold.

Why use this tool

  • See Dijkstra explore cells in increasing distance order — the classic uniform-cost search.
  • On an unweighted grid every edge costs 1, so Dijkstra finds the shortest path.
  • Compare its broad exploration with A*, which uses a heuristic to head toward the goal.
  • Runs entirely in your browser. No signup, no uploads.

Frequently asked questions

What is Dijkstra's algorithm?

Dijkstra's algorithm finds the shortest path from a start node to all other nodes in a weighted graph with non-negative edge weights, always expanding the closest unvisited node first.

What is the time complexity of Dijkstra's algorithm?

With a binary-heap priority queue it is O(E log V), where V is the number of vertices and E the number of edges.

How is Dijkstra different from BFS?

On an unweighted graph they explore the same way and both find shortest paths. Dijkstra generalizes BFS to weighted graphs by ordering the frontier by total distance instead of by hop count.

How is Dijkstra different from A*?

A* adds a heuristic estimate of the remaining distance to the priority, so it explores toward the goal and usually visits far fewer nodes while still finding the shortest path.

What is Dijkstra's Algorithm Visualizer?

A Dijkstra's Algorithm Visualizer animates shortest-path search on a grid: the algorithm repeatedly expands the closest unvisited cell, exploring outward by distance until it reaches the goal, then highlights the shortest path. You can draw walls and move the start and goal.

Features

Step-by-step animation

Watch tentative distances relax and nodes get settled by shortest distance.

Complexity

Time: O((V + E) log V) with a binary heap. Space: O(V). Non-negative weights only.

100% private

Runs entirely in your browser — nothing is uploaded.

Example

Input

weighted graph, source A

Output

settle nearest unvisited node, relax its edges → final shortest distances from A

Common use cases

  1. 1

    Weighted shortest path

    Find the least-cost route in a weighted graph (maps, networks).

  2. 2

    Why non-negative weights

    See why negative edges break the greedy invariant (use Bellman-Ford instead).

  3. 3

    Priority-queue relaxation

    Understand how a min-heap drives edge relaxation.

Summary

Zerethon's Dijkstra visualizer animates single-source shortest paths on a weighted graph in your browser, greedily settling the nearest unvisited node and relaxing its edges. With a binary-heap priority queue it runs in O((V + E) log V) time and O(V) space. It requires non-negative edge weights.

Category
Algorithm
Pricing
Free
Privacy
Browser-based
Signup
Not required

References

Privacy

Your data never leaves your browser unless explicitly stated. Dijkstra's Algorithm Visualizer runs entirely client-side — no server upload, no logging, no tracking of your input.

New to this? Read the step-by-step explanation with Big-O analysis: Learn Graph Algorithms →

Compare

Related tools

Build, share, and grow on Zerethon Social

Free signup. Earn points, collect achievements, and connect with creators worldwide.

Try Zerethon free