# How to escape a maze – according to maths

##### January 26, 2017 by Ruth Dalton And Nick Dalton, The Conversation

Mazes are in vogue at the moment, from NBO's Westworld, to the return of the British cult TV series, The Crystal Maze. But mazes have been around for millennia and one of the most famous mazes, the Labyrinth home of the Minotaur, plays a starring role in Greek mythology.

Which begs the question: what is the difference between a maze and a labyrinth? Although considered synonymous by some, it is generally accepted that a labyrinth contains only one path, often spiralling around and folding back on itself, in ever-decreasing loops, whereas a maze contains branching paths, presenting the explorer with choices and the potential for getting very, very lost.

While designing a maze can be a rewarding human task, computer scientists and mathematicians have a love of maze-generating algorithms. The algorithms tend to fall into two principal types: ones which start with a single, bounded space and then sub-divide it with walls (and doors) to produce ever smaller sub-spaces; and others which start with with a world full of disconnected rooms and then demolish walls to create paths/routes between them.

The great escape

There are techniques for escaping from mazes, but first you need to be sure what kind of maze it is. Most methods work for "simple" mazes, that is, ones with no sneaky short-cuts via bridges or "passage loops" – circular paths that lead back to where they started.

So, assuming it is a simple maze, the method that many people know is "wall-following". Essentially, you place one hand on a wall of the maze (it doesn't matter which hand as long as you are consistent) and then keep walking, maintaining contact between your hand and the wall. Eventually, you will get out. This is because if you imagine picking up the wall of a maze and stretching its perimeter to remove any corners, you will eventually form something circle-like, part of which must form part of the maze's outer boundary. This method of escape may not work, however, if the start or finish locations are in the maze's centre.

But some mazes are deliberately designed to frustrate, such as the Escot Gardens' beech hedge maze in Devon, which contains no fewer than five bridges, and so far from "simple".

Another method of maze escape, known as Trémaux's algorithm, works in all cases.

Imagine that, like Hansel and Gretel in the fairy story, you are able to leave a trail of "breadcrumbs" behind you as you navigate your way through the maze and then remember these rules: if you arrive at a junction you have not previously encountered (there will be no crumbs already on the trail ahead), then randomly select a way to go. If that leads you to a junction where one path is new to you but the other is not, then select the unexplored path. And if choosing between a once or twice-used path, choose the path used once, then leave a new, second trail behind you. The cardinal rule is never, ever select a path already containing two trails. This method is guaranteed, eventually, to get you out of any maze.

Everyday mazes

So how is any of this maze stuff useful? Well, from the perspective of architecture and urban design, we want to avoid accidentally creating mazes. Mazes are fun, but are not necessarily something we want in our everyday lives – or in our way when we just want to get to work.

In the 1980s, the architectural theorist, Bill Hillier, observed that many of the most socially problematic housing estates were those that appeared to be somewhat "maze-like" in their layout. This begged the theoretical question: how do we actually measure the "maze-iness" of a place?

To answer this, Hillier developed the measure of "intelligibility", which is the relationship between what is immediately visible from a single location in a maze/housing estate/neighbourhood and how accessible that same place is from other locations in the area. The measure ranges from 0 to 1: environments that score highly (greater than 0.5) tend to be quite intelligible, easy to understand and navigate, and frequently desirable – for example Barnsbury, in London.

Conversely, places with a low intelligibility score tend to be confusing, hard to navigate and, ultimately, maze-like – London's Barbican Estate, although architecturally lauded, is so confusing that visitors need to follow the yellow lines in order to find their way around.

It was this measure of intelligibility that we used to design the game levels in the recent SeaHeroQuest game, a game designed to measure people's navigational skills in order to further dementia research.

We "reverse-engineered" intelligibility in order to produce game levels that were more, or less, maze-like, to ensure a range of challenges for the players. Therefore, the mathematics of design is just as applicable in modern, dementia-battling apps as it was in distant Greek mythology.

Explore further: Chimpanzees show ability to plan route in computer mazes

## Related Stories

#### Chimpanzees show ability to plan route in computer mazes

April 13, 2015

Chimpanzees are capable of some degree of planning for the future, in a manner similar to human children, while some species of monkeys struggle with this task, according to researchers at Georgia State University, Wofford ...

#### Mazes and brains: When preconception trumps logic

December 22, 2015

Researchers can now reconstruct what we see in our minds when we navigate—and explain how we get directions wrong.

#### A GPS from the chemistry set

October 27, 2014

Swiss scientists teamed up with colleagues from Hungary, Japan and Scotland to develop a chemical 'processor' that reliably shows the fastest way through a City maze. As the method is basically faster than a satnav system, ...

#### Oil droplets can navigate complex maze (w/ Video)

February 18, 2010

Call them oil droplets with a brain or even "chemo-rats." Scientists in Illinois have developed a way to make simple oil droplets "smart" enough to navigate through a complex maze almost like a trained lab rat. The finding ...

#### How the brain makes sense of spaces, large and small

August 26, 2014

When an animal encounters a new environment, the neurons in its brain that are responsible for mapping out the space are ready for anything. So says a new study in which scientists at the Howard Hughes Medical Institute's ...

#### The supremely intelligent rat-cyborg

March 7, 2016

When Deep Blue battled the reigning human chess champion the world held its breath. Who was smarter … man or machine? A human victory would confirm the superiority of human intelligence, while a victory for Deep Blue would ...

## Recommended for you

#### Modern math sheds new light on long-standing debate about Viking-age Ireland conflict

January 23, 2018

Modern mathematical techniques - similar to those used to analyse social-networking websites - have allowed academics to shed new light on a centuries old debate surrounding the Viking age in Ireland and the famous battle ...

#### Insects took off when they evolved wings

January 23, 2018

The evolution of wings not only allowed ancient insects to become the first creatures on Earth to take to the skies, but also propelled their rise to become one of nature's great success stories, according to a new study.

#### Rare 450-million-year-old 'cone-shaped' fossil discovery

January 23, 2018

Researchers from the University of Leicester, working with an international team of geologists, have discovered an enigmatic fossil of a 450 million year-old creature resembling a tiny ice-cream cone.

#### New 508-million-year-old bristle worm species from British Columbia's Burgess Shale wiggles into evolutionary history

January 22, 2018

Researchers at the Royal Ontario Museum and the University of Toronto have described an exceptionally well-preserved new fossil species of bristle worm called Kootenayscolex barbarensis. Discovered from the 508-million-year-old ...

#### The Pentagon built with mineralized microbes predating dinosaurs

January 19, 2018

A new study led by The Australian National University (ANU) has found that some of the building blocks of the Pentagon and Empire State Building were made by microbes that lived up to 340 million years ago, predating the ...

#### Researchers find first evidence of sub-Saharan Africa glassmaking

January 18, 2018

Scholars from Rice University, University College London and the Field Museum have found the first direct evidence that glass was produced in sub-Saharan Africa centuries before the arrival of Europeans, a finding that the ...

##### Cardo
not rated yet Jan 27, 2017
"Which begs the question: what is the difference between a maze and a labyrinth?"

FYI, that is not how one "begs" the question. "To beg a question means to assume the conclusion of an argument."
##### krundoloss
not rated yet Jan 30, 2017
Whenever I play video games, which have mazes, I always turn left. It has worked out pretty good. This assumes you can keep track if you have been somewhere before. Being "in a maze" is much different than solving a maze puzzle.