Pairing cells in odd squares. [Graph Theory / Combinatorics]

Tricky

New member
Joined
May 8, 2018
Messages
3
I came across a bit of a problem. I'm not particularly gifted with the maths, so my choice of words may be a little off. Apologies for that in advance. Let's say you have a 3x3 grid and the 'game' is to connect the cells in two's, except for the middle block. One rule: horizontal and vertical lines aren't allowed.

The basic shape:


OOO
OØO
OOO

After a bit of doodling I came up with a maximum of 8 different solutions: https://i.imgur.com/jia0uY2.png

Untitled.jpg

It then occurred to me that's the same amount as there are connectable cells. That's neat and wondered if that's still true for a 5x5 (24 solutions) or a 7x7 (48) as well. But I quickly came up with more than 24 solutions for the 5x5 one. Now I feel like I'm overlooking something. What do I add to the rules of this simple 'game' so the number of solutions is always equal to the number of connectable cells?

A Redditor by the name of NewBornMuse wrote:

The number of connectable cells grows like n2, the number of possible connections grows a lot faster than that, probably something like n! if I had to guess. In that sense, whatever rule you come up with had better forbid "almost all" connections, loosely speaking. Not letting the lines cross, or something equally severe.
And I have to agree with that. The larger the square, the more severe the rule has to become, while it for whatever reason doesn't apply at all to a 3x3 one.
 
Last edited:
I've increased the middle block size with every iteration, so that the outer edge is always one block in thicknes (3x3 = 1x1, 5x5 = 3x3, 7x7 = 5x5). That seems to do the trick, but I had to write out a lot of solutions. Could someone confirm?

So if I'm right, then :

S = solutions
B = square length

S == B²-(B-2)² ?

Is there a better way to write that down? Again, I haven't had a mathematics class in 20 years.
 
Top