maze-solving

How to traverse a maze programatically when you've hit a dead end.

Moving through the maze forward is pretty easy, but I can't seem to figure out how to back up through the maze to try a new route once you hit a dead end without going back too far? ...

Code Golf: Solve a Maze

Here's an interesting problem to solve in minimal amounts of code. I expect the recursive solutions will be most popular. We have a maze that's defined as a map of characters, where '=' is a wall, a space is a path, '+' is your starting point, and '#' is your ending point. An incredibly simple example is like so: ==== + = = == = # =...

How to find all available maze paths?

I am trying to write a program that is given a maze and tries to find the way out. M is the entrance, E is the exit, 1s are walls, and 0s are pathways. It is supposed to find each path and put P in the path. It is supposed to find all available paths. Right now it finds part of a path. Here is the code: public class Maze { private...

Maze recursive solving and randomly creating a maze (JAVA)

first assignment was a find the solution of a 12*12 maze. i am supposed to use a recursive method to solve them. secondly, i have to make a method to create a randomly generated maze with same dimensions. (# represents a wall, * represents a untraveled path, T represents a traveled path, X represents a path that leads to a dead end) im s...

Algorithm to get through a maze

Hello, We are currently programming a game (its a pretty unknown language: modula 2), And the problem we encountered is the following: we have a maze (not a perfect maze) in a 17 x 12 grid. The computer has to generate a way from the starting point (9, 12) to the end point (9, 1). I found some algorithms but they dont work when the rob...

Maze Navigation in Player Stage with Roomba

Here is my code: /* Scott Landau Robot Lab Assignment 1 */ // Standard Java Libs import java.io.*; // Player/Stage Libs import javaclient2.*; import javaclient2.structures.*; import javaclient2.structures.sonar.*; // Begin public class SpinningRobot { public static Position2DInterface pos = null; public static LaserIn...

Programming theory: Solve a maze

Hey, What are the possible ways to solve a maze? Ive got two ideas, but I think they are not very elegant. Base situation: We have a matrix, and the elements in this matrix are ordered in a way that it represents a maze, with one way in, and one out. My first idea was to send a robot through the maze, following one side, until it's ou...

solve a maze by using DFS, BFS, A*

I want to know the change in results when we use open maze or closed maze for the DFS, BFS, and A* search algorithms? Is there any big difference in the output like increase in number of expanded nodes, cost, etc.? ...