How to solve a 3D maze
By: Estee Van Der Walt
Tags: Architectural Design, Maze, Puzzle, 3d, Reinforcement Learning

I love solving puzzles. With COVID keeping us all indoors I wanted to try my hand at something new. I found this series of 3D mazes (Inside3 Original) from Doug Factory and it looked exactly like what the doctor ordered.

There are many options and as I was on a budget I wanted to try the one that would give me the “best value for my money”. I wanted something that would be a challenge but equally not unsolvable. There are three main cubes:

noVICE — smaller cube (5x5)

0 series — larger cube (7x7)

PHANTON series — larger cube (7x7) with a second marble inside to distract you

The colours also has meaning and range from easy to extremely difficult. The most difficult cubes are closed and cannot be opened.

In the end I settle for the “red awful 0” cube. My reasons: it was the most difficult, biggest cube, that I would still be able to open should I mess things up. I also did not want the distraction of a second metal ball.

So could you solve it?

haha … Great question if I say so myself! How difficult could this be? The goal is to get the metal ball from one end of the cube to the other following the maze map printed on the outside (front and back).

I quickly learnt that not only did you have to keep track mentally where you were but that you also should have the dexterity to move the little metal ball down the paths you want. For example… sometimes you are falling down through the cube (3 levels) only to find that the bottom is a dead end and you should have moved the cube side ways in order to “mid way” go down another path.

I got stuck after just 3 moves!! To be fair, the inventors did say that you should probably start with the easier cubes first to get accustomed to the skills required.

Even more interesting is how this maze not only follows a path down to the bottom. You need to go back up to make progress and for that you have to flip the cube around. You would think that the maze is still the same but not only has the actual map reversed (obviously) but the holes in the opposite direction is completely new (not so obvious).

Here is an example of one level seen from the top (left) and from the bottom (right) with the green circles representing the holes the metal ball could fall through.

I was still stuck after just 3 moves as much mentally as physically!

So how are you going to solve it?

Some lateral thinking was required here. If I was not even going to remember 3 steps in my head, let alone how many 100 is required here… let me solve it on paper first.

I have always somehow liked architectural drawings and the precision it requires. This in itself is an interesting challenge. Graph paper seemed like a good fit here as I would be able to scale each level of this maze to a bigger representation of the original version printed on the side walls of the cube. (Note although I did not have graph paper it is easy enough to make yourself with a ruler, pen and dots)

The end results looked like something below

In the end the solution required over 28 holes to be visited, multiple ups and downs, many dead ends, etc. Working out the solution on paper itself took me a fair bit of time in itself and I truly now understood the name of the cube — “AWFUL”.

Relating this to machine learning

Whilst solving this maze on paper, I though a lot about how my approach was very much a “brute force algorithm”.

Brute Force Algorithms are exactly what they sound like — straightforward methods of solving a problem that rely on sheer computing power and trying every possibility rather than advanced techniques to improve efficiency.

Could I solve this puzzle more efficiently with reinforcement learning (RL) for example? If RL is good enough for OpenAI to solve the rubix cube, then surely I could write something similar to solve this maze and even more challenging versions.

I also wondered whether I chose the shortest path? Were there any other solutions? Sounds very much like a graph problem. Is there an intersection between graph theory and RL? (link) (link) (link)

I will be planning to dabble in the above next, so stay tuned.

But did you solve the maze?

Back to the business at hand…

I actually still have not physically solved the maze. I felt that solving it on paper was already so satisfying that part of me want to move on but the other half of me will always want to learn the new hand dexterity tricks required to actually execute my plan on paper :)

… the challenge of the “AWFUL” maze thus to be continued…