Questions tagged [maze]

9 questions
2
votes
1 answer

"Visited" vs "Seen" Positions in Breadth-First Search

I'm struggling to understand why there is such a radical difference in the execution time and number of steps required by two seemingly similar algorithms for Breadth-First Search in a 2d grid. In the Python program below, uncommenting the indicated…
Robin Andrews
  • 265
  • 4
  • 15
2
votes
0 answers

How to find a path in maze with navigator physical size constraints?

Assuming a 2D maze, how would one go about solving it for rigid 2D object moving through it? Additional specification: The object shape - it is a single entity, not a swarm/fleet. A shape of something one could cut out of cardboard, no infinite…
jva
  • 121
  • 3
2
votes
1 answer

Solve Maze Without Feedback

Suppose that we have the following maze (_ = open, + = blocked), and we can move left,right,up,down: + + + + + + + + + + + + + + + + + + + + + + + + + + _ _ _ _ _ _ _ + _ _ _ _ _ _ _ + _ _ _ _ _ _ _ + + _ + + _ + + _ + _ + + _ + + _ + _ + + _ + + _…
1
vote
0 answers

Finding a way out of the labyrinth

Task: You need to get out of the labyrinth. You don't know how many rooms it has or what its map is. You can move freely in both directions along all corridors, all rooms and corridors look the same (rooms may differ only in the number of…
Disciple
  • 111
  • 4
1
vote
1 answer

Implementation check for Kruskal's algorithm used for maze generation

I have a pathfinding project and I want to use Kruskal's algorithm as a maze generator. I am using a rank-based disjoint set data structure to detect cycles, which seems to be the standard way. However, the mazes that I generate cannot be solved.…
1
vote
1 answer

Exit quickly from a maze with a local view of the maze

How to efficiently exit from a maze where you know the initial position of the player (1,1), the exit (49,49)? You don't know the maze configuration but you know where your player is, and which direction are opened from his position. Another point,…
KKc
  • 111
  • 1
1
vote
1 answer

Why is backtracking a necessary step in the Maze problem?

The problem I am working on is specifically this: A Maze is given as N*N binary matrix of blocks where source block is the upper left most block i.e., maze[0][0] and destination block is lower rightmost block i.e., maze[N-1][N-1]. A rat starts from…
a_sid
  • 113
  • 6
0
votes
1 answer

Pathfinding in a known maze with step limitations, points of interest and more

I hope this is the correct subpage of SE, if not please direct me to the more appropriate place. Imagine the following scenario: You are put into a random but known position inside a given maze. The maze contains, in addition to walls (█) and…
Plagiatus
  • 101
  • 3
0
votes
1 answer

Solving a maze with DFS vs "wall following"

Consider a problem where a "robot cleaner" is placed on a room modeled as a grid. Each cell in the grid can be empty or blocked and all accessible cells are connected, meaning, all empty cells will be accessible by the robot regardless of its…
Josh
  • 316
  • 1
  • 11