# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3 (ipykernel)
#     language: python
#     name: python3
# ---

# ## Exhaustive Search and the Theoretical Minimum
# Doddle is primarily a heuristic solver. However, it is possible to find a theoretically optimal tree via an exhaustive recursive search. To the best of my knowledge, [<NAME>](http://sonorouschocolate.com/notes/index.php?title=The_best_strategies_for_Wordle) was the first to prove that `SALET` is capable of generating the optimal decision tree with a total of 7,920 guesses to solve the 2,315 problems from the original Wordle dataset. 
#
# Here we show how to derive such a tree using Doddle. We will save the results to PDF so we can marvel at its beauty.

# +
from doddle import Doddle

seed = "SALET"
doddle = Doddle()
benchmark = doddle.tree_search(seed)
benchmark
# -

graph = benchmark.digraph()
graph.render(format="pdf", outfile=f"Doddle-{seed}.pdf")

StarcoderdataJupyterScriptsDedupFiltered