Simple and Fast Maze Solving Algorithm on Python

  Рет қаралды 1,833

Rockets and Robotics

Rockets and Robotics

Күн бұрын

Пікірлер: 2
@danp6101
@danp6101 Жыл бұрын
Contrary to what you may think Water won't fill up an entire maze if we assume the maze is water tight and there is only 2 openings the Start and End openings. The reason why water won't fill up and entire maze is because of the air pressure that is trapped inside the maze it will force the water back to go another way that has less air pressure. Example 1 Lets say the Start opening is at the top left hand corner and the end opening is at the bottom right hand corner. water always wants to seek the lowest point and get there by the least resistance. water doesn't know which way to go so it will follow the path you give it so if it comes to junction it will go that way but the force of the water will be less until one or more of the junctions get filled up with water. Now as the water is filling up the junctions in the maze it pushing the air through the other junctions in the maze some air will escape through the end opening the rest will stay in the maze. So the air pressure that is trapped inside will push against the water pressure and force it to go back the other direction where the pressure is less until it finds the end opening at the bottom of the maze. Now that the water has found the least resistance way to travel through the maze. That's way it will go without filling up the rest of the maze. Even if you blocked the end opening it won't fill the entire maze because of the trapped air that is inside. Example 2 Lets say you filled it from the bottom It will start filling up the maze until it reaches a junction and spill over and start filling that up as the maze is filling up with water the air is being pushed into the rest of the maze some sir may escape. The water will continue to fill the maze until it finds the opening but it won't fill the entire maze because of the trapped air inside. My maze solving solutions works almost the way water fills up in a water tight maze. The way my solution works is. First it checks to see what direction it can go if there are more the one way it go down if it can't it will go to right if that is false it will try to go up and last it try to go left. it will do that until it reaches a junction or a dead end then it will start to backtrack to a junction and go that way until it finds either the end of the maze or dead ends. It will continue to do this until it finds the end of the maze. As the solution is finding the path which way to go it updates the Starting position to the next maze position as the starting position it will do that even when it backtracks. Then when the Starting position equals the Endings Positions it knows that the maze is solved. My Solution doesn't check for the quickest route but it also doesn't fill entire maze to find the end of the maze like water filling a maze.
@maessu9233
@maessu9233 2 жыл бұрын
This really helped me out. Thank you!
I Solved The World's Hardest Maze (with Code)
9:54
Green Code
Рет қаралды 227 М.
7 Outside The Box Puzzles
12:16
MindYourDecisions
Рет қаралды 384 М.
黑天使只对C罗有感觉#short #angel #clown
00:39
Super Beauty team
Рет қаралды 36 МЛН
I Made a Tool to Debloat Windows in 2 Clicks
15:01
TotallyNotK0
Рет қаралды 276 М.
Real-Time Fluid Dynamics Made Simple with Python
14:40
Beniam Kumela
Рет қаралды 3 М.
Maze Solving - Computerphile
17:15
Computerphile
Рет қаралды 1,1 МЛН
Fast Inverse Square Root - A Quake III Algorithm
20:08
Nemean
Рет қаралды 5 МЛН
I Scraped the Entire Steam Catalog, Here’s the Data
11:29
Newbie Indie Game Dev
Рет қаралды 856 М.
Why Does Diffusion Work Better than Auto-Regression?
20:18
Algorithmic Simplicity
Рет қаралды 426 М.
Dear Game Developers, Stop Messing This Up!
22:19
Jonas Tyroller
Рет қаралды 789 М.
黑天使只对C罗有感觉#short #angel #clown
00:39
Super Beauty team
Рет қаралды 36 МЛН