# Geisterbahn 2.0

This puzzle was inspired by the ruleset of Round 3 of the German Logic Masters 2019: Geisterbahn 2.0

Place the numbers 2 or 3 in some cells such that all the numbers are connected orthogonally, no two identical numbers are diagonally touching and if it exists, the small number in the top left of a cage indicates the sum of the numbers in that cage. Some numbers have already been given.

Image generated with puzz.link

The solution is:

To solve this, we can start by making a few observations:

When we look at the grid, the first thing too see is that it is subdivided into 49 large cell, (almost) all consisting of a small cage in the middle that is already full, and a large cage around this where we still have to put some numbers. Each of these groups of numbers in a small cage can also be connected to at most two other small cages, by putting numbers in the large cage connecting the small case to the middle of one of the large cell sides, something like this:

The only place in the puzzle where this pattern is broken is here:

Namely both the group consisting of only 3's and the group in the cage with sum 10 both only can be connected to one other group. The group of threes can namely only be connected to the small cage with sum 12 below it, and the cage with sum 10 can be connected with the group above it or to its left, but not both at the same time.
So we have 49 groups of numbers, two of these groups can only be connected to one other group, and all the others can be connected to at most 2 other groups. Now graph theory tells us that the only way to connect these numbers is by drawing a single path through all groups which has its ends in the two groups with only one connection.
We can also formulate this as: we need to draw a single path passing through the centres of the large cells, that visits every cell (exact for the large cage with the 3) exactly once. This path should start at the group of 5 threes, and end in the cage above this group.

Furthermore, there are some more requirements:

There are namely a couple of cells through which the curve always has to make a corner, these have the following form:

This can only be connected to two centres of the border as follows (or some symmetry of this):

There are also the following large cells:

Which have to be resolved like this:

My approach for the next step unfortunately involves quite some backtracking, so I won't detail it here, but the result is:

This can then be translated back to the solution at the start of the post.

• Nice job! _____ – boboquack Sep 9 '19 at 23:05