Clump of Letters
After looking at this for a while, I figured out how to write the code to handle it. I also figured out another type of clump that I could try to handle as a special case but only if I had some three-letter words.
To handle this, the code will first will take every combination of four words from my word list and then feed them to some other code that will try them in all of 24 different orders. For each of possible four word sets, the four different configurations of beginning and ending letters will be checked. If there is a four way overlap, as seen in the image above, the code will save information away in a list that includes a reference to the words and an array of letters and flags that tell what this looks like.
During the puzzle build process, clumps like in the image will be tried at all possible places in the puzzle just like individual words are tried. if a clump works then it will be placed in the puzzle and the four words will all be removed the word list.
It should work but I have only coded it as far as finding all of the possible four word clumps.
The way things might work with three-letter words is where 2 three-letter words are right next to each other and there are three other words that end, begin, and end within those 2 three-letter words. It would take a lot of the proper letters to make it work so I’m not going to try it just yet.
There are a lot of special cases that are possible and I should work on a different algorithm to handle them all in some generic way if I want to end up with large clumps of shared letters. Special case processing is not very efficient but it is also not very flexible.