Tuesday, April 9, 2019

Heptominoes: A Tale of Frustration

A little while ago I managed to pack the 108 heptominoes into a 23x33 rectangle. Sadly, the three holes in the construction were just scattered wherever allowed me to solve the thing. So, not the most aesthetically pleasing. A few days ago I set about remedying that - I figured a nice fairly-symmetrical construction would be to leave the three holes in a little diagonal line centred on the middle of the rectangle, and I dug out my little heptomino set and had a crack at it.

The first two thirds of the construction were fairly easy. There are so many heptominoes at this point that for pretty much any weird hole or gnarly boundary you could possibly create, there'll be an unused 'omino waiting that fits perfectly. And just by this strategy of sticking polyominoes down however I felt like it, I got about the first 75% of the rectangle done in one sitting, half and hour tops.

...that was, until I realised that in all the excitement I hadn't put the three holes perfectly in the centre. They were misaligned by one. And so began the first of many soul-crushing backtracking steps - tearing up a good 30 or so pieces so I could put the harbour heptomino and the two monomino holes next to it into the right place and continue on my way.

There's a point, approximately when there's about 15 heptominoes left, when the previous technique of just doing whatever stops working. There'll be gaps that could be filled by a piece but that piece has already been used earlier. There's gaps that could only be filled by two copies of the same heptomino, and gaps that just can't be filled at all, so it's a slower, 'two steps forward, one step back' process from here on in. Until you get down to the very end of the endgame...

I hope you've saved those blocky, co-operative pieces for last, you're gonna need 'em.

You know what's the absolute worst? This nonsense here:


Let's have a closer look at the damage:


Yeah, that. 1 like == 1 prayer.

Actually, I've thought about it a bit more and I think this is the second worst thing. The worst is what comes next: the heart-wrenching feeling of backtracking after reaching a near-miss point like this, tearing up big swathes of carefully-placed shapes in the desperate hope that this time they'll go back together nicely.
In fact, I spent a couple of hours doing this (spread over a few evenings) and wasn't getting much further than this. 107 heptominoes placed, and then there's a little heptomino-shaped gap left... that just happens to be the wrong shape. Tear a few out, rearrange them and try again.

At this point I was itching to just give up, pile all the pieces into the little tub I keep them in, reclaim that all-important desk space for more important things, but I didn't. Because it was tantalizingly close each time. A few times I reached a point where the hole left was one square different from the last heptomino I was holding.

After a few evenings of this I decided to do the unthinkable. I backtracked 12 pieces out, then cracked open FlatPoly2 and drew in the shapes and the outline of the remaining hole. Don't worry, not to straight-out find a solution, just to enumerate the solutions. If it said there was 200 ways of getting these last twelve shapes in there, then I'd just have to try a little harder. And if there were no solutions, well, I'd decide on a course of action if and when that happened (this would either amount to backtracking a little further, or just rage-quitting and scrunching the rest of the tiling into a heap, depending on how tired I was at the time.)


As it stood, there was 7 solutions to my last little section of rectangle. Reassuring, but not as reassuring as I'd have hoped. At least I was armed with this new knowledge - not only is it possible to complete this damn thing, but it's possible without having to backtrack any further and tear up any more of my precious handiwork from earlier.
And additionally, manually keying in the shape of the gap left had forced me to pay a bit more attention to it, and those two little holes right next to each other were just crying out to be plugged with the following heptomino (that was otherwise proving infuriatingly hard to fit anywhere):


It took maybe another quarter of an hour to go from here to the complete solution, still tentatively placing and backtracking, but spurred on with the knowledge that the solution had to be around here somewhere...



And it was! It's a hell of a feeling, looking down and seeing it finally complete. Here's the solution in all its glory, drawn up all pretty:




And as much as I'd like to say it was celebrations all round on finishing this, my first thought upon slotting that last piece in was "I bet that same hole pattern is possible at the centre of an 11x69 rectangle..."

So stay tuned, I guess.

No comments:

Post a Comment