70
$\begingroup$

This is an entry to the 12th fortnightly challenge.


Alice: Would you tell me, please, which way I ought to go from here?
Cheshire Cat: That depends a good deal on where you want to get to.
Alice: I don't much care where...
Cheshire Cat: Then it doesn't much matter which way you go!
Alice: ... so long as I get somewhere.
Cheshire Cat: Oh, you're sure to do that, if only you walk long enough.

Alice is in the most puzzling part of Wonderland yet. Following the white rabbit, she emerged found herself in the middle of a hedge maze. The rabbit provided her with a map before scurrying off, but it only seemed to make her more confused. She needs your help to figure out how to escape the maze.

The maze has 12 potential exits, numbered on the map. Each of the squares labeled A, B, C and D represent smaller copies of the entire maze. These submazes each have their own submazes, like infinitely many nested Matryoshka dolls, except that every doll has four dolls nested inside it.

Below the map is a bird's eye view of the actual maze, where you can see how the passages become smaller and smaller in a fractal fashion (only three levels of recursion are actually pictured). Fortunately, Alice has an ample supply of cakes and elixirs to change her size as necessary.

One last note: the little orange curve between B and D is a bridge which can be crossed over and walked under, but jumping from the bridge to the path below is not allowed.

Map

enter image description here

Bird's Eye View

enter image description here

Sources

Though I created this particular puzzle, the concept of a fractal maze is nothing new. Here are some other notable examples of cool fractal mazes, which served as inspiration for this one.

$\endgroup$
  • $\begingroup$ When Alice is scaled down to fit into the smaller mazes, does she move correspondingly slower? $\endgroup$ – Gareth McCaughan Jul 14 '16 at 18:17
  • 3
    $\begingroup$ Does Alice start at the single full-sized "You are here"? $\endgroup$ – Gareth McCaughan Jul 14 '16 at 18:18
  • $\begingroup$ @GarethMcCaughan Yes, she moves slower as she shrinks, and yes, Alice starts at the largest "You Are Here" (also, there aren't any copies of Alice in the smaller mazes). $\endgroup$ – Mike Earnest Jul 14 '16 at 18:25
  • 2
    $\begingroup$ Cool puzzle. +1 $\endgroup$ – hexomino Jul 14 '16 at 18:58
  • 3
    $\begingroup$ +1 for doing the research and adding the references. I was actually playing with such an idea myself (in my head) and did not know, that such mazes exist and are called "fractal mazes". Glad you made such a nice example for the challenge! $\endgroup$ – BmyGuest Jul 14 '16 at 20:08
45
+100
$\begingroup$

Here is a link to a prezi. If there is anyway to export it that would be great but I'm not exactly sure how it works.

Just keep clicking next through it.

https://prezi.com/oh2efo-ejbv9/untitled-prezi/?utm_campaign=share&utm_medium=copy

GIF

enter image description here

And the path in the format from-to (level). If the number includes a letter it comes from/goes to an internal maze box, if it does not it goes to the outside of the current level.

IN-A3 (1)
3-B1 (2)
1-12 (3)
B12-B11 (2)
11-A10 (3)
10-C4 (4)
4-B6 (5)
6-D8 (6)
8-10 (7)
D10-7 (6)
B7-7 (5)
D7-9 (4)
A9-8 (3)
B8-D3 (2)
3-B4 (3)
4-B6 (4)
6-D8 (5)
8-10 (6)
D10-7 (5)
B7-D10 (4)
10-8 (5)
D8-6 (4)
B6-4 (3)
D4-5 (2)
A5-1 (1)
OUT

$\endgroup$
  • 1
    $\begingroup$ Nice! A shorter path than mine :) $\endgroup$ – Wesley Situ Jul 14 '16 at 21:16
  • $\begingroup$ This is the optimal solution, in terms of number of size changes, well done! The prezi you made was very satisfying to navigate, I was happy to see the imaginary maze brought to life. $\endgroup$ – Mike Earnest Jul 14 '16 at 23:15
  • 6
    $\begingroup$ I've played with Prezi a bit, but never seen quite such an appropriate use case! Anyone who hasn't should try the Prezi link for a nice walkthrough. Very nicely demonstrated. $\endgroup$ – Dan Russell Jul 15 '16 at 14:45
  • $\begingroup$ Superb use of Prezi! Simply superb. Hang around for a little extra bounty from me. :) $\endgroup$ – CodeNewbie Jul 16 '16 at 6:08
  • 1
    $\begingroup$ It just took you 3 hours to solve it and make the beautiful prezi Oo ? Well done $\endgroup$ – pwnsauce Jul 28 '16 at 15:27
