|
|
|
|
|
by tobr
2235 days ago
|
|
I wrote a crossword generator one or two years ago - it used this approach but for individual letters, not whole words. You’d feed it a pattern of blank squares. If I recall correctly, it used a dictionary to find all the words that would fit in each current row or column, and counted how many different possible letters each square could take. If it found a row or column with no matches, it would backtrack - otherwise it would take one of the squares with the fewest possible letters, fill one of them in, and recurse. If that would fail it would try the next possible letter in the list, until it ran out of letters, in which case it would also backtrack. It made it possible to produce incredible dense crosswords, but it wasn’t very efficient, as it would retry certain impossible local solutions again and again and again. I wonder if it would be more or less efficient to do one whole word at a time, as you suggest. |
|