jonadsimon / wonder-words-generator

Generates WonderWords puzzles
Apache License 2.0
2 stars 0 forks source link

Add upper-bound letter frequency constraint #27

Closed jonadsimon closed 2 years ago

jonadsimon commented 2 years ago

Since #letter > #squares, can strictly upper-bound the letter counts with a frequency constraint.

Unclear how helpful it will be, but it's at least a well-defined global constraint. If anything breaks it, it will be the overly-common number of e.g. a's

jonadsimon commented 2 years ago

Tried this again, didn't help. Functionally-identical programs with/without constraint:

Adding the constrain made the runtime take LONGER

Used an upper-bound of number of each letter occurring across all words, and used a lower-bound of this quantity / 2

Solutions found by the two programs were IDENTICAL, the bounded one just took longer to run

Tried alternate search formulations, but it didn't help

Implies that the program does not have an issue with finding appropriate letters. Make sense since it searchers via the words, and the words directly imply the letters