Track exactly how much you turn left and right.
#Any maze how to full
You walk the full path between the loops once when you follow the first wall (start to 1, then 2 to start), and once again when following the second loop. You'd think that, since you only follow a wall once and each path has two walls, you'd never walk the same path more than twice, but consider the case that Trennin pointed out of starting between two loops:. The strategy of following a wall guarantees this most of the time.
The strategy I gave does this by marking off any path that you've backtracked on.
So the most import part of any strategy is to guarantee that you will never go down the same path more than twice. If the two paths were the same length, then you'd end up covering the entire area of the maze far more than just twice. This could beat the one long + one short maze faster, but you might end up walking up and down each path multiple times. Consider a breadth-first search (go down each path a little ways, check the other paths that far, then check down the first path a little bit farther, etc). Thus, my strategy has the optimal worst-case scenario, but I think that attempting to get as far from the middle (your starting place) as possible to begin with should make it more likely that you'll escape the maze quicker in the average case.Īs I said, there is no optimal strategy, but there are definitely strategies that will be worse on average. Since you will never backtrack over the same path twice, you will at worst cover the area of the maze twice other than the path that leads out. You can mark off all paths you backtrack over in some way that will indicate to you that the path will not help you find the way out. If you run into an intersection that you've already been in and you've already taken or come from all of the paths, then backtrack until you find a path that you haven't gone down already. You should also make a mark indication what direction is your North at each intersection and at each turn. At each intersection, make a mark connecting where you entered with where you exit. You're likely to get out of the maze faster if you're going around near the edge of the maze than if you're walking around in circles near the middle of the maze)Īs with Denis' strategy, you should make marks to keep track of where you've been. (Note - the priorities are mainly to try to get you to the edge of the maze as fast as possible. Then whenever you are at an intersection, your priorities should be North first, then East, then West, and last South.
So first, pick a direction to call North - if you can see the sun and know whether it is morning or evening, then you can use actual North.
That being said, there are a couple things we do know - we are in the middle of the maze, and the exit is on the outside. Thus, the strategy of always trying the left (or right) path first could ending causing you to walk almost the entire area of the maze twice before going on the short path. The exit could be placed at the end of either path, and a mirror image of the maze could be used to switch whether the long path is to the left or to the right. For example, it would be easy to design a maze that quickly splits off into two paths - one that ends almost immediately, and one that winds around to use up all of the remaining area of the maze. Unfortunately, if you know nothing about the design of the maze, then there is no optimal strategy. How can you assure you get in the shortest amount of time?