Showing posts with label polyhexes. Show all posts
Showing posts with label polyhexes. Show all posts

Sunday, August 6, 2023

More Hexahaxes

Been a bit busy the past couple of months, and also I lost my main polyform-solving table to a sort of part time working-from-home setup. So things worth blogging about have been a little thin on the ground. But here goes:

polyformer.py - A Substitute for Creativity

A little while ago I made this:

Basically, you tell it what size your set of polyforms covers, how many holes you want and how big an individual piece is, and it calculates possible shapes that can be tiled - squares, rectangles, triangles, diamonds, groups of congruent rectangles, etc. It doesn't tile them, that's left up to the user, it just gives some suggestions as to what can be done. Essentially, I was sick of doing all the area calculations by hand so I automated it. And every so often I'll think of a new class of shapes that might be interesting and it's not a lot of work to add that into the program as and when. It doesn't handle parity (yet), and sometimes it'll just suggest something completely impossible because I overlooked something, but on the whole it does its job.

Solving Hexahexes

Hexahexes are a relatively unexplored territory to me - partly just because I haven't had the pieces very long, and partly because I just generally overlook polyhexes for whatever reason. And partly because there's a piece with a hole and that's just another little irritating detail you have to plan for when designing constructions (or constructing designs, as the case may be). But the program said that there was lots of fun things to do with the set (once I'd deciphered the confusing shorthand that is the code's output - it made sense on the day I wrote it but I quickly forgot which sides of the parallelogram etc. the lengths all referred to.)

Fig. 1: Here's one of the aforementioned constructions.

Solving with hexahexes is a piece of piss. sort of. There's not really anything weird like parity to deal with, and the proportion of friendly easy pieces that work at the end of the solution is quite high. After you've burnt through the stack of hideous wiggly wormy pieces that look like diagrams escaped from some cursed organic chemistry textbook then it's a solve that I'd rank somewhere between the hexominoes and heptominoes in terms of challenge.

Fig. 2: Here's some example nice co-operative pieces. Just for reference, or if you own a set of these yourself and want some handy tips, but also want to be spared the pain of many trial-and-error hard solves while you work out an optimal piece order.

Here's a couple of other miscellaneous solves.



A Final Random Thing

I get the feeling that a set of heptahexes (on a smaller scale than these ones) wouldn't be outside the realms of possibility. There's 333 of them, so less than the number of octominoes, and I've seen from the enneominoes that scaling down pieces even by quite a bit doesn't have a massive effect on their usability. Sure it just feels more satisfying solving with big meaty pieces that have some weight to them, but in terms of practicality (and cost!) some half or two-thirds scale 'hexes would be more sensible. So I'll see. I'm holding off on the laser cutting right now - still letting my wallet recover after the enneominoes - but some day...

Monday, February 14, 2022

Finding shapes to make (Hexahexes Edition)

This isn't touched on nearly enough on other sites: the process of finding which shapes are possible to construct with a given set of pieces. Sure, with squares or parallelograms it's easy enough - just factorise all the numbers from the total area of the pieces upwards and hope there's one that breaks nicely into two large enough side lengths to work with. And hope that the number of holes lets you do something nice with them too. Nothing worse than realising your potential even x even rectangle needs an odd number of holes, guaranteeing at least one of them will be hideously off-centre.

But when it comes to more adventurous shapes, you need to get a little bit creative. Generally, I try to find a formula that gives the total area when fed in the values for however many edge lengths. In the case of hexahexes, for example, a hexagon with two lines of symmetry should be workable, and the formula A = ab(a-1) + (a-1)² gives the total area for a hexagon with a unit hexagons in its shorter diagonal and b unit hexagons in the longer diagonal.

Determining these formulae is an art unto itself. The usual approach is to break your shape up into squares or rectangles (in the case of polyominoes), or parallelograms and triangles (in the case of polyhexes), then get expressions for the areas of those separate bits individually. All of this goes to hell when you try it on polyiamonds though.

