You are here:

C++/maze algorithm

Advertisement


Question
Hi,
I was taken an experiment that is the solution of maze problem, but I cannot solve it.I can find only one solution in the maze with my algorithm, but I must find all possible paths in maze.Also, your sites' Java part provides a solution for maze but only one path.
Please help me.Can you give me an algorithm for it or source code?Thank you very much.

Answer
Hello John. I'm happy to help but I cannot say why you are finding only one solution without seeing your code. I can guess that it would be pretty easy to change your code to find all solutions. I suspect that you are using some kind of recursive search algorithm with backtracking. The trick would be to not stop the recursion after the first solution.

Please post your code. If the maze data is in some kind of file, post that too. If you are worried about others seeing your code, make a new private question or send it to zlatko.c.help at gmail.com

Best regards
Zlatko

C++

All Answers


Answers by Expert:


Ask Experts

Volunteer


Zlatko

Expertise

No longer taking questions.

Experience

No longer taking questions.

Education/Credentials
No longer taking questions.

©2016 About.com. All rights reserved.