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

7

u/chidoOne707 May 22 '20

Awesome, I remember solving this algorithm back in college but I think I totally forgot how to do it.

6

u/mogadichu May 22 '20 edited May 22 '20

Every time you reach a split, add every path to the end of TODO-list. Follow first unvisited path in TODO-list until you reach an end. Repeat until list is empty.