I have a physical maze grid image that I have converted into a normalized binary matrix, as shown in the image below. I have color data trained for the red, blue, and green blocks.
Given a starting and ending block (i.e., start at red and go to blue), I want to calculate the shortest path between the two. As you can see, the maze is not "perfect", and contains random obstacles and open paths. This has made it difficult to adapt standard algorithms.
I have looked into the following algorithms:
- A*: I was unable to adapt the given example program to my scenario, as it allows for diagonal movement
- Recursively: A recursive algorithm in Java seemed to be a reasonable fit to the problem, but I was unable to get it working properly in Matlab due to functions needing their own file
- Right-hand solving: I want to avoid this option, as the maze is more difficult to traverse than a "perfect" maze. This method also isn't efficient
Any general advice or direction would be much appreciated. The code to get the normalized binary matrix is across multiple files, so I am hesitant to post it all here until necessary.