0

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.

enter image description here

10
  • try bfs, dfs or dijkstra Commented Apr 25, 2017 at 20:36
  • My recursive attempt was bfs. Commented Apr 25, 2017 at 20:38
  • what is the problem than Commented Apr 25, 2017 at 20:38
  • MATLAB functions made it difficult to execute it recursively, especially pertaining to returning binary values when certain conditions were met Commented Apr 25, 2017 at 20:39
  • What was the difficulty? Recursion is used in Matlab all the time, and it does not seem to be any more difficult than in e.g. Java. Commented Apr 25, 2017 at 20:40

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.