# Getting Stuck on Purpose

Consider the following building floor plan, with a set of rooms labeled A-G and an Outside:

The lines between each pair of blue dots are walls. Ordinarily in problems like this the goal is to draw a single continuous curve that passes through each wall once and only once, ending up back in the room where the curve was started (a so-called "Hamiltonian cycle").

However, for this particular set of rooms, the real challenge is to get stuck. Getting "stuck" means you draw your curve so that you eventually have no way of exiting the room you're in (because you've passed through all of its walls once) even though you haven't passed through all the walls in the building.

You can start your curve in any room, but not on the outside of the building.

Can you get stuck on purpose?

To present your solution to the problem, please give the sequence of rooms your curve passes through, beginning with the room you start in. For example, a curve that starts in room G and ends at the x (as shown below) has the sequence G Out B A Out.

## 2 Answers

One solution would be to "use up" all of the walls except one, and then enter the room for the last time:

The syntax for this would be CBACFDCEGC.

This can be done for any room. If the room has an even number of walls, start inside of it (so that it has an odd number when you leave and actually start "using up" walls two at a time); otherwise, start outside (so that you can "consume" two walls at a time until there's only one left, which you then enter).

All of these rooms have an even number of walls. Therefore, to successfully solve this problem, you must start in the room that you end in.

• Crud. I forgot a wall. I guess we can chalk this one up as a candidate for "easiest brainteaser o' the month". :P – COTO Nov 4 '14 at 2:34
• Actually, I'll delete the question and post it anew once it's fixed. – COTO Nov 4 '14 at 2:36
• Apparently I can't. So... I won't. – COTO Nov 4 '14 at 2:37
• @COTO You could edit the question, and I wouldn't mind fixing my answer to match it. – Doorknob Nov 4 '14 at 2:39
• We'll chalk it up as a happy mistake. Who knows. Maybe the solution to this puzzle won't be as obvious to some people. ;) – COTO Nov 4 '14 at 2:43

Not sure if that counts, as I didn't understand your statement of "even though you haven't passed through all the walls in the building" so I just did it until all walls had been passed anyway.

The key lies in making best use of room F and G, the only odd-wall-numbered rooms in the diagram. Code: FoFDoDEoEGoGoBoAoFACFDCEGBCBA

• I think the question was asking for a way to get stuck without using all of the walls. Also, even with your answer as it is, there are two things wrong. First, you can still go to F from your position at the end, and second, F and G are not odd-wall numbered rooms - they both clearly have 8 walls. – mdc32 Nov 4 '14 at 22:30
• Oh, I must have miscounted. And of course I know it's possible to go back to F if I wanted to, I just thought the question was asking if it was possible to find a path that does not end back at the start and gets stuck in the room it ends in. – Ashizen Nov 5 '14 at 13:51
• But you aren't stuck at A. There's still an opening on the left-hand side of A, bottom wall. You pretty much just gave a Hamiltonian cycle as an answer, even though the question says not to. – mdc32 Nov 5 '14 at 14:35