Log In  

Maze solving algorithms

Random

Cart #randmaze-0 | 2023-02-05 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
1

Note:

Takes ages, so I made it faster

Rating:2/10

Breadth-First Search

Cart #bfsmaze-1 | 2023-02-04 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
1

Note:

Actually not bad, although will search a lot

Rating:4/10

Depth-First Search

Cart #dfsmaze-1 | 2023-02-04 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
1

Note:

Worse than BFS, because it misses nearby targets

Rating:3/10

Wall-Follower

Cart #wall_follower-0 | 2023-02-04 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
1

Note:

Might fail with loops

Rating:4/10

Dead-End Filling Algorithm

Cart #dead_end_filling-0 | 2023-02-04 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
1

Note:

Will fail with loops

Produces a path

Rating:5/10

A*

Too lazy to code my own.
Instead, check this one made by @dw817:

https://www.lexaloffle.com/bbs/?pid=115379#p

P#125359 2023-02-05 11:57 ( Edited 2023-02-27 21:36)

Hi @Guest122:

I was reading above - you having difficulties in solving a maze, and the very cart of mine you mentioned below was the very one I was going to mention.

Small world. :)

At some point I need to sit down and recode it so it's a proper function that can work with any size maze or obstacles.

I was also looking at the methods you used here. Quite interesting to watch, really. Gold star for your persistence into the matter.

P#125363 2023-02-05 13:59 ( Edited 2023-02-05 14:26)

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-03-28 15:35:47 | 0.034s | Q:28