...with optimality in Iterative Deepening Depth First Search...
because the AI is relatively independent of its details: I've attempted to implement a version of iterative deepening depth-first search in Python as follows (note that this code is almost directly copied from Russell and Norvig's