jonadsimon / wonder-words-generator

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

Set pre-optimization iteration cap as function of FLOPs rather than loops #71

Closed jonadsimon closed 2 years ago

jonadsimon commented 2 years ago

The same number of loops in the get_words_for_board_optimize_fast function can have wildly varying numbers of internal steps as currently measured. This causes some inputs to run for several minutes despite technically having a low loop count

Add the true loop # and/or optimize the function

Can be tested with the long-running input: python make_puzzle_v2.py "conference" "deadline" --packing-constant=1.22 --strategy=median --pivot=max_freq --optimize-words

jonadsimon commented 2 years ago

Added in d99ad4a..7ab4e48

Would be better to optimize the underlying algorithm since with the function-calls this is basically a 5x-nested loop, but this is good-enough for now