I'm trying on implementing an breadth first algorithm, that solves a labyrinth. As an input I have a n*m binary matrix, where '1' stands for obstacle/wall and '0' for path/ free cell.
I do get how the algorithm generally works, but I'm struggling with how to store and proceed the information in matlab. So basically I start with my start cell, and check all it's direct neighbours for obstacles. If they are free, I mark them as a potential path, and then I do the same recursively for all those cells again.
But i just can't figure out how to store the information, so that in the end i will only have one path. any ideas?