About the visualizer:
This visualizer depicts an adjacency matrix as the graph.
The path is 0 steps
This visualizer depicts an adjacency matrix as the graph.
A breadth first search traverses wide before deep, whereas a depth first search travels deep before wide.
The underlying data structure for a B.F.S. is a queue, but a D.F.S. relies on a stack.
Both traversals work on directed and undirected graph.
A B.F.S is not useful for a weighted graph instead use Dijkstra's Algorithm
Ultimately, both algorithms are suitable for exploring a graph and finding a target node.
Beige represents the open spaces
Dark Gray showcases walls
The end point is red
The start point is green
The breadth-first search is purple
The shortest path is denoted by pink
The steps are the numbers on the grid
r = number of rows
c = number of columns
Time: O(rc)
Space: O(rc)