Yamagishi Complexity Torus LabYamagishi Lab

[Paper 876] Keeping a Hand on the Wall Always Reaches the Goal Only When the Walls Are All Joined to the Outer Wall

Abstract

It is said that keeping the right hand on the wall always gets you out of a maze. This paper counts, in mazes with walls removed, where that promise breaks. No new theorem or law is claimed.

First, in a loop-free maze it always arrives: in a $15\times15$ maze whose rooms are joined by single paths, all $120$ trials with random start and goal arrived (Section 2).

Second, removing walls brings failures: removing $2$ inner walls gives $0.883333$, $10$ gives $\mathbf{0.541667}$, and $40$ gives only $0.233333$ (Section 2).

Third, and this is the core. What breaks it is not the loops but wall pieces cut off from the outer wall: no trial ever failed when there were no such pieces; every failure happened in a maze that had them (Section 3).

Fourth, removing walls adds both loops and cut-off pieces: the number of loops (paths $-$ rooms $+1$) equalled the number of removed walls in every trial, and cut-off pieces averaged $\mathbf{25.866667}$ with $40$ walls removed (Section 3).

Fifth, arriving is not taking a shortcut: in loop-free mazes, the steps taken were $\mathbf{5.728101}$ times the shortest path (Section 2).

Sixth, the separator is whether one asks if the paths contain loops or if the walls are joined to the outer wall: the hand follows walls, and if the walls are all joined, it traces the outer wall even when the paths contain loops (Section 4).

Keywords: maze, wall following, loop, wall pieces cut off from the outer wall, simply connected.

Scope (what is not claimed)

No new theorem or law is claimed: that keeping one hand on the wall reaches the goal when the walls are all joined, that islands of wall break this guarantee, and that the number of loops is edges $-$ vertices $+1$, are all known. Real mazes are not treated: garden mazes and evacuation routes are not the subject. Other methods are not entered: methods other than wall following, such as marking visited paths, are not treated. Nothing is proved: mazes were made with random numbers, and only counts from $120$ trials each are examined. Relation to earlier papers: Paper 331 showed that area, a continuous quantity, comes out exactly from counting two kinds of points, and in its scope note did not treat regions with holes. This paper stands beside it. There, a single hole breaks the premise of the count, so holes were excluded. Here we count that holes on the wall side, pieces of wall cut off from the outer wall, break the promise of wall following. What is added is measuring the share of arrivals for each number of removed walls, counting loops and cut-off pieces separately, checking that no trial failed when there were no such pieces, and placing the separator on loops versus the joining of walls.

1. Notation and the Question

Setting: $15\times15$ rooms are divided by walls, and walls are broken one at a time at random to make a maze whose rooms are all joined by single paths (no loops). Then $r$ inner walls are removed to add loops. Keeping the right hand on the wall means moving one room in the first open direction among right, ahead, left and back. Coming to the same room facing the same way twice is counted as failing.

$$\text{loops}=\text{paths}-\text{rooms}+1,\qquad \text{share of arrivals}=\frac{\text{arrivals}}{120}$$

Wall segments were joined at lattice points, and the pieces of wall not joined to the outer wall were counted. Start and goal were chosen at random in each trial.

Question: does keeping the right hand on the wall always arrive, in any maze?

2. Removed Walls and the Share of Arrivals

Computation 2.1: for each number of removed walls, $120$ trials gave the share of arrivals, the pieces cut off from the outer wall, and the steps taken on arrival divided by the shortest path.

removed wallsshare of arrivalscut-off pieces (mean, max)steps $\div$ shortest
$0$$1.000000$$0.000000$, $0$$5.728101$
$2$$0.883333$$1.475000$, $2$$8.159115$
$5$$0.733333$$3.675000$, $5$$7.061306$
$10$$0.541667$$7.233333$, $10$$7.925349$
$20$$0.366667$$14.333333$, $19$$7.729748$
$40$$0.233333$$25.866667$, $35$$6.686513$

