I recently got back to improving the crossword puzzle generator. The previous algorithm would only allow for clumps of four letters by pre-searching the word list and forming four word clumps. When the placement algorithm was running, it would try to place those four word clumps onto the existing puzzle everywhere in the grid. This had the advantage of speed but the clumping of letters was not interesting enough.

The old algorithm would never place a clump of four words or a single word at a location where a string of letters was formed other than those in the word or clump.

image

Complex Clumping

The new algorithm takes a very different approach to placing words. A word can be placed anywhere in the grid as long as any string of letters formed that are not part of that word are part of any word remaining to be placed. This could still result in a badly formed puzzle and I detect that later after placing all of the words. Although this slows down the algorithm, it also results in very interesting clumps of letters and words as can be seen above.

This is a brute force method and there is nothing done to attempt to place words over the newly formed string of letters when words are placed adjacent to other words. I simple throw out the puzzle when it is seen to be bad.

Although I picked a word list for the puzzle in the picture, I did nothing to place the words by hand. If the words did not have such interesting overlapping letters, some less complicated puzzle would have been found and reported.

I also changed the code to add a few points for each 4×4 group of 4 letters to make it more likely that a puzzle would have those clumps. I also remove the limitation on how long this will run and it can be left to run for hours, days, or weeks if desired.