Hello. I’ve been talked into writing another blog post about my latest puzzle to appear in the Puzzlebomb. Spelling Bees appeared in the May and June issues. The solver is presented with a honeycomb grid containing letters and one bee (of the insect variety; the grid may contain several or no Bs). Their task is to find the two words (or phrases) that can be traced along a path through every cell (to use jargon that will be familiar to cruciverbalists and beekeepers alike) in the honeycomb grid. The bee acts as a wild card and will stand for a different letter in both words. The cells which are the first and last letters of each word are shaded to give an extra helping hand.
Development of the puzzle
As much as I love cryptic crosswords (for the record: significantly more than is healthy) and pure logic puzzles, I also have a soft spot for word games and puzzles where words are treated merely as a set of objects to be toyed with, their meanings and usage irrelevant. There are already plenty of these of course: Scrabble, codewords, Countdown and the find-as-many-words-using-these-letters-always-including-the-central-letter game that appears in every newspaper under a different name. I wanted to try my hand at making one of this sort of puzzle.
There’s a puzzle in the Manchester Evening News in which you have to find a 15-letter word or phrase in a pyramid-shaped ‘maze’, and probably inspired by this I thought about having a 3×3 grid in which two different words, anagrams of each other, can be found. There were two problems with this: firstly, there aren’t actually that many nine-letter-word anagram pairs – CARTHORSE and ORCHESTRA is probably the most well-known and pleasing one, but they’re not so easy to come by; and secondly, there are only a few different paths through a 3×3 grid (an N-shape, a spiral, a sort of-R shape and rotations and reflections of these; see above). So the hexagon-based grid format came in, with each cell having up to six neighbours instead of four, and the wild card was added to allow not-quite-exact anagrams to be used. I reckoned this would allow enough flexibility for a good number of decently fun puzzles to be makeable, though I wouldn’t know for certain until I started trying to make them. And of course, from the hexagons came the idea of the bee to represent the wild card and from there came the name.
Construction of the puzzles
As you’ll have probably guessed, particularly if you read the blog for my last puzzle, the brunt of the legwork involved I outsource to the computer. The overall process goes something like this:
Human
- Choose the grid pattern for the puzzle, and tell it to Computer. Computer stores it as a sequence of neighbour-sets, so for this example it would store the grid as
, with the th member of the sequence giving the neighbours of the cell numbered . (To be awkward, Computer likes to call what we call the st member the ‘ th’ member, so is the th member of the list and is the set of neighbours of cell .)
Computer
- Find every path through every cell of the grid. Computer does this with a simple backtrack search: it builds up a path by repeatedly adding to the end of the path the lowest-numbered cell that is adjacent to the cell currently at the end, and hasn’t already been visited. When Computer successfully finishes a path it writes it down, and when it finishes a path or gets stuck in a dead end, it tries to replace the last cell in the path with a larger numbered cell, and if it can’t, gets rid of it and tries again with the new last cell. So in our example Computer would first build up the path
, and write it down. Obviously the can’t be replaced with a higher cell (there are no cells left unused) so it’s got rid of. The can’t be replaced by anything bigger so it goes too. Nor can the (since isn’t next to , the only number bigger than it). The ‘stump’ path is now left, and Computer sees that it can replace the with a , giving . It adds the on (being the lowest-numbered neighbour of not already in the path). But now it’s at a dead end: has no neighbours not already in the path. So the goes, and the is replaced with the …. This goes on for a bit, until eventually Computer has found all the paths. It knows this has happened because the path dies back all the way to nothing ( goes to goes to goes to oblivion). - Computer trawls its word-list (the same one as used for Hilbert’s space-filling crossword) for a pair of words that differ in only one letter (and the order the letters are in of course). Clearly, this is the kind of task Computer loves, and so I shall omit a description of the boring details of this aspect. Once Computer has found a pair, it writes them down with an asterisk in place of the letter that will become the bee in each word.
- Having found a suitable pair, Computer checks them against the grid patterns to see if they fit. Computer effectively writes the first word in the grid along one of the paths, and then checks every other path to see if it spells out the second word. If it doesn’t, Computer moves the first word to a different path and tries again.
- Computer repeats the find-words-check-words process until it finds a pair that fit in the grid. Computer shows Human the puzzle and goes and has a lie down.
Human
- Human checks that both the words in the puzzle are reasonably common words that a solver will have a fighting chance of getting, and that the words are not too similar that the puzzle is trivial (you might be disappointed to find that the solution to this puzzle is SAFFRON and AFFRONT). Human (probably with help from Computer) should probably also check that there aren’t any other words that can be found in the grid, leading to multiple correct solutions, but to be honest Human is a little lax about this.
A little bit of Maths
Since this neither a puzzles site nor a computer programming site but a maths site, here are some maths-y questions that I have considered while making these puzzles/writing this blogpost.
1. How many paths through a grid are there?
Well, firstly let’s stop this talk of ‘grids’ and ‘cells’ and put this in proper maths terms. The puzzle grid can be considered as a graph
2. How likely is it that a given pair of anagrams fits into the grid?
On the face of it,

Two different paths through the grid generate a particular anagram permutation: in this case, the first letter moves to second position; the second letter to seventh position; the seventh letter to the first position; and the other four stay still. A mathematician might write this down as
However, some of these pairs of paths will give rise to the same permutation. The graph is the same turned upside-down or reflected left-right or top-bottom, so any pair of paths that differs from another only by one of these symmetries will give the same permutation: if you turn a Spelling Bees puzzle upside down then it’s still the same puzzle. Formally, if a pair of paths is the image of another pair under an automorphism of the graph then both pairs will give rise to the same permutation
Bonus Question 1: is the converse statement true: are two path-pairs giving the same permutation necessarily related by a graph automorphism?
So we have a set of permutations available to us as potential anagrams, which we might call the set of permutations realizable as Spelling Bees on that graph. Given a set of permutations, a natural question to ask is whether it forms a group. Now, in the above I glossed over some details that are important if we want to talk about groups: I gave the number of pairs of paths simply as
Bonus Question 2: are there graphs whose set of permutations-realizable-as-Spelling-Bees form a group, other than the ones described above? (I do not know the answer to Bonus Question 2 and have made no great attempt to check that it is not boring or near-impossible or both. Have fun!)
Anyway, let us move away from group theory. Dependent on the answer to BQ1, we have perhaps around