POV-Ray : Newsgroups : povray.binaries.images : Improving David Gemelli's Maze Solver Server Time
18 Apr 2024 22:12:01 EDT (-0400)
  Improving David Gemelli's Maze Solver (Message 1 to 4 of 4)  
From: Jörg "Yadgar" Bleimann
Subject: Improving David Gemelli's Maze Solver
Date: 4 May 2019 12:08:36
Message: <5ccdb904@news.povray.org>
Hi(gh)!

As the original recursive version of the Maze Solver frequently yielded 
"Too many nested macros" errors, I started to re-program it in an 
iterative fashion. I pretty soon discovered that I had to add a dead end 
detection and thus also to keep track of the already travelled path. I 
also found out that I had to swap x and y labyrinth coordinates...

But still a strange bug occurs: after running several times into a dead 
end (rendition of the last run attached here), the program does not 
advance beyond field <22, 1> (marked in the image with a green cross), 
although the situation is nowhere different from the short southern dead 
end encountered earlier in the path.

To give a better overview about the path taken by algorithm. I added 
#warning outputs of the current path counter value as well as of the 
current field coordinates; to avoid endless loops, I also limited the 
number of macro calls (preliminarily, after debugging, this should not 
be necessary anymore).

The main program and the maze data are also attached here.

See you in Khyberspace!

Yadgar


Post a reply to this message


Attachments:
Download 'mazenew_bug.png' (458 KB) Download 'maze.inc.txt' (3 KB) Download 'mazesolver_new.pov.txt' (6 KB)

Preview of image 'mazenew_bug.png'
mazenew_bug.png

From: Jörg "Yadgar" Bleimann
Subject: Re: Improving David Gemelli's Maze Solver
Date: 4 May 2019 12:41:04
Message: <5ccdc0a0$1@news.povray.org>
Hi(gh)!

I did not save the last changes to the Maze Solver main script... here 
it is!

See you in Khyberspace!

Yadgar


Post a reply to this message


Attachments:
Download 'mazesolver_new.pov.txt' (6 KB)

From: Bald Eagle
Subject: Re: Improving David Gemelli's Maze Solver
Date: 4 May 2019 13:15:00
Message: <web.5ccdc821c05257c64eec112d0@news.povray.org>
Maybe you should check out this and see if it provides any clues and/or
inspiration.

https://www.youtube.com/watch?v=HyK_Q5rrcr4


Post a reply to this message

From: Jörg "Yadgar" Bleimann
Subject: Re: Improving David Gemelli's Maze Solver
Date: 4 May 2019 13:29:46
Message: <5ccdcc0a$1@news.povray.org>
Hi(gh)!

On 04.05.19 19:13, Bald Eagle wrote:
> Maybe you should check out this and see if it provides any clues and/or
> inspiration.
> 
> https://www.youtube.com/watch?v=HyK_Q5rrcr4

Probably not, as it is about a maze generator rather than a maze solver 
- and when he mentioned the "recursive backtracker" within the first 20 
seconds, I stopped the video as I do not want to use recursion - because 
this was the very weakness of David Gemelli's original code!

See you in Khyberspace!

Yadgar


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.