Five-room puzzle

The objective of the puzzle is to cross each "wall" of the diagram with a continuous line only once.

For instance, by permitting passage through more than one wall at a time (that is, through a corner of a room), or by solving the puzzle on a torus (doughnut) instead of a flat plane.

Even without using graph theory, it is not difficult to show that the five-room Puzzle has no solution.

The rooms and the solution line must all be drawn on a single side of a normal flat sheet of paper.

The solution line must be continuous, but it can bend sharply or smoothly in any way and can even cross over itself (but not at a wall, so this is often prohibited).

This precludes "crossing" two walls at the same time by drawing the solution line through the corner at which they meet.

As the solution line is drawn, he will see it enter his room through one wall and leave through another.

However, having run out of ends, the line can not pass through all of the walls of the third five-walled room.

The puzzle consists of five rooms, which can be thought of as being connected by doorways
Top: A failed attempt on a plane — the missed wall is indicated
Bottom: A solution on a torus — the dotted line is on the back side of the torus (animation)
Comparison of the graphs of the Seven bridges of Konigsberg (top) and Five-room puzzles (bottom). The numbers denote the number of edges connected to each vertex. Vertices with an odd number of edges are shaded orange.