Jump to content

Maze

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Nidara (talk | contribs) at 19:38, 27 December 2005 (Further reading). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

For the R&B/soul music band, see Maze (band).
Public hedge maze in the "English Garden" at Schönbusch Park, Aschaffenburg, Germany
A small maze.

A maze is a tour puzzle in the form of a complex branching passage through which the solver must find a route. This is different from a labyrinth, which has an unambiguous through-route and is not designed to be difficult to navigate.

The pathways and walls in a maze or labyrinth are fixed. Maze-type puzzles where the given walls and paths may change during the game are covered under the main puzzle category of tour puzzles.

One type of maze consists of a set of rooms linked by doors (so a passageway is just another room in this definition). You enter at one spot, and exit at another, or the idea may be to reach a certain spot in the maze.


Mazes have been built with walls and rooms, with hedges, turf, or crops such as corn or, indeed, maize, or with paving stones of contrasting colors or designs.

Mazes can also be drawn on paper to be followed by a pencil.

One of the short stories of Jorge Luis Borges featured a book that was a literary maze.

Various maze generation algorithms exist for building mazes, either by hand or by computer.

Solving mazes

The mathematician Leonhard Euler was one of the first to analyse plane mazes mathematically, and in doing so founded the science of topology.

The following algorithms are designed to be used inside the maze by a traveler with no prior knowledge of the maze's layout. There are other algorithms that can be used for solving paper mazes, where the solver has an overview of the maze.

Wall follower

Traversal using the right-hand rule
Traversal using the right-hand rule

The wall follower, the best-known rule for traversing mazes, is also known as either the left-hand rule or the right-hand rule. If the maze is simply connected, that is, all its walls are connected together or to the maze's outer boundary, by keeping one hand in contact with one wall of the maze you are guaranteed not to get lost and will reach a different exit if there is one; otherwise, you will return to your entrance. If the maze is not simply connected, this method will not help you to find the disjoint parts of the maze.

Wall following can be done in 3D or higher dimensional mazes if you project its higher dimensional passages onto the 2D plane in a deterministic manner. For example, in a 3D maze pretend up passages actually lead northwest, and down passages actually lead southeast, and then apply the standard wall following rules.

Pledge algorithm

Disjoint mazes can still be solved with the wall follower method, if the entrance and exit to the maze are on the outer walls of the maze. If however, the solver starts inside the maze, it might be on a section disjoint from the exit, and wall followers will continually go around their ring. The Pledge algorithm (named after Jon Pledge of Exeter) can solve this problem.

The Pledge algorithm, designed to circumvent obstacles, requires an arbitrarily chosen direction to go towards. When an obstacle is met, one hand (say the right hand) is kept along the obstacle while the angles turned are counted. When the solver is facing the original direction again, and the angular sum of the turns made is 0, the solver leaves the obstacle and continues moving in its original direction.

This algorithm allows a person with a compass to find their way from any point inside to an outer exit of any finite and fair 2 dimensional maze, regardless of the initial position of the solver. However, this algorithm will not work in doing the reverse, namely finding your way from an entrance on the outside of a maze to some end goal within it.

Random mouse

This is a trivial method that can be implemented by a very unintelligent robot or perhaps a mouse, but which is not guaranteed to work. It is simply to proceed in a straight line until an obstruction is reached, and then to make a random decision about the next direction to follow. This will of course fail if the exit is, or is only reachable by, an opening in the middle of a wall.

Tremaux's algorithm

Tremaux's algorithm is an efficient method that requires drawing a line on the floor to mark your path, and is guaranteed to work for all mazes that have well-defined passages. On arriving at an unmarked junction, pick any direction. If you have visited the junction before, return the way you came. If revisiting a passage that is already marked, draw a second line, and at the next junction, take any unmarked passage if possible, otherwise take a marked one. You will never need to take any passage more than twice. If there is no exit, this method will take you back to the start.

See also [1]

Generating Mazes

