Message Boards Message Boards

Is there a solution for these mazes?

Posted 9 years ago

Hello all, today I am writing to you because I have problems with what I am doing. After reading in the wolfram blog ideas to resolve some mazes, try to follow the commands that shares Jon McLoone for such a task but my problem arises when attempting to get the white lines to see where there are obstacles and where not. I would show you what I have done waiting for someone from the community can help me.

image = th.jpg"
simplified = Pruning[Thinning[DeleteSmallComponents[Binarize[image]]], \[Infinity]]

my problem with this maze

As you will see in the image is created by accessible locations where you could theoretically go people which does not match the original image, i would be grateful for any help. I've tried with another image that also share to do their tests.

Here is the link of where I am basing to see if the mazes that have shared any solution or do not have any. Wolfram Blog maze solving

Thanks in advance.

Attachments:
POSTED BY: Luis Ledesma
6 Replies
Posted 9 years ago

Many thanks for your comment as successful Bruce, but the problem i am facing is with the command MorphologicalGrap, documentation is an example that I wanted to repeat with another image and i'm having a result that is not convincing and the worst thing is that I cannot find the cause of this error, i hope that you or someone else in the community can help me, here is what I am doing. Greetings and thank you in advance.

image problem

Attachments:
POSTED BY: Luis Ledesma
Posted 9 years ago

Thank you for devoting your time to help me solve my problem, I did the steps that I mentioned but the problem is that the maze that I am working on has the same input and output are no different as the example of the documentation of the MorphologicalGraph fuction, you know if there is any way to be able to tell mathematica input and output are the same? because by not indicating you that would not give any solution. Greetings and thanks again.

Ps. ..I am trying to find a solution to the labe01.gif file

POSTED BY: Luis Ledesma

MorphologicalGraph is a useful function. An example with a maze in the documentation, then all you need is to identify the start and end points and FindShortestPath will give a solution. I am not an expert but I believe that the edge weights are taken into account.

POSTED BY: Todd Rowland

If you convert your mazes to a grid, you can use the code from the documentation to FindShortestPath.

You can check if there is a solution by using MorphologicalComponents e.g.

Colorize[MorphologicalComponents[Binarize[th]]]

It looks like the whole thing is connected, so not sure why there isn't a solution, though also not sure where the start and end are either.

POSTED BY: Todd Rowland
Posted 9 years ago

Hello again, trying to manually check if the mazes that i shared solution i had a surprise of the day to verify that the maze that is in the th.jpg file does not have any possible solution, on the other hand the maze of the labe01.gif file actually has some solutions, I'll show you the solutions that I've found but i still do not move forward in my code for that Mathematica i of any solution, any help is welcome.

bluemaze

yellowmaze

pinkmaze

I will continue to work on this in order to be able to show them more code to finish this crazy idea.

POSTED BY: Luis Ledesma
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract