I have an assignment for a paper and in no means am I asking for any code help, only help to understand how to approach this problem.
We where given minimal material to work from and the professor only skimmed over the content of Breadth first search.
We need to find our way through a maze, the maze is is created and your person lands on a random space every time.
When the key is pressed the current position is sent to the function and from there we have to use breadth first search to find the shortest path.
Now what I understand from this search algorithm is the following:
- Tree or graph must be searched in levels
- We need to store the paths in a queue (FIFO)
- Then find the shortest path out of all paths to the end item
How exactly do I approach this type of problem?
We know the start and end, plus we can get all the neighbour blocks of the current block easily.
Much appreciated.