There are many different approaches to automate the generation of mazes.

Stack based approach

This is also the most simple way to generate a maze using a computer. Consider the space for a maze being a large grid of cells (like a large chess board), and each cell starts with 4 walls. Pick a random start cell and then select a random neighbouring cell that has not yet been visited. Remove the 'wall' between the two cells and add the new cell to a stack (this is analogous to drawing the line on the floor). Continue this process, if you ever get to a cell that has no unvisited neighbours then you have come to a dead-end. When at a dead-end backtrack through your path (pop from the stack) until you get to a cell with an unvisited neighbour, continue your path generation by visiting this new, unvisited cell (creating a new junction). This process continues until you have visited every cell, causing you to backtrack all the way back to the begining cell. This approach gaurantees that the maze space is completely visited. As stated, the algorithm is very simple and does not produce overly complex mazes. More specific refinements to the algorithm can help to generate harder to solve mazes.

Mazes open to the public

  • Hoo Hill Maze, Shefford, Bedfordshire, UK.
  • Hampton Court Palace, England (hedge maze)
  • Chatsworth, England (hedge maze)
  • Samsø, Denmark (the biggest maze in the world) - http://www.samsolabyrinten.com/
  • Schönbrunn Palace, Austria (small entrance fee, tower at the center to overlook the hedge maze)
  • Longleat, England (hedge maze)
  • The Crystal Palace, England. A tiny maze in the park.
  • Hedge maze at Leeds Castle, Maidstone, Kent, England. This is one of over 500 mazes worldwide which have been designed by Adrian Fisher. His company sells the full concept including detailed plans and bridges. Some of his most famous examples are very large maize mazes. Maize mazes are usually only kept for one growing season, so they can be different every year.
  • Beauty Hill Farm, Chichester, USA (field maze). A maze mowed in a hay field where people search out colored flags for clues. Designed by http://www.CrazyMaze.biz/
  • The Maze on Centre Island was a Centennial gift to the city by Toronto's Dutch-Canadian community in 1967. This topiary maze is open to public for free year-round.
  • Davis' Mega Maze, Sterling Mass USA (hedge maze). Part of the farm (also owned by Davis), it draws quite a crowd from the surrounding area. Adrian Fisher, a world record setting maze creator draws up the plans in England. The maze is known by many kids as the the "candy maze", because the bridges in the maze give out candy.

Maze by Christopher Manson

Maze (Henry Holt & Company, Inc.; (February 1989), ISBN 0805010882), billed as "The World's Hardest Puzzle", is a 45-room house in the form of a book. A party of naïve adventurers is led through by an unnamed poet/architect, whose identity is a subject of much speculation. Each page is a room, with hundreds of possible visual clues in the picture along with the numbers of the rooms that can be entered, and a page describing the actions of the narrator and the adventurers which may contain even more clues. The object is to reach the "center" (Page 45), answer the riddle found there, and get back out in the fewest possible steps (16).

File:Rats running around in a maze.png
Rats and mice are often run through mazes as part of science experiments.

Mazes in science experiments

Mazes are often used in science experiments to study spatial navigation and learning. Such experiments typically use rats or mice. Examples are

Other types of mazes

Logic mazes
These mazes use some rule other than "don't cross the lines" to restrict motion. Examples are
  • Area-mazes or A-mazes, which the area of the tile you step on has to alternatingly increase and decrease with every step.
  • Dice mazes, in which a die is rolled onto cells based on various rules.
  • Number Mazes, in which a grid of numbers is navigated by traveling the number shown on the current square.
  • Multi State mazes, in which the rules for navigation change depending on how the maze has been navigated.
Mazes in higher dimensions
It is possible for a maze to have three or more dimensions. A maze with bridges is three dimensional, and some natural cave systems are three dimensional mazes. The computer game Descent utilized fully three- and four-dimensional mazes.
Picture maze
A maze that form a picture when solved. See picture maze

Further reading


Computer generated maze