Loading...
Loading...
Loading Curriculum...
Loading Subject...
Loading Topic...
Loading Lesson...
Loading Lab...
Discover the most efficient route through a binary maze. By treating each empty cell as a node and adjacent cells as edges of weight 1, BFS identifies the absolute shortest distance in O(V+E) time.
0 represents an open path, while 1 represents an impassable wall. We only explore cells that are within boundaries and not blocked.
BFS acts like a wave spreading outward from the start. The first time the "wave" hits a cell, we've found its shortest distance.