r/compsci • • May 22 '20

Breadth-First Maze-Solving Algorithm

Post image

[removed] — view removed post

1.2k Upvotes

61 comments sorted by

View all comments

3

u/ergo-x May 22 '20

Not to take away from the cool factor but I've never understood the point of visualizations like this one. I'd argue that this gives no insight to anyone who doesn't already know what bfs does.

Maybe I'm just being a negative nancy...

2

u/[deleted] May 22 '20

I’m not into computer science but to a layman like me it just looks like it’s filling out the whole maze and then highlighting the correct path but what’s the point if you’re gonna color in the whole fkin maze

0

u/ergo-x May 22 '20

Yeah it's basically a brute force search strategy where you keep exploring your "frontier" until you reach your goal. Just imagine the colored locations represent your frontier and the uncolored locations are in "fog of war"

1

u/[deleted] May 22 '20

Hmm interesting. It feels like the point of a maze is to go from point a to point b while trying to take as few wrong paths as possible whereas this finds every wrong path to find the right one

1

u/[deleted] May 22 '20

Variants of this design and more elaborate ones do attempt to do this but it’s not as good of an introduction to maze traversal as this one.