BFS Visualizer — Interactive Breadth-First Search
Interactive breadth-first search on a grid — draw walls, move start/goal, generate mazes, step through the level-by-level expansion. Runs in your browser.
Click & drag on the grid to draw walls · drag the green and red squares to move start / goal · then press Play.
Pseudocode
Time · Space
How to use
- 1 Draw walls by clicking and dragging; drag the green start or red goal to move them.
- 2 Press Play to watch BFS expand level by level from the start.
- 3 Use Maze for instant obstacles, or Step one node at a time.
- 4 On an unweighted grid the path BFS finds is guaranteed shortest (fewest cells).
Why use this tool
- See the frontier grow outward in expanding rings — the signature of BFS.
- Understand why BFS finds the shortest path on unweighted graphs.
- Compare its even expansion with DFS (which dives deep) and A* (which aims at the goal).
- Runs entirely in your browser. No signup, no uploads.
Frequently asked questions
What is breadth-first search?
BFS explores a graph level by level using a queue: it visits all neighbors of a node before moving on to their neighbors. On an unweighted graph it finds the shortest path.
What is the time complexity of BFS?
O(V + E) — every vertex and edge is examined once, where V is vertices and E is edges.
Does BFS always find the shortest path?
On unweighted graphs, yes. For weighted graphs use Dijkstra or A*, which account for edge costs.
How is BFS different from DFS?
BFS uses a queue and expands outward in rings (shortest path on unweighted graphs); DFS uses a stack and dives as deep as possible before backtracking (no shortest-path guarantee).
What is Breadth-First Search (BFS) Visualizer?
A Breadth-First Search (BFS) Visualizer animates how BFS explores a grid level by level using a queue, expanding outward in rings from the start. On an unweighted grid it finds the shortest path, which is highlighted when the goal is reached.
Breadth-First Search (BFS) Visualizer is a free algorithm utility by Zerethon Tools. Interactive breadth-first search on a grid — draw walls, move start/goal, generate mazes, step through the level-by-level expansion. Runs in your browser. Runs entirely in the browser — no signup, no upload.
- Category
- Algorithm
- Pricing
- Free
- Privacy
- Browser-based
- Signup
- Not required
Privacy
Your data never leaves your browser unless explicitly stated. Breadth-First Search (BFS) Visualizer runs entirely client-side — no server upload, no logging, no tracking of your input.
Related tools
Dijkstra's Algorithm Visualizer
Interactive Dijkstra pathfinding on a grid — draw walls, move start/goal, generate mazes, step through the search. Runs in your browser.
Open toolA* Pathfinding Visualizer
Interactive A* pathfinding on a grid with a Manhattan heuristic — draw walls, move start/goal, generate mazes, step through the search. Runs in your browser.
Open toolDepth-First Search (DFS) Visualizer
Interactive depth-first search on a grid — draw walls, move start/goal, generate mazes, step through the deep-dive exploration. Runs in your browser.
Open toolBubble Sort Visualizer
Animated bubble sort with step controls, speed, custom input, live comparison/swap counters and pseudocode. Runs entirely in your browser.
Open toolBuild, share, and grow on Zerethon Social
Free signup. Earn points, collect achievements, and connect with creators worldwide.