jonadsimon / wonder-words-generator

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

Recast as optimization problem to maximize overlaps #7

Closed jonadsimon closed 2 years ago

jonadsimon commented 2 years ago

Currently word-overlaps occur only out of necessity of all of the words needing to fit

By recasting as an optimization problem the solver will (hopefully?) greedily seek to maximize this constraint, both leading to faster solutions and better puzzles

Phrasing this optimization requires being able to express the "count" of letter overlaps. This framing can then also be used to enforce the "one free letter" constraint as "for each word, at least one letter must have overlap_count == 1"

jonadsimon commented 2 years ago

Not possible to do, Minizinc performs optimization via successive constraint satisfaction. If no solution satisfying the constraint can be found, no optimization can be performed.