Observation 2.2 a loop-free maze always arrives, and removing walls brings failures. With $0$ walls removed all $120$ trials arrived; with $10$, $65$ of $120$; with $40$, the share falls to $0.233333$: even on arrival in loop-free mazes the steps were $5.728101$ times the shortest path, entering dead ends and coming back. Wall following promises arrival, not speed.

3. What Breaks It

Computation 3.1: in every trial, the number of loops was matched against the removed walls, and the cut-off pieces against arrival.

Observation 3.2 this is the core. What breaks it is not the loops but wall pieces cut off from the outer wall. In trials with no cut-off pieces, no failure occurred for any number of removed walls: every failure happened in a maze with such pieces. The hand follows walls, so circling a piece cut off from the outer wall, it cannot move over to the wall where the goal lies.

Observation 3.3 removing walls adds both loops and cut-off pieces. The number of loops (paths $-$ rooms $+1$) equalled the number of removed walls in every trial: cut-off pieces averaged $1.475000$ with $2$ walls removed and $25.866667$ (at most $35$) with $40$, never exceeding the number removed.

4. The Separator

Observation 4.1 the separator is whether one asks if the paths contain loops or if the walls are joined to the outer wall. Seen from the paths, removing walls adds loops: seen from the walls, it creates pieces cut off from the outer wall. The hand follows walls, so what decides the promise is how the walls are joined.

Observation 4.2 placed beside Paper 331. 331 showed that area comes out from counting two kinds of points, and excluded regions with holes. There, a single hole broke the premise of the count. Here, a single hole on the wall side, a piece cut off from the outer wall, breaks the promise of wall following.

Observation 4.3 what is not said. Real mazes or evacuation routes, marking visited paths, and proofs are not treated. What is shown is that wall following always arrives only when the walls are all joined to the outer wall.

5. Census and Closing

  1. right, ahead, left, back (Section 1): hand on the wall.
  2. all $120$ arrive without loops (Computation 2.1): the promise holds.
  3. $0.883333$ with $2$ removed (Computation 2.1): it starts to break.
  4. $\mathbf{0.541667}$ with $10$ (Computation 2.1): $65$ of $120$.
  5. $0.233333$ with $40$ (Computation 2.1): falling further.
  6. no failure without cut-off pieces (Observation 3.2): the core.
  7. loops $=$ removed walls (Observation 3.3): every trial.
  8. $\mathbf{25.866667}$ pieces with $40$ (Observation 3.3): cut off from the outer wall.
  9. steps $\mathbf{5.728101}$ times the shortest (Observation 2.2): no promise of speed.
  10. loops, or the joining of walls (Observation 4.1): the separator; Paper 331.

Closing: Keeping a hand on the wall always reaches the goal only when the walls are all joined to the outer wall. In loop-free $15\times15$ mazes all $120$ trials arrive, but removing $10$ inner walls leaves $0.541667$ and $40$ leaves only $0.233333$, because the hand follows walls, and circling a piece cut off from the outer wall it cannot move over to the wall where the goal lies. No trial failed when there were no cut-off pieces. What breaks the promise is not the loops in the paths but how the walls are joined. Placed among the earlier papers: beside the holes that Paper 331 excluded from counting area, we placed that holes on the wall side break the promise of wall following. To be honest: the mazes were of one size, $15\times15$, with $120$ trials for each number of removed walls.

References

  1. Even, S. (2011). Graph Algorithms (2nd ed.). Cambridge University Press.
  2. Yamagishi, Y. (2026). Area, a Continuous Quantity, Comes Out Exactly from Counting Two Kinds of Points [Paper 331]. YOI: https://www.yamagishiyuuki.com/yoi/331; DOI: 10.5281/zenodo.22681503

Reference

Yamagishi, Y. (2026). Keeping a Hand on the Wall Always Reaches the Goal Only When the Walls Are All Joined to the Outer Wall [Paper 876]. YOI: https://www.yamagishiyuuki.com/yoi/876
ORCID: 0009-0006-8587-3450

PDF (English) · PDF (Japanese) · Date proof of the English PDF (OpenTimestamps .ots) · SHA256SUMS

The record page for this paper (in Japanese, with the PDFs in each language and the date proof): YOI 876. This paper is a preprint and has not been peer reviewed.