Once I've got the formula it's then a case of making a big, ugly and confusing-to-the-untrained-eye Excel spreadsheet (actually, it's an OpenOffice spreadsheet because I'm cheap) where every possible combination of values for a and b are evaluated. Then it's just a case of going through and finding the values that are equal to or slightly greater than the total area you want. For hexahexes it's 492 (6x82), and all the likely candidates will fall on roughly a nice curve like in the picture below.

Click the image for bigger (if you're into dull spreadsheets)

Then after this step it's easy. Take a punt at sketching out the shape with a configuration of holes that looks half way presentable, then dig out the hexahexes and clear a flat surface and get some solving done. Admittedly, feeding the shape and the pieces into some solver software will yield much the same results in a fraction of the time, but where's the fun in that?


Here's the case where a = 13 and b = 14. And below we've got a = 11 and b = 19 with seven holes.


Thursday, December 2, 2021

Hexahexes

I always sort of overlooked polyhexes in the past. Polyominoes were the main event, so to speak, and the first polyforms I really got properly into, and on the rare days I wanted a really infuriating challenge I would usually turn to the polyiamonds. But polyhexes for whatever reason just weren't really on my radar. Sure, I had a physical set of the 1- through 5-hexes from Kadon, and I solved a couple of things with them. And I even made a half-arsed blog post a while back. But that was about it really. Until now.

A few weeks ago on a whim I got a set of hexahexes cut out of the cheapest MDF money could buy. I didn't even shell out the extra two quid for the laser cutting people to cover the wood with protective masking tape, instead opting to let the bits get gently toasted around the edges by the laser. And then I took them on holiday, to a chilly weekend in a caravan in Northumberland where I knew I'd be a captive audience in the evenings. And while there I slowly began to realise that I'd missed out... Polyhexes were fun. In fact they weren't just fun, but were in fact... very fun.

This photo doesn't really give any sense of scale, but each hexagon is 8mm to an edge, and the full solution has a diameter of about 40cm or so on average. I think. Nice and chunky. I actually checked the scale this time before cutting unlike my positively tiny enneiamonds.

The slight browning of the edges turned out to be something of a blessing in disguise - it makes the borders between adjacent 'hexes stand out a bit in photos which is handy. Sometimes I'm too lazy to draw up a pen-and-paper record of a solution, so just being able to take an aerial photo that I can work from to create a digital image is a nice time-saver. And talking of digital images:

Here are solutions to two different hexagons, the more compact one is the shape of the solution Kadon uses for Hexnut II; the larger thinner hexagon I haven't seen anywhere before. I haven't ran the numbers for hexagons larger than this; it could be that there is an even bigger thinner (and therefore harder to solve) hexagon ring out there waiting to be found.

Speaking of, solve difficulty is the best thing about the hexahexes. It's somewhere between that of hexominoes and heptominoes, I'd say. A good, meaty challenge but one that I don't need to set aside a whole evening for. There are a couple of kinks to be ironed out with my solving technique, though, mostly the fact I'm not used to hexagons so it's often not immediately obvious whether a piece will fit in a certain place without actually trying it a few different ways.

Unholey Hexahexes

If you discard the holey hexahex (as we sort of unintentionally did for the rings above) you get 81 pieces and a total area of 486 hexagons, which divides up very nicely indeed. So far all I've done with this set is the really easy stuff - a couple of approximations of parallelograms, of which one is shown below for your perusal.

The 81 unholey hexahexes squeezed into an 18x21 parallelogram. Solve time approx. 45 minutes manually.

But there's a lot more out there than just parallelograms. It's fairly easy to work out formulae tying the edge lengths to the area for various hexagons, triangles and other such shapes that hexagons lend themselves well to. And from there just a little bit of searching for edge lengths that give the magic number, 486.

Which will all be a nice excuse to post a bunch more blog posts. I need to pick up the pace - this year my posting rate on here has gone right down. That's partly because I've been putting some things directly to polyominoes.co.uk (and discovering the joys of trying to display characters like '°' in html), but it's also partly because my interest in polyforms seems to come and go in phases. And summer this year I've just been preoccupied with other things (recording an album, teaching myself to read Japanese, and dusting off the Rubik's cubes and getting back into speedsolving). But now with winter drawing in, and with its long cold rainy evenings with nowhere else to go and not much else to do, there's a non-zero chance I'll dedicate a bit more time to the sacred art of polyform-ing. And to the subsequent rambling about it on here.

Thursday, July 18, 2019

Baby steps with Polyhexes

I know, I know, the blog name is 'polyominoes' and this isn't strictly polyominoes but hear me out. A few weeks ago I got my grubby mitts on a set of these:


Polyhexes! The 1- through 5- hexes to be more specific, fresh from Kadon Enterprises. And after playing with nothing but polyominoes for years, switching to these is weeeird. The whole '120-degree angles' thing.
With months of solving polyomino constructions I had developed a kind of sixth sense for instinctively knowing whether a piece would fit in a given place, and I had a pretty good idea of which pieces I needed to hold onto for late in the solution. With this bunch, no such luck however. It didn't help that I had no familiarity with the pieces as a set either - with hexominoes (and even heptominoes to a degree) you start to individually know each piece in the set, and can generally rely on memory to get a vague idea of which pieces have been used so far. And the pieces end up with little nicknames based on their shape, so that when I'm frantically scrabbling around looking for a piece I can better remember exactly which one I'm after. With polyhexes it was like starting from scratch again. So I started with just the easy pieces and worked my way up...

Tetrahexes, then.

There are seven of these, and they can do a surprising amount. Their total area is 28 units, meaning that a 4x7 parallelogram should be possible... and it is. While there is a sort of restriction similar to the parity issue with polyominoes that can occur in polyhexes, it doesn't impact constructions like this the way it does tetrominoes (I think it might be responsible for the triangle with side length 7 not being possible though.)
(Also surprisingly challenging: drawing hexagonal things in MS Paint.)
There's also this 3-cell-high pattern too. There are two possible solutions for this; finding the second one is an exercise for the reader.
 And here's two patterns based on the 5x6 parallelogram with symmetrical holes.


Difficulty-wise, I'd put these somewhere between tetrominoes and pentominoes. Which sort of makes sense, as there are 7 of these, right between the 5 tetrominoes and 12 pentominoes. And that propeller-looking piece is a royal pain in the arse.

There's bound to be more fun stuff to be done with these pieces, but this was all I managed to find before the allure of the pentahexes became much too strong to resist.


Pentahexes, for those not in the know, are the shapes made by sticking five hexagons together edge-to-edge. And there are 22 of them, giving a total coverage of 110 units. Which is promising, since 110 can be divided up in various nice ways - we ought to be able to get a nice selection of parallelograms out of them.

Sadly, I've been a tad lazy and only attempted the 10x11 so far; my solution is shown below.


If you look at the top-left you'll see that I've tried to carry over my usual technique for polyominoes, which is holding onto the clumpy, blocky bits. But this technique... needs work. This was still a right hassle to solve, I think it took about an hour by hand (and just to rub it in, search software finds solutions to this in like 3 seconds.)

Oh yeah, and there's one other fun thing I noticed with the pentahexes. None of them extend for more than 3 cells in more than one direction. They all could fit in a three-cell-high construction, if someone was masochistic enough to go look for it...
I remembered how deceptively tricky getting the tetrahexes into that 3-cell hexagon thing was. And at this point I could have done the right thing and put down the pentahexes and, I don't know, gone outside and talked to girls or something. But~! Once a challenge like this presents itself, you can't just back down, so I began knocking together little segments of three-cell-high, to be hopefully worked into one big long construction. Remember the infuriating propeller-shaped piece in the tetrahexes? (Maybe you own a set, and know the frustration first-hand!) Well, the pentahexes have a good selection of pieces related to the propeller but with an extra hexagon tacked on, and these have all the infuriating properties of their 'parent' tetrahex, and then some!

So after quite a while (I lost track of time, as tends to happen once you get right into a good polyform construction) I eventually stumbled upon the following solution. And vowed never to tackle something like this again - not for next few hours anyway.
Fig. 6 - The 22 pentahexes squeezed into a little narrow construction that I'm stunned actually works.