10
$\begingroup$

The path you can take out is

Enter A3
Enter B1
Exit B12
Enter B11
Enter A10
Enter C4
Enter B6
Enter D8
Exit D10
Exit B7
Exit C7
Exit A9
Exit B8
Enter D3
Enter B1
Exit B12
Enter B11
(Repeat)
Exit B8
Enter D1
Exit D12
Enter D11
Enter A10
(Repeat)
Exit A9
Exit D10
Enter B7
Enter D10
Exit D8
Exit B6
Exit D4
Exit A5

How I reached this conclusion

A few rules that you can make

Enter 4, Exit 7
Enter 4
Enter B6
Enter D8
Exit D10
Exit B7
Exit 7

Enter 10, Exit 9
Enter 10
Enter C4
Enter 4, Exit 7
Exit C7
Exit 9

Enter 11, Exit 2|8|9|10
Enter 11
Enter A10
Enter 10, Exit 9
Exit A9
Exit 2|8|9|10


Please help me with formatting ._.

$\endgroup$
  • $\begingroup$ Formatting is fine, but some drawing would be even better :c) $\endgroup$ – BmyGuest Jul 14 '16 at 20:09
  • 1
    $\begingroup$ What exactly does "(Repeat)" mean? $\endgroup$ – Gareth McCaughan Jul 14 '16 at 20:12
  • $\begingroup$ @GarethMcCaughan I'm assuming that he's repeating the Enter A10, Enter C4, Enter B6, Enter D8, Exit D10, Exit B7, Exit C7, Exit A9 block. Because is you place that instead of repeat it works to get you out of the maze. $\endgroup$ – dcfyj Jul 14 '16 at 20:30
  • $\begingroup$ @GarethMcCaughan Ahh, I meant to repeat the previous paths that were used to do the same enter/exit. It was a lot of steps to retype and didn't want to make the block longer than it already was. $\endgroup$ – Wesley Situ Jul 14 '16 at 21:12
  • $\begingroup$ This is a good solution, +1. I gave the other answer the green tick since it was shorter. $\endgroup$ – Mike Earnest Jul 14 '16 at 23:22
5
$\begingroup$

This puzzle definitely caught my fancy! The leap was when I realized that all moves could be expressed as compositions of "prime" moves, which don't enter any of the submazes: 1-12, 2-8, 2-10 and 8-10 (and their reverses). So I just drew the maze with blank submazes, added the prime moves to the submazes, saw which moves I could do now and added those to the submazes, and repeated until I had "built" the solution (3-5).

3-5: B 1-12*
     B 11-8
     D 3-5

11-8: A 10-9

10-9: C 4-7

4-7: B 6-7

6-7: D 8-10*

3-5: D 4-6

4-6: B 1-12*
     B 11-8
     D 1-12*
     D 11-8

I...haven't actually expanded the solution out all the way, but I'm mostly sure it's identical to gtwebb's.

$\endgroup$
  • 1
    $\begingroup$ So now you just have to finish :) $\endgroup$ – user58 Jul 18 '16 at 18:59
2
$\begingroup$

Found the same path as @gtwebb. I used the following notation: 1 - node 1 on external square, A7 - node 7 on A, CB11 - node 11 on B inside C. So from CAB6 there are edges to CA4 and CABD8.

First I ran the classic BFS... which didn't stop (until my patience ran out). Priority queue came to rescue, causing nodes with minimal length, which are closest to the external border, to be handled first. This found solution in under 1000 iterations and under 1 second.

Here's the script. It uses a, b, c instead of 10, 11, 12 to make things little bit easier.

And here's the solution:

A3 - AB1 - AB12 - AB11 - ABA10 - ABAC4 - ABACB6 - ABACBD8 - ABACBD10 - ABACB7 - ABAC7 - ABA9 - AB8 - AD3 - ADB4 - ADBB6 - ADBBD8 - ADBBD10 - ADBB7 - ADBD10 - ADBD8 - ADB6 - AD4 - A5 - 1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.