I ran into an intriguing puzzle on Reddit that I thought could use some attention.
You start with a 3x3 grid labeled with numbers 1-9 like this:
$$ 1 \text{ }\text{ }\text{ }2\text{ }\text{ }\text{ }4 \\ 5 \text{ }\text{ }\text{ }6\text{ }\text{ }\text{ }8 \\ 9 \text{ }\text{ }\text{ }3\text{ }\text{ }\text{ }7$$
To complete the puzzle, you must connect directed edges between the numbers so that:
- The numbers connect in order from 1-9. There can be intermittent numbers when connecting them. For example, some puzzle may have the solution: 1, 3, 2, 9, 4, 3, 9, 4, 8, 5, 7, 8, 6, 7, 8, 2, 9.
- The edges cannot overlap each other.
- The vertices (the numbers) can have multiple edges connecting to it.
- You cannot go back over edges (no overlaps).
Here's a picture of a completed puzzle:
I have a couple of question relating to this problem:
If there are impossible puzzles, then what criteria determines if a puzzle is unsolvable? If I were to make it 4x4 or 5x5 or NxN, would the criteria extend to those? What proportion of puzzles for an NxN puzzle are solvable.
Here's the link to the Reddit post: https://www.reddit.com/r/math/comments/8b032u/need_help_for_an_eulerian_path_game_i_made/



Condition 4: Not being allowed to go back over edges definitely changes the complexion of the problem. In fact, for ALMOST ALL numberings of an $n \times n$ grid as $n$ gets large, such a completion of the puzzle is impossible.
Why? The resulting digraph on the $n \times n = n^2$ vertices (vertices here taken as points on the grid) would be planar due to Condition 2. This would imply for some subset $S$ of $\frac{n^2}{2}$ vertices of the digraph, then for some $R$ no more than $4n$, there are exactly $R$ edges leaving $S$. (Theorem of Lipton-Tarjan I believe). However, [one can check that] for $n$ sufficiently large, a random bijective numbering $\cal{N}$ of the $n \times n$ vertices of the grid (where the numbers used are $1,2,3,\ldots, n^2\}$), would be such that there are many more than only $4n$ integers $i$ that satisfy the following: $i$ is in $S$ but $i+1$ is outside of $S$. However, one can check that if $\cal{N}$ is a numbering such that there are $R'> R$ integers $i$ such that $i$ is in $S$ and $i+1$ is not, then solving the puzzle with the numbering as $\cal{N}$ is impossible. Indeed, such a path would have to leave $S$ at least $R' > R$ times which means that an edge leaving $S$ would be